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
- warning: string slice in a packed struct that derives a built-in trait
17
- --> $DIR/deriving-with-repr-packed.rs:41:5
18
- |
19
- LL | #[derive(Debug)]
20
- | ----- in this derive macro expansion
21
- ...
22
- LL | data: str,
23
- | ^^^^^^^^^
24
- |
25
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
26
- = note: for more information, see issue #107457 <https://github.com/rust-lang/rust/issues/107457>
27
- = help: consider implementing the trait by hand, or remove the `packed` attribute
28
- = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
29
-
30
1
error[E0507]: cannot move out of `self` which is behind a shared reference
31
2
--> $DIR/deriving-with-repr-packed.rs:22:10
32
3
|
@@ -47,38 +18,43 @@ LL | struct X(Y);
47
18
= note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
48
19
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
49
20
50
- error: aborting due to 1 previous error; 2 warnings emitted
21
+ error[E0161]: cannot move a value of type `[u8]`
22
+ --> $DIR/deriving-with-repr-packed.rs:29:5
23
+ |
24
+ LL | data: [u8],
25
+ | ^^^^^^^^^^ the size of `[u8]` cannot be statically determined
51
26
52
- For more information about this error, try `rustc --explain E0507`.
53
- Future incompatibility report: Future breakage diagnostic:
54
- warning: byte slice in a packed struct that derives a built-in trait
55
- --> $DIR/deriving-with-repr-packed.rs:31:5
27
+ error[E0507]: cannot move out of `self.data` which is behind a shared reference
28
+ --> $DIR/deriving-with-repr-packed.rs:29:5
56
29
|
57
30
LL | #[derive(Debug)]
58
31
| ----- in this derive macro expansion
59
32
...
60
33
LL | data: [u8],
61
- | ^^^^^^^^^^
34
+ | ^^^^^^^^^^ move occurs because `self.data` has type `[u8]`, which does not implement the `Copy` trait
35
+ |
36
+ = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
37
+ = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
38
+
39
+ error[E0161]: cannot move a value of type `str`
40
+ --> $DIR/deriving-with-repr-packed.rs:38:5
62
41
|
63
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
64
- = note: for more information, see issue #107457 <https://github.com/rust-lang/rust/issues/107457>
65
- = help: consider implementing the trait by hand, or remove the `packed` attribute
66
- = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
67
- = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
42
+ LL | data: str,
43
+ | ^^^^^^^^^ the size of `str` cannot be statically determined
68
44
69
- Future breakage diagnostic:
70
- warning: string slice in a packed struct that derives a built-in trait
71
- --> $DIR/deriving-with-repr-packed.rs:41:5
45
+ error[E0507]: cannot move out of `self.data` which is behind a shared reference
46
+ --> $DIR/deriving-with-repr-packed.rs:38:5
72
47
|
73
48
LL | #[derive(Debug)]
74
49
| ----- in this derive macro expansion
75
50
...
76
51
LL | data: str,
77
- | ^^^^^^^^^
52
+ | ^^^^^^^^^ move occurs because `self.data` has type `str`, which does not implement the `Copy` trait
78
53
|
79
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
80
- = note: for more information, see issue #107457 <https://github.com/rust-lang/rust/issues/107457>
81
- = help: consider implementing the trait by hand, or remove the `packed` attribute
82
- = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
83
- = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
54
+ = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
55
+ = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
56
+
57
+ error: aborting due to 5 previous errors
84
58
59
+ Some errors have detailed explanations: E0161, E0507.
60
+ For more information about an error, try `rustc --explain E0161`.
0 commit comments