We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5257aee commit 2fe8572Copy full SHA for 2fe8572
compiler/rustc_lint_defs/src/builtin.rs
@@ -702,6 +702,20 @@ declare_lint! {
702
/// `PhantomData`.
703
///
704
/// Otherwise consider removing the unused code.
705
+ ///
706
+ /// ### Limitations
707
708
+ /// Removing fields that are only used for side-effects and never
709
+ /// read will result in behavioral changes. Examples of this
710
+ /// include:
711
712
+ /// - If a field's value performs an action when it is dropped.
713
+ /// - If a field's type does not implement an auto trait
714
+ /// (e.g. `Send`, `Sync`, `Unpin`).
715
716
+ /// For side-effects from field values, this lint should be
717
+ /// allowed on those fields. For side-effects from field types,
718
+ /// `PhantomData` should be used.
719
pub DEAD_CODE,
720
Warn,
721
"detect unused, unexported items"
0 commit comments