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 note: required by a bound in `std::mem::size_of`
11 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
12 help: consider removing the `?Sized` bound to make the type parameter `Sized`
14 LL - fn check<T: Iterator, U: ?Sized>() {
15 LL + fn check<T: Iterator, U>() {
18 error[E0277]: the size for values of type `U` cannot be known at compilation time
19 --> $DIR/suggest-where-clause.rs:10:20
21 LL | fn check<T: Iterator, U: ?Sized>() {
22 | - this type parameter needs to be `std::marker::Sized`
24 LL | mem::size_of::<Misc<U>>();
25 | ^^^^^^^ doesn't have a size known at compile-time
27 note: required because it appears within the type `Misc<U>`
28 --> $DIR/suggest-where-clause.rs:3:8
30 LL | struct Misc<T:?Sized>(T);
32 note: required by a bound in `std::mem::size_of`
33 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
34 help: consider removing the `?Sized` bound to make the type parameter `Sized`
36 LL - fn check<T: Iterator, U: ?Sized>() {
37 LL + fn check<T: Iterator, U>() {
40 error[E0277]: the trait bound `u64: From<T>` is not satisfied
41 --> $DIR/suggest-where-clause.rs:15:5
43 LL | <u64 as From<T>>::from;
44 | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64`
46 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
48 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
51 error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
52 --> $DIR/suggest-where-clause.rs:18:5
54 LL | <u64 as From<<T as Iterator>::Item>>::from;
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64`
57 help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
59 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
60 | ++++++++++++++++++++++++++++++++++++++
62 error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
63 --> $DIR/suggest-where-clause.rs:23:5
65 LL | <Misc<_> as From<T>>::from;
66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>`
68 error[E0277]: the size for values of type `[T]` cannot be known at compilation time
69 --> $DIR/suggest-where-clause.rs:28:20
71 LL | mem::size_of::<[T]>();
72 | ^^^ doesn't have a size known at compile-time
74 = help: the trait `Sized` is not implemented for `[T]`
75 note: required by a bound in `std::mem::size_of`
76 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
78 error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
79 --> $DIR/suggest-where-clause.rs:31:20
81 LL | mem::size_of::<[&U]>();
82 | ^^^^ doesn't have a size known at compile-time
84 = help: the trait `Sized` is not implemented for `[&U]`
85 note: required by a bound in `std::mem::size_of`
86 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
88 error: aborting due to 7 previous errors
90 For more information about this error, try `rustc --explain E0277`.