Debian Codegraph @

.cargo/vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr

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