@@ -1793,6 +1793,10 @@ declare_lint! {
17931793 Warn ,
17941794 "detects name collision with an existing but unstable method" ,
17951795 @future_incompatible = FutureIncompatibleInfo {
1796+ reason: FutureIncompatibilityReason :: Custom (
1797+ "once this associated item is added to the standard library, \
1798+ the ambiguity may cause an error or change in behavior!"
1799+ ) ,
17961800 reference: "issue #48919 <https://github.com/rust-lang/rust/issues/48919>" ,
17971801 // Note: this item represents future incompatibility of all unstable functions in the
17981802 // standard library, and thus should never be removed or changed to an error.
@@ -2335,6 +2339,10 @@ declare_lint! {
23352339 Warn ,
23362340 "reservation of a two-phased borrow conflicts with other shared borrows" ,
23372341 @future_incompatible = FutureIncompatibleInfo {
2342+ reason: FutureIncompatibilityReason :: Custom (
2343+ "this borrowing pattern was not meant to be accepted, \
2344+ and may become a hard error in the future"
2345+ ) ,
23382346 reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>" ,
23392347 } ;
23402348}
@@ -3046,6 +3054,7 @@ declare_lint_pass! {
30463054 DEREF_INTO_DYN_SUPERTRAIT ,
30473055 DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME ,
30483056 DUPLICATE_MACRO_ATTRIBUTES ,
3057+ SUSPICIOUS_AUTO_TRAIT_IMPLS ,
30493058 ]
30503059}
30513060
@@ -3622,3 +3631,37 @@ declare_lint! {
36223631 Warn ,
36233632 "duplicated attribute"
36243633}
3634+
3635+ declare_lint ! {
3636+ /// The `suspicious_auto_trait_impls` lint checks for potentially incorrect
3637+ /// implementations of auto traits.
3638+ ///
3639+ /// ### Example
3640+ ///
3641+ /// ```rust
3642+ /// struct Foo<T>(T);
3643+ ///
3644+ /// unsafe impl<T> Send for Foo<*const T> {}
3645+ /// ```
3646+ ///
3647+ /// {{produces}}
3648+ ///
3649+ /// ### Explanation
3650+ ///
3651+ /// A type can implement auto traits, e.g. `Send`, `Sync` and `Unpin`,
3652+ /// in two different ways: either by writing an explicit impl or if
3653+ /// all fields of the type implement that auto trait.
3654+ ///
3655+ /// The compiler disables the automatic implementation if an explicit one
3656+ /// exists for given type constructor. The exact rules governing this
3657+ /// are currently unsound and quite subtle and and will be modified in the future.
3658+ /// This change will cause the automatic implementation to be disabled in more
3659+ /// cases, potentially breaking some code.
3660+ pub SUSPICIOUS_AUTO_TRAIT_IMPLS ,
3661+ Warn ,
3662+ "the rules governing auto traits will change in the future" ,
3663+ @future_incompatible = FutureIncompatibleInfo {
3664+ reason: FutureIncompatibilityReason :: FutureReleaseSemanticsChange ,
3665+ reference: "issue #93367 <https://github.com/rust-lang/rust/issues/93367>" ,
3666+ } ;
3667+ }
0 commit comments