1 error[E0277]: the size for values of type `U` cannot be known at compilation time
2 --> $DIR/suggest-where-clause.rs:7:20
4 LL | fn check<T: Iterator, U: ?Sized>() {
5 | - this type parameter needs to be `std::marker::Sized`
6 LL | // suggest a where-clause, if needed
7 LL | mem::size_of::<U>();
8 | ^ doesn't have a size known at compile-time
10 ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
12 LL | pub const fn size_of<T>() -> usize {
13 | - required by this bound in `std::mem::size_of`
15 error[E0277]: the size for values of type `U` cannot be known at compilation time
16 --> $DIR/suggest-where-clause.rs:10:5
18 LL | fn check<T: Iterator, U: ?Sized>() {
19 | - this type parameter needs to be `std::marker::Sized`
21 LL | mem::size_of::<Misc<U>>();
22 | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
24 ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
26 LL | pub const fn size_of<T>() -> usize {
27 | - required by this bound in `std::mem::size_of`
29 note: required because it appears within the type `Misc<U>`
30 --> $DIR/suggest-where-clause.rs:3:8
32 LL | struct Misc<T:?Sized>(T);
35 error[E0277]: the trait bound `u64: From<T>` is not satisfied
36 --> $DIR/suggest-where-clause.rs:15:5
38 LL | <u64 as From<T>>::from;
39 | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64`
41 = note: required by `from`
42 help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
44 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
47 error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
48 --> $DIR/suggest-where-clause.rs:18:5
50 LL | <u64 as From<<T as Iterator>::Item>>::from;
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64`
53 = note: required by `from`
54 help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
56 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
57 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59 error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
60 --> $DIR/suggest-where-clause.rs:23:5
62 LL | <Misc<_> as From<T>>::from;
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>`
65 = note: required by `from`
67 error[E0277]: the size for values of type `[T]` cannot be known at compilation time
68 --> $DIR/suggest-where-clause.rs:28:20
70 LL | mem::size_of::<[T]>();
71 | ^^^ doesn't have a size known at compile-time
73 ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
75 LL | pub const fn size_of<T>() -> usize {
76 | - required by this bound in `std::mem::size_of`
78 = help: the trait `Sized` is not implemented for `[T]`
80 error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
81 --> $DIR/suggest-where-clause.rs:31:5
83 LL | mem::size_of::<[&U]>();
84 | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
86 ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
88 LL | pub const fn size_of<T>() -> usize {
89 | - required by this bound in `std::mem::size_of`
91 = help: the trait `Sized` is not implemented for `[&U]`
93 error: aborting due to 7 previous errors
95 For more information about this error, try `rustc --explain E0277`.