]> git.lizzy.rs Git - rust.git/blob - tests/ui/derives/deriving-with-repr-packed.stderr
make unaligned_reference a hard error
[rust.git] / tests / ui / derives / deriving-with-repr-packed.stderr
1 warning: byte slice in a packed struct that derives a built-in trait
2   --> $DIR/deriving-with-repr-packed.rs:31:5
3    |
4 LL | #[derive(Debug)]
5    |          ----- in this derive macro expansion
6 ...
7 LL |     data: [u8],
8    |     ^^^^^^^^^^
9    |
10    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
11    = note: for more information, see issue #107457 <https://github.com/rust-lang/rust/issues/107457>
12    = help: consider implementing the trait by hand, or remove the `packed` attribute
13    = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
14    = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
15
16 error[E0507]: cannot move out of `self` which is behind a shared reference
17   --> $DIR/deriving-with-repr-packed.rs:22:10
18    |
19 LL | #[derive(Debug, Default)]
20    |          ----- in this derive macro expansion
21 LL | #[repr(packed)]
22 LL | struct X(Y);
23    |          ^ move occurs because `self.0` has type `Y`, which does not implement the `Copy` trait
24    |
25    = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
26
27 error: aborting due to previous error; 1 warning emitted
28
29 For more information about this error, try `rustc --explain E0507`.
30 Future incompatibility report: Future breakage diagnostic:
31 warning: byte slice in a packed struct that derives a built-in trait
32   --> $DIR/deriving-with-repr-packed.rs:31:5
33    |
34 LL | #[derive(Debug)]
35    |          ----- in this derive macro expansion
36 ...
37 LL |     data: [u8],
38    |     ^^^^^^^^^^
39    |
40    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
41    = note: for more information, see issue #107457 <https://github.com/rust-lang/rust/issues/107457>
42    = help: consider implementing the trait by hand, or remove the `packed` attribute
43    = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
44    = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
45