Debian Codegraph @

debian/rust-vendor/zerocopy-derive/tests/ui/mid_compile_pass.nightly.stderr

raw
1 error[E0277]: the trait bound `T: KnownLayout` is not satisfied
2 --> $DIR/mid_compile_pass.rs:67:26
3 |
4 67 | fn test_kl13<T>(t: T) -> impl KnownLayout {
5 | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T`
6 68 |
7 69 | KL13(0u8, t)
8 | ------------ return type was inferred to be `KL13<T>` here
9 |
10 = note: Consider adding `#[derive(KnownLayout)]` to `T`
11 note: required for `KL13<T>` to implement `KnownLayout`
12 --> $DIR/mid_compile_pass.rs:62:10
13 |
14 62 | #[derive(KnownLayout)]
15 | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
16 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
17 help: consider restricting type parameter `T` with trait `KnownLayout`
18 |
19 67 | fn test_kl13<T: zerocopy_renamed::KnownLayout>(t: T) -> impl KnownLayout {
20 | +++++++++++++++++++++++++++++++
21
22 error[E0277]: the size for values of type `T` cannot be known at compilation time
23 --> $DIR/mid_compile_pass.rs:32:15
24 |
25 31 | fn test_kl04<T: ?Sized>(kl: &KL04<T>) {
26 | - this type parameter needs to be `Sized`
27 32 | assert_kl(kl);
28 | --------- ^^ doesn't have a size known at compile-time
29 | |
30 | required by a bound introduced by this call
31 |
32 note: required because it appears within the type `KL04<T>`
33 --> $DIR/mid_compile_pass.rs:29:8
34 |
35 29 | struct KL04<T: ?Sized>(u8, T);
36 | ^^^^
37 note: required for `KL04<T>` to implement `KnownLayout`
38 --> $DIR/mid_compile_pass.rs:27:10
39 |
40 27 | #[derive(KnownLayout)]
41 | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
42 note: required by a bound in `assert_kl`
43 --> $DIR/mid_compile_pass.rs:23:26
44 |
45 23 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
46 | ^^^^^^^^^^^ required by this bound in `assert_kl`
47 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
48 help: consider removing the `?Sized` bound to make the type parameter `Sized`
49 |
50 31 - fn test_kl04<T: ?Sized>(kl: &KL04<T>) {
51 31 + fn test_kl04<T>(kl: &KL04<T>) {
52 |
53
54 error[E0277]: the size for values of type `T` cannot be known at compilation time
55 --> $DIR/mid_compile_pass.rs:43:15
56 |
57 42 | fn test_kl06<T: ?Sized + KnownLayout>(kl: &KL06<T>) {
58 | - this type parameter needs to be `Sized`
59 43 | assert_kl(kl);
60 | --------- ^^ doesn't have a size known at compile-time
61 | |
62 | required by a bound introduced by this call
63 |
64 note: required because it appears within the type `KL06<T>`
65 --> $DIR/mid_compile_pass.rs:40:8
66 |
67 40 | struct KL06<T: ?Sized + KnownLayout>(u8, T);
68 | ^^^^
69 note: required for `KL06<T>` to implement `KnownLayout`
70 --> $DIR/mid_compile_pass.rs:38:10
71 |
72 38 | #[derive(KnownLayout)]
73 | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
74 note: required by a bound in `assert_kl`
75 --> $DIR/mid_compile_pass.rs:23:26
76 |
77 23 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
78 | ^^^^^^^^^^^ required by this bound in `assert_kl`
79 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
80 help: consider removing the `?Sized` bound to make the type parameter `Sized`
81 |
82 42 - fn test_kl06<T: ?Sized + KnownLayout>(kl: &KL06<T>) {
83 42 + fn test_kl06<T: KnownLayout>(kl: &KL06<T>) {
84 |
85
86 error[E0277]: the trait bound `KL12<T>: KnownLayout` is not satisfied
87 --> $DIR/mid_compile_pass.rs:55:15
88 |
89 55 | assert_kl(kl)
90 | --------- ^^ the trait `KnownLayout` is not implemented for `KL12<T>`
91 | |
92 | required by a bound introduced by this call
93 |
94 note: required for `KL12<T>` to implement `KnownLayout`
95 --> $DIR/mid_compile_pass.rs:49:10
96 |
97 49 | #[derive(KnownLayout)]
98 | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
99 note: required by a bound in `assert_kl`
100 --> $DIR/mid_compile_pass.rs:23:26
101 |
102 23 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
103 | ^^^^^^^^^^^ required by this bound in `assert_kl`
104 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
105 help: consider borrowing here
106 |
107 55 | assert_kl(&kl)
108 | +
109 55 | assert_kl(&mut kl)
110 | ++++
111
112 error: aborting due to 4 previous errors
113
114 For more information about this error, try `rustc --explain E0277`.