]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/derives/deriving-with-repr-packed.rs
Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.
[rust.git] / tests / ui / derives / deriving-with-repr-packed.rs
index afa91da133dc0f0b862211777c837d3bb4564741..58be4519720178b8fab1f5504fc43607bc8e05a9 100644 (file)
@@ -33,4 +33,14 @@ struct FlexZeroSlice {
     //~^^ this was previously accepted
 }
 
+// Again, currently allowed, but will be phased out.
+#[derive(Debug)]
+#[repr(packed)]
+struct WithStr {
+    width: u8,
+    data: str,
+    //~^ WARNING string slice in a packed struct that derives a built-in trait
+    //~^^ this was previously accepted
+}
+
 fn main() {}