File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
compiler/rustc_lint_defs/src Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -702,6 +702,20 @@ declare_lint! {
702702 /// `PhantomData`.
703703 ///
704704 /// 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 dropping field values, this lint should
717+ /// be allowed on those fields. For side-effects from containing
718+ /// field types, `PhantomData` should be used.
705719 pub DEAD_CODE ,
706720 Warn ,
707721 "detect unused, unexported items"
You can’t perform that action at this time.
0 commit comments