File tree 1 file changed +14
-0
lines changed
compiler/rustc_lint_defs/src
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -704,6 +704,20 @@ declare_lint! {
704
704
/// `PhantomData`.
705
705
///
706
706
/// Otherwise consider removing the unused code.
707
+ ///
708
+ /// ### Limitations
709
+ ///
710
+ /// Removing fields that are only used for side-effects and never
711
+ /// read will result in behavioral changes. Examples of this
712
+ /// include:
713
+ ///
714
+ /// - If a field's value performs an action when it is dropped.
715
+ /// - If a field's type does not implement an auto trait
716
+ /// (e.g. `Send`, `Sync`, `Unpin`).
717
+ ///
718
+ /// For side-effects from dropping field values, this lint should
719
+ /// be allowed on those fields. For side-effects from containing
720
+ /// field types, `PhantomData` should be used.
707
721
pub DEAD_CODE ,
708
722
Warn ,
709
723
"detect unused, unexported items"
You can’t perform that action at this time.
0 commit comments