You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like disallowed_methods and disallowed_types, this lint warns when a field on a type is used.
Lint Name
disallowed_fields
Category
style
Advantage
Using some field on some type may be discouraged in some library.
For example, the ABI of some type in a library you depend on may make hiding a field impossible but using said field should be discouraged by code inside your implementation. The lint would allow a more obvious warning.
Drawbacks
Might be a niche lint.
Example
Could use a better type as an example:
# clippy.tomldisallowed-fields = [
# Can use a string as the path of the disallowed field."std::ops::Range::start",
# Can also use an inline table with a `path` key.
{ path = "std::ops::Range::start" },
# When using an inline table, can add a `reason` for why the field# is disallowed.
{ path = "std::ops::Range::start", reason = "The start of the range is not used" },
]
The text was updated successfully, but these errors were encountered:
What it does
Like disallowed_methods and disallowed_types, this lint warns when a field on a type is used.
Lint Name
disallowed_fields
Category
style
Advantage
Drawbacks
Example
Could use a better type as an example:
The text was updated successfully, but these errors were encountered: