rust/tests/ui/traits/suggest-where-clause.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
3.5 KiB
Plaintext
Raw Normal View History

2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `U` cannot be known at compilation time
2021-02-08 22:15:45 +00:00
--> $DIR/suggest-where-clause.rs:7:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
| - this type parameter needs to be `Sized`
LL | // suggest a where-clause, if needed
2018-02-23 00:42:32 +00:00
LL | mem::size_of::<U>();
| ^ doesn't have a size known at compile-time
|
note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
LL + fn check<T: Iterator, U>() {
2022-06-08 17:34:57 +00:00
|
2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `U` cannot be known at compilation time
2022-08-16 06:27:22 +00:00
--> $DIR/suggest-where-clause.rs:10:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
| - this type parameter needs to be `Sized`
...
2018-02-23 00:42:32 +00:00
LL | mem::size_of::<Misc<U>>();
2022-08-16 06:27:22 +00:00
| ^^^^^^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `Misc<U>`
--> $DIR/suggest-where-clause.rs:3:8
|
LL | struct Misc<T:?Sized>(T);
| ^^^^
note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
LL + fn check<T: Iterator, U>() {
2022-06-08 17:34:57 +00:00
|
error[E0277]: the trait bound `u64: From<T>` is not satisfied
2021-02-08 22:15:45 +00:00
--> $DIR/suggest-where-clause.rs:15:5
|
2018-02-23 00:42:32 +00:00
LL | <u64 as From<T>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64`
|
2022-06-06 00:37:45 +00:00
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
| ++++++++++++++++++
error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
2021-02-08 22:15:45 +00:00
--> $DIR/suggest-where-clause.rs:18:5
|
2018-02-23 00:42:32 +00:00
LL | <u64 as From<<T as Iterator>::Item>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64`
|
2022-06-06 00:37:45 +00:00
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
| ++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
2021-02-08 22:15:45 +00:00
--> $DIR/suggest-where-clause.rs:23:5
|
2018-02-23 00:42:32 +00:00
LL | <Misc<_> as From<T>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>`
2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `[T]` cannot be known at compilation time
2021-02-08 22:15:45 +00:00
--> $DIR/suggest-where-clause.rs:28:20
|
2018-02-23 00:42:32 +00:00
LL | mem::size_of::<[T]>();
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[T]`
note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:31:20
|
2018-02-23 00:42:32 +00:00
LL | mem::size_of::<[&U]>();
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[&U]`
note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
error: aborting due to 7 previous errors
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0277`.