fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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