@@ -3070,16 +3070,19 @@ declare_lint! {
3070
3070
3071
3071
declare_lint ! {
3072
3072
/// The `rust_2021_incompatible_closure_captures` lint detects variables that aren't completely
3073
- /// captured in Rust 2021 and affect the Drop order of at least one path starting at this variable.
3074
- /// It can also detect when a variable implements a trait, but one of its field does not and
3075
- /// the field is captured by a closure and used with the assumption that said field implements
3073
+ /// captured in Rust 2021, such that the `Drop` order of their fields may differ between
3074
+ /// Rust 2018 and 2021.
3075
+ ///
3076
+ /// It can also detect when a variable implements a trait like `Send`, but one of its fields does not,
3077
+ /// and the field is captured by a closure and used with the assumption that said field implements
3076
3078
/// the same trait as the root variable.
3077
3079
///
3078
3080
/// ### Example of drop reorder
3079
3081
///
3080
3082
/// ```rust,compile_fail
3081
- /// # # ![deny(rust_2021_incompatible_closure_captures)]
3083
+ /// #![deny(rust_2021_incompatible_closure_captures)]
3082
3084
/// # #![allow(unused)]
3085
+ ///
3083
3086
/// struct FancyInteger(i32);
3084
3087
///
3085
3088
/// impl Drop for FancyInteger {
@@ -3133,8 +3136,8 @@ declare_lint! {
3133
3136
/// ### Explanation
3134
3137
///
3135
3138
/// In the above example, only `fptr.0` is captured in Rust 2021.
3136
- /// The field is of type *mut i32 which doesn't implement Send, making the code invalid as the
3137
- /// field cannot be sent between thread safely.
3139
+ /// The field is of type ` *mut i32`, which doesn't implement ` Send`,
3140
+ /// making the code invalid as the field cannot be sent between threads safely.
3138
3141
pub RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES ,
3139
3142
Allow ,
3140
3143
"detects closures affected by Rust 2021 changes" ,
@@ -3254,6 +3257,7 @@ declare_lint! {
3254
3257
///
3255
3258
/// ```rust,compile_fail
3256
3259
/// #![deny(rust_2021_incompatible_or_patterns)]
3260
+ ///
3257
3261
/// macro_rules! match_any {
3258
3262
/// ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {
3259
3263
/// match $expr {
@@ -3275,7 +3279,7 @@ declare_lint! {
3275
3279
///
3276
3280
/// ### Explanation
3277
3281
///
3278
- /// In Rust 2021, the pat matcher will match new patterns, which include the | character.
3282
+ /// In Rust 2021, the ` pat` matcher will match additional patterns, which include the `|` character.
3279
3283
pub RUST_2021_INCOMPATIBLE_OR_PATTERNS ,
3280
3284
Allow ,
3281
3285
"detects usage of old versions of or-patterns" ,
@@ -3320,8 +3324,8 @@ declare_lint! {
3320
3324
/// In Rust 2021, one of the important introductions is the [prelude changes], which add
3321
3325
/// `TryFrom`, `TryInto`, and `FromIterator` into the standard library's prelude. Since this
3322
3326
/// results in an ambiguity as to which method/function to call when an existing `try_into`
3323
- /// method is called via dot-call syntax or a `try_from`/`from_iter` associated function
3324
- /// is called directly on a type.
3327
+ /// method is called via dot-call syntax or a `try_from`/`from_iter` associated function
3328
+ /// is called directly on a type.
3325
3329
///
3326
3330
/// [prelude changes]: https://blog.rust-lang.org/inside-rust/2021/03/04/planning-rust-2021.html#prelude-changes
3327
3331
pub RUST_2021_PRELUDE_COLLISIONS ,
0 commit comments