@@ -1793,6 +1793,10 @@ declare_lint! {
1793
1793
Warn ,
1794
1794
"detects name collision with an existing but unstable method" ,
1795
1795
@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
+ ) ,
1796
1800
reference: "issue #48919 <https://github.com/rust-lang/rust/issues/48919>" ,
1797
1801
// Note: this item represents future incompatibility of all unstable functions in the
1798
1802
// standard library, and thus should never be removed or changed to an error.
@@ -2335,6 +2339,10 @@ declare_lint! {
2335
2339
Warn ,
2336
2340
"reservation of a two-phased borrow conflicts with other shared borrows" ,
2337
2341
@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
+ ) ,
2338
2346
reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>" ,
2339
2347
} ;
2340
2348
}
@@ -3046,6 +3054,7 @@ declare_lint_pass! {
3046
3054
DEREF_INTO_DYN_SUPERTRAIT ,
3047
3055
DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME ,
3048
3056
DUPLICATE_MACRO_ATTRIBUTES ,
3057
+ SUSPICIOUS_AUTO_TRAIT_IMPLS ,
3049
3058
]
3050
3059
}
3051
3060
@@ -3622,3 +3631,37 @@ declare_lint! {
3622
3631
Warn ,
3623
3632
"duplicated attribute"
3624
3633
}
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