]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/suggest-where-clause.stderr
Auto merge of #87284 - Aaron1011:remove-paren-special, r=petrochenkov
[rust.git] / src / test / ui / traits / suggest-where-clause.stderr
1 error[E0277]: the size for values of type `U` cannot be known at compilation time
2   --> $DIR/suggest-where-clause.rs:7:20
3    |
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
9    | 
10   ::: $SRC_DIR/core/src/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`
14
15 error[E0277]: the size for values of type `U` cannot be known at compilation time
16   --> $DIR/suggest-where-clause.rs:10:5
17    |
18 LL | fn check<T: Iterator, U: ?Sized>() {
19    |                       - this type parameter needs to be `std::marker::Sized`
20 ...
21 LL |     mem::size_of::<Misc<U>>();
22    |     ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
23    | 
24   ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
25    |
26 LL | pub const fn size_of<T>() -> usize {
27    |                      - required by this bound in `std::mem::size_of`
28    |
29 note: required because it appears within the type `Misc<U>`
30   --> $DIR/suggest-where-clause.rs:3:8
31    |
32 LL | struct Misc<T:?Sized>(T);
33    |        ^^^^
34
35 error[E0277]: the trait bound `u64: From<T>` is not satisfied
36   --> $DIR/suggest-where-clause.rs:15:5
37    |
38 LL |     <u64 as From<T>>::from;
39    |     ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64`
40    |
41 note: required by `from`
42   --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
43    |
44 LL |     fn from(_: T) -> Self;
45    |     ^^^^^^^^^^^^^^^^^^^^^^
46 help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
47    |
48 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
49    |                                    ^^^^^^^^^^^^^^^^^^
50
51 error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
52   --> $DIR/suggest-where-clause.rs:18:5
53    |
54 LL |     <u64 as From<<T as Iterator>::Item>>::from;
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64`
56    |
57 note: required by `from`
58   --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
59    |
60 LL |     fn from(_: T) -> Self;
61    |     ^^^^^^^^^^^^^^^^^^^^^^
62 help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
63    |
64 LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
65    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67 error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
68   --> $DIR/suggest-where-clause.rs:23:5
69    |
70 LL |     <Misc<_> as From<T>>::from;
71    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>`
72    |
73 note: required by `from`
74   --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
75    |
76 LL |     fn from(_: T) -> Self;
77    |     ^^^^^^^^^^^^^^^^^^^^^^
78
79 error[E0277]: the size for values of type `[T]` cannot be known at compilation time
80   --> $DIR/suggest-where-clause.rs:28:20
81    |
82 LL |     mem::size_of::<[T]>();
83    |                    ^^^ doesn't have a size known at compile-time
84    | 
85   ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
86    |
87 LL | pub const fn size_of<T>() -> usize {
88    |                      - required by this bound in `std::mem::size_of`
89    |
90    = help: the trait `Sized` is not implemented for `[T]`
91
92 error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
93   --> $DIR/suggest-where-clause.rs:31:5
94    |
95 LL |     mem::size_of::<[&U]>();
96    |     ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
97    | 
98   ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
99    |
100 LL | pub const fn size_of<T>() -> usize {
101    |                      - required by this bound in `std::mem::size_of`
102    |
103    = help: the trait `Sized` is not implemented for `[&U]`
104
105 error: aborting due to 7 previous errors
106
107 For more information about this error, try `rustc --explain E0277`.