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