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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-10-07 21:23:56 +00:00
|
|
|
LL | fn check<T: Iterator, U: ?Sized>() {
|
2021-03-30 09:56:39 +00:00
|
|
|
| - this type parameter needs to be `std::marker::Sized`
|
2019-10-07 21:23:56 +00:00
|
|
|
LL | // suggest a where-clause, if needed
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::size_of::<U>();
|
2019-09-20 18:58:20 +00:00
|
|
|
| ^ doesn't have a size known at compile-time
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
|
|
|
LL | pub const fn size_of<T>() -> usize {
|
|
|
|
| - required by this bound in `std::mem::size_of`
|
2021-07-24 01:47:53 +00:00
|
|
|
|
|
|
|
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
|
|
|
|
|
|
|
|
LL | fn check<T: Iterator, U>() {
|
|
|
|
| --
|
2017-12-10 19:47:55 +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
|
2021-02-08 22:15:45 +00:00
|
|
|
--> $DIR/suggest-where-clause.rs:10:5
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-10-07 21:23:56 +00:00
|
|
|
LL | fn check<T: Iterator, U: ?Sized>() {
|
2021-03-30 09:56:39 +00:00
|
|
|
| - this type parameter needs to be `std::marker::Sized`
|
2019-10-07 21:23:56 +00:00
|
|
|
...
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::size_of::<Misc<U>>();
|
2018-06-19 22:53:51 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
|
|
|
LL | pub const fn size_of<T>() -> usize {
|
|
|
|
| - required by this bound in `std::mem::size_of`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2021-03-30 20:37:30 +00:00
|
|
|
note: required because it appears within the type `Misc<U>`
|
|
|
|
--> $DIR/suggest-where-clause.rs:3:8
|
|
|
|
|
|
|
|
|
LL | struct Misc<T:?Sized>(T);
|
|
|
|
| ^^^^
|
2021-07-24 01:47:53 +00:00
|
|
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
|
|
|
|
|
|
|
|
LL | fn check<T: Iterator, U>() {
|
|
|
|
| --
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2020-09-02 07:40:56 +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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | <u64 as From<T>>::from;
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2021-07-17 18:13:50 +00:00
|
|
|
note: required by `from`
|
|
|
|
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | fn from(_: T) -> Self;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2021-02-16 19:02:39 +00:00
|
|
|
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
|
|
|
|
|
|
|
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | <u64 as From<<T as Iterator>::Item>>::from;
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2021-07-17 18:13:50 +00:00
|
|
|
note: required by `from`
|
|
|
|
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | fn from(_: T) -> Self;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2021-02-16 19:02:39 +00:00
|
|
|
help: consider introducing a `where` bound, 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> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | <Misc<_> as From<T>>::from;
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2021-07-17 18:13:50 +00:00
|
|
|
note: required by `from`
|
|
|
|
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | fn from(_: T) -> Self;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::size_of::<[T]>();
|
2019-09-20 18:58:20 +00:00
|
|
|
| ^^^ doesn't have a size known at compile-time
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
|
|
|
LL | pub const fn size_of<T>() -> usize {
|
|
|
|
| - required by this bound in `std::mem::size_of`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `Sized` is not implemented for `[T]`
|
2017-12-10 19:47:55 +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
|
2021-02-08 22:15:45 +00:00
|
|
|
--> $DIR/suggest-where-clause.rs:31:5
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | mem::size_of::<[&U]>();
|
2018-06-19 22:53:51 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
2020-06-12 02:31:49 +00:00
|
|
|
::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
2019-09-04 17:17:59 +00:00
|
|
|
|
|
|
|
|
LL | pub const fn size_of<T>() -> usize {
|
|
|
|
| - required by this bound in `std::mem::size_of`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `Sized` is not implemented for `[&U]`
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
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`.
|