]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0277]: the size for values of type `U` cannot be known at compilation time |
6a06907d | 2 | --> $DIR/suggest-where-clause.rs:7:20 |
ff7c6d11 | 3 | | |
e74abb32 | 4 | LL | fn check<T: Iterator, U: ?Sized>() { |
cdc7bbd5 | 5 | | - this type parameter needs to be `std::marker::Sized` |
e74abb32 | 6 | LL | // suggest a where-clause, if needed |
0531ce1d | 7 | LL | mem::size_of::<U>(); |
e1599b0c | 8 | | ^ doesn't have a size known at compile-time |
94222f64 XL |
9 | | |
10 | note: required by a bound in `std::mem::size_of` | |
11 | --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | |
e1599b0c XL |
12 | | |
13 | LL | pub const fn size_of<T>() -> usize { | |
94222f64 XL |
14 | | ^ required by this bound in `std::mem::size_of` |
15 | help: consider removing the `?Sized` bound to make the type parameter `Sized` | |
16 | | | |
17 | LL - fn check<T: Iterator, U: ?Sized>() { | |
18 | LL + fn check<T: Iterator, U>() { | |
19 | | | |
ff7c6d11 | 20 | |
8faf50e0 | 21 | error[E0277]: the size for values of type `U` cannot be known at compilation time |
6a06907d | 22 | --> $DIR/suggest-where-clause.rs:10:5 |
ff7c6d11 | 23 | | |
e74abb32 | 24 | LL | fn check<T: Iterator, U: ?Sized>() { |
cdc7bbd5 | 25 | | - this type parameter needs to be `std::marker::Sized` |
e74abb32 | 26 | ... |
0531ce1d | 27 | LL | mem::size_of::<Misc<U>>(); |
8faf50e0 | 28 | | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
ff7c6d11 | 29 | | |
cdc7bbd5 XL |
30 | note: required because it appears within the type `Misc<U>` |
31 | --> $DIR/suggest-where-clause.rs:3:8 | |
32 | | | |
33 | LL | struct Misc<T:?Sized>(T); | |
34 | | ^^^^ | |
94222f64 XL |
35 | note: required by a bound in `std::mem::size_of` |
36 | --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | |
37 | | | |
38 | LL | pub const fn size_of<T>() -> usize { | |
39 | | ^ required by this bound in `std::mem::size_of` | |
40 | help: consider removing the `?Sized` bound to make the type parameter `Sized` | |
41 | | | |
42 | LL - fn check<T: Iterator, U: ?Sized>() { | |
43 | LL + fn check<T: Iterator, U>() { | |
44 | | | |
ff7c6d11 | 45 | |
1b1a35ee | 46 | error[E0277]: the trait bound `u64: From<T>` is not satisfied |
6a06907d | 47 | --> $DIR/suggest-where-clause.rs:15:5 |
ff7c6d11 | 48 | | |
0531ce1d | 49 | LL | <u64 as From<T>>::from; |
1b1a35ee | 50 | | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64` |
ff7c6d11 | 51 | | |
6a06907d XL |
52 | help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement |
53 | | | |
54 | LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> { | |
94222f64 | 55 | | ++++++++++++++++++ |
ff7c6d11 | 56 | |
1b1a35ee | 57 | error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied |
6a06907d | 58 | --> $DIR/suggest-where-clause.rs:18:5 |
ff7c6d11 | 59 | | |
0531ce1d | 60 | LL | <u64 as From<<T as Iterator>::Item>>::from; |
1b1a35ee | 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64` |
ff7c6d11 | 62 | | |
6a06907d XL |
63 | help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement |
64 | | | |
65 | LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> { | |
94222f64 | 66 | | ++++++++++++++++++++++++++++++++++++++ |
ff7c6d11 | 67 | |
1b1a35ee | 68 | error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied |
6a06907d | 69 | --> $DIR/suggest-where-clause.rs:23:5 |
ff7c6d11 | 70 | | |
0531ce1d | 71 | LL | <Misc<_> as From<T>>::from; |
1b1a35ee | 72 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>` |
ff7c6d11 | 73 | |
8faf50e0 | 74 | error[E0277]: the size for values of type `[T]` cannot be known at compilation time |
6a06907d | 75 | --> $DIR/suggest-where-clause.rs:28:20 |
ff7c6d11 | 76 | | |
0531ce1d | 77 | LL | mem::size_of::<[T]>(); |
e1599b0c | 78 | | ^^^ doesn't have a size known at compile-time |
ff7c6d11 | 79 | | |
1b1a35ee | 80 | = help: the trait `Sized` is not implemented for `[T]` |
94222f64 XL |
81 | note: required by a bound in `std::mem::size_of` |
82 | --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | |
83 | | | |
84 | LL | pub const fn size_of<T>() -> usize { | |
85 | | ^ required by this bound in `std::mem::size_of` | |
ff7c6d11 | 86 | |
8faf50e0 | 87 | error[E0277]: the size for values of type `[&U]` cannot be known at compilation time |
6a06907d | 88 | --> $DIR/suggest-where-clause.rs:31:5 |
ff7c6d11 | 89 | | |
0531ce1d | 90 | LL | mem::size_of::<[&U]>(); |
8faf50e0 | 91 | | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
ff7c6d11 | 92 | | |
1b1a35ee | 93 | = help: the trait `Sized` is not implemented for `[&U]` |
94222f64 XL |
94 | note: required by a bound in `std::mem::size_of` |
95 | --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | |
96 | | | |
97 | LL | pub const fn size_of<T>() -> usize { | |
98 | | ^ required by this bound in `std::mem::size_of` | |
ff7c6d11 XL |
99 | |
100 | error: aborting due to 7 previous errors | |
101 | ||
0531ce1d | 102 | For more information about this error, try `rustc --explain E0277`. |