• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1error[E0277]: the trait bound `T: KnownLayout` is not satisfied
2  --> tests/ui-stable/mid_compile_pass.rs:59:26
3   |
459 | fn test_kl13<T>(t: T) -> impl KnownLayout {
5   |                          ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL13<T>: KnownLayout`
6   |
7note: required for `KL13<T>` to implement `KnownLayout`
8  --> tests/ui-stable/mid_compile_pass.rs:55:10
9   |
1055 | #[derive(KnownLayout)]
11   |          ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
12   = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
13help: consider restricting type parameter `T`
14   |
1559 | fn test_kl13<T: zerocopy::KnownLayout>(t: T) -> impl KnownLayout {
16   |               +++++++++++++++++++++++
17
18error[E0277]: the size for values of type `T` cannot be known at compilation time
19  --> tests/ui-stable/mid_compile_pass.rs:31:15
20   |
2130 | fn test_kl04<T: ?Sized>(kl: &KL04<T>) {
22   |              - this type parameter needs to be `Sized`
2331 |     assert_kl(kl);
24   |     --------- ^^ doesn't have a size known at compile-time
25   |     |
26   |     required by a bound introduced by this call
27   |
28note: required because it appears within the type `KL04<T>`
29  --> tests/ui-stable/mid_compile_pass.rs:28:8
30   |
3128 | struct KL04<T: ?Sized>(u8, T);
32   |        ^^^^
33note: required for `KL04<T>` to implement `KnownLayout`
34  --> tests/ui-stable/mid_compile_pass.rs:27:10
35   |
3627 | #[derive(KnownLayout)]
37   |          ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
38note: required by a bound in `assert_kl`
39  --> tests/ui-stable/mid_compile_pass.rs:23:26
40   |
4123 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
42   |                          ^^^^^^^^^^^ required by this bound in `assert_kl`
43   = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
44help: consider removing the `?Sized` bound to make the type parameter `Sized`
45   |
4630 - fn test_kl04<T: ?Sized>(kl: &KL04<T>) {
4730 + fn test_kl04<T>(kl: &KL04<T>) {
48   |
49
50error[E0277]: the size for values of type `T` cannot be known at compilation time
51  --> tests/ui-stable/mid_compile_pass.rs:40:15
52   |
5339 | fn test_kl06<T: ?Sized + KnownLayout>(kl: &KL06<T>) {
54   |              - this type parameter needs to be `Sized`
5540 |     assert_kl(kl);
56   |     --------- ^^ doesn't have a size known at compile-time
57   |     |
58   |     required by a bound introduced by this call
59   |
60note: required because it appears within the type `KL06<T>`
61  --> tests/ui-stable/mid_compile_pass.rs:37:8
62   |
6337 | struct KL06<T: ?Sized + KnownLayout>(u8, T);
64   |        ^^^^
65note: required for `KL06<T>` to implement `KnownLayout`
66  --> tests/ui-stable/mid_compile_pass.rs:36:10
67   |
6836 | #[derive(KnownLayout)]
69   |          ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
70note: required by a bound in `assert_kl`
71  --> tests/ui-stable/mid_compile_pass.rs:23:26
72   |
7323 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
74   |                          ^^^^^^^^^^^ required by this bound in `assert_kl`
75   = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
76help: consider removing the `?Sized` bound to make the type parameter `Sized`
77   |
7839 - fn test_kl06<T: ?Sized + KnownLayout>(kl: &KL06<T>) {
7939 + fn test_kl06<T: KnownLayout>(kl: &KL06<T>) {
80   |
81
82error[E0277]: the trait bound `T: KnownLayout` is not satisfied
83  --> tests/ui-stable/mid_compile_pass.rs:50:15
84   |
8550 |     assert_kl(kl)
86   |     --------- ^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL12<T>: KnownLayout`
87   |     |
88   |     required by a bound introduced by this call
89   |
90note: required for `KL12<T>` to implement `KnownLayout`
91  --> tests/ui-stable/mid_compile_pass.rs:45:10
92   |
9345 | #[derive(KnownLayout)]
94   |          ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
95note: required by a bound in `assert_kl`
96  --> tests/ui-stable/mid_compile_pass.rs:23:26
97   |
9823 | fn assert_kl<T: ?Sized + KnownLayout>(_: &T) {}
99   |                          ^^^^^^^^^^^ required by this bound in `assert_kl`
100   = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info)
101help: consider further restricting this bound
102   |
10349 | fn test_kl12<T: ?Sized + zerocopy::KnownLayout>(kl: &KL12<T>) {
104   |                        +++++++++++++++++++++++
105