]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0277]: the size for values of type `U` cannot be known at compilation time |
ba9703b0 | 2 | --> $DIR/trait-suggest-where-clause.rs:7:20 |
ff7c6d11 | 3 | | |
e74abb32 | 4 | LL | fn check<T: Iterator, U: ?Sized>() { |
74b04a01 | 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 XL |
8 | | ^ doesn't have a size known at compile-time |
9 | | | |
10 | ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL | |
11 | | | |
12 | LL | pub const fn size_of<T>() -> usize { | |
13 | | - required by this bound in `std::mem::size_of` | |
ff7c6d11 XL |
14 | | |
15 | = help: the trait `std::marker::Sized` is not implemented for `U` | |
0731742a | 16 | = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> |
ff7c6d11 | 17 | |
8faf50e0 | 18 | error[E0277]: the size for values of type `U` cannot be known at compilation time |
ba9703b0 | 19 | --> $DIR/trait-suggest-where-clause.rs:10:5 |
ff7c6d11 | 20 | | |
e74abb32 | 21 | LL | fn check<T: Iterator, U: ?Sized>() { |
74b04a01 | 22 | | - this type parameter needs to be `std::marker::Sized` |
e74abb32 | 23 | ... |
0531ce1d | 24 | LL | mem::size_of::<Misc<U>>(); |
8faf50e0 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
e1599b0c XL |
26 | | |
27 | ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL | |
28 | | | |
29 | LL | pub const fn size_of<T>() -> usize { | |
30 | | - required by this bound in `std::mem::size_of` | |
ff7c6d11 XL |
31 | | |
32 | = help: within `Misc<U>`, the trait `std::marker::Sized` is not implemented for `U` | |
0731742a | 33 | = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> |
ff7c6d11 | 34 | = note: required because it appears within the type `Misc<U>` |
ff7c6d11 XL |
35 | |
36 | error[E0277]: the trait bound `u64: std::convert::From<T>` is not satisfied | |
ba9703b0 | 37 | --> $DIR/trait-suggest-where-clause.rs:15:5 |
ff7c6d11 | 38 | | |
0531ce1d | 39 | LL | <u64 as From<T>>::from; |
ff7c6d11 XL |
40 | | ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `u64` |
41 | | | |
ff7c6d11 XL |
42 | = note: required by `std::convert::From::from` |
43 | ||
44 | error[E0277]: the trait bound `u64: std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied | |
ba9703b0 | 45 | --> $DIR/trait-suggest-where-clause.rs:18:5 |
ff7c6d11 | 46 | | |
0531ce1d | 47 | LL | <u64 as From<<T as Iterator>::Item>>::from; |
ff7c6d11 XL |
48 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<<T as std::iter::Iterator>::Item>` is not implemented for `u64` |
49 | | | |
ff7c6d11 XL |
50 | = note: required by `std::convert::From::from` |
51 | ||
52 | error[E0277]: the trait bound `Misc<_>: std::convert::From<T>` is not satisfied | |
ba9703b0 | 53 | --> $DIR/trait-suggest-where-clause.rs:23:5 |
ff7c6d11 | 54 | | |
0531ce1d | 55 | LL | <Misc<_> as From<T>>::from; |
ff7c6d11 XL |
56 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `Misc<_>` |
57 | | | |
58 | = note: required by `std::convert::From::from` | |
59 | ||
8faf50e0 | 60 | error[E0277]: the size for values of type `[T]` cannot be known at compilation time |
ba9703b0 | 61 | --> $DIR/trait-suggest-where-clause.rs:28:20 |
ff7c6d11 | 62 | | |
0531ce1d | 63 | LL | mem::size_of::<[T]>(); |
e1599b0c XL |
64 | | ^^^ doesn't have a size known at compile-time |
65 | | | |
66 | ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL | |
67 | | | |
68 | LL | pub const fn size_of<T>() -> usize { | |
69 | | - required by this bound in `std::mem::size_of` | |
ff7c6d11 XL |
70 | | |
71 | = help: the trait `std::marker::Sized` is not implemented for `[T]` | |
0731742a | 72 | = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> |
ff7c6d11 | 73 | |
8faf50e0 | 74 | error[E0277]: the size for values of type `[&U]` cannot be known at compilation time |
ba9703b0 | 75 | --> $DIR/trait-suggest-where-clause.rs:31:5 |
ff7c6d11 | 76 | | |
0531ce1d | 77 | LL | mem::size_of::<[&U]>(); |
8faf50e0 | 78 | | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
e1599b0c XL |
79 | | |
80 | ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL | |
81 | | | |
82 | LL | pub const fn size_of<T>() -> usize { | |
83 | | - required by this bound in `std::mem::size_of` | |
ff7c6d11 XL |
84 | | |
85 | = help: the trait `std::marker::Sized` is not implemented for `[&U]` | |
0731742a | 86 | = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> |
ff7c6d11 XL |
87 | |
88 | error: aborting due to 7 previous errors | |
89 | ||
0531ce1d | 90 | For more information about this error, try `rustc --explain E0277`. |