X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_lint_defs%2Fsrc%2Fbuiltin.rs;h=9d8ad9d9ed9f6f5c7d2fa66b7e0d656ba2393581;hb=a70d03b62454f57672e14b48715ae10c01e5fd34;hp=7e9ba4cd22b8d8132f62ad6158678df3b74ad2a8;hpb=beb5cc9cf79b782094bb75fe41df3b7bdbb05bd7;p=rust.git diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 7e9ba4cd22b..9d8ad9d9ed9 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4073,7 +4073,8 @@ declare_lint! { /// The `byte_slice_in_packed_struct_with_derive` lint detects cases where a byte slice field - /// (`[u8]`) is used in a `packed` struct that derives one or more built-in traits. + /// (`[u8]`) or string slice field (`str`) is used in a `packed` struct that derives one or + /// more built-in traits. /// /// ### Example /// @@ -4091,11 +4092,11 @@ /// ### Explanation /// /// This was previously accepted but is being phased out, because fields in packed structs are - /// now required to implement `Copy` for `derive` to work. Byte slices are a temporary - /// exception because certain crates depended on them. + /// now required to implement `Copy` for `derive` to work. Byte slices and string slices are a + /// temporary exception because certain crates depended on them. pub BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE, Warn, - "`[u8]` slice used in a packed struct with `derive`", + "`[u8]` or `str` used in a packed struct with `derive`", @future_incompatible = FutureIncompatibleInfo { reference: "issue #107457 ", reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow,