X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fui%2Fderives%2Fderiving-with-repr-packed.rs;h=58be4519720178b8fab1f5504fc43607bc8e05a9;hb=a70d03b62454f57672e14b48715ae10c01e5fd34;hp=afa91da133dc0f0b862211777c837d3bb4564741;hpb=ef934d9b632b8ac00276558824664c104b92b5f0;p=rust.git diff --git a/tests/ui/derives/deriving-with-repr-packed.rs b/tests/ui/derives/deriving-with-repr-packed.rs index afa91da133d..58be4519720 100644 --- a/tests/ui/derives/deriving-with-repr-packed.rs +++ b/tests/ui/derives/deriving-with-repr-packed.rs @@ -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() {}