|
| 1 | +error[E0412]: cannot find type `Idx` in this scope |
| 2 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:30 |
| 3 | + | |
| 4 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 5 | + | ^^^ not found in this scope |
| 6 | + |
| 7 | +error[E0412]: cannot find type `Idx` in this scope |
| 8 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:38 |
| 9 | + | |
| 10 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 11 | + | ^^^ not found in this scope |
| 12 | + |
| 13 | +error[E0277]: the size for values of type `[bool]` cannot be known at compilation time |
| 14 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:9:22 |
| 15 | + | |
| 16 | +LL | const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]); |
| 17 | + | ^^^^^^^^^^^ doesn't have a size known at compile-time |
| 18 | + | |
| 19 | + = help: the trait `Sized` is not implemented for `[bool]` |
| 20 | +note: required by an implicit `Sized` bound in `MySlice` |
| 21 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:16 |
| 22 | + | |
| 23 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 24 | + | ^ required by the implicit `Sized` requirement on this type parameter in `MySlice` |
| 25 | +help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>` |
| 26 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:16 |
| 27 | + | |
| 28 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 29 | + | ^ - ...if indirection were used here: `Box<T>` |
| 30 | + | | |
| 31 | + | this could be changed to `T: ?Sized`... |
| 32 | + |
| 33 | +error[E0277]: the size for values of type `[bool]` cannot be known at compilation time |
| 34 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:9:22 |
| 35 | + | |
| 36 | +LL | const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]); |
| 37 | + | ^^^^^^^^^^^ doesn't have a size known at compile-time |
| 38 | + | |
| 39 | + = help: the trait `Sized` is not implemented for `[bool]` |
| 40 | +note: required by an implicit `Sized` bound in `MySlice` |
| 41 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:16 |
| 42 | + | |
| 43 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 44 | + | ^ required by the implicit `Sized` requirement on this type parameter in `MySlice` |
| 45 | +help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>` |
| 46 | + --> $DIR/ice-unsized-struct-arg-issue-121612.rs:5:16 |
| 47 | + | |
| 48 | +LL | struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T); |
| 49 | + | ^ - ...if indirection were used here: `Box<T>` |
| 50 | + | | |
| 51 | + | this could be changed to `T: ?Sized`... |
| 52 | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 53 | + |
| 54 | +error: aborting due to 4 previous errors |
| 55 | + |
| 56 | +Some errors have detailed explanations: E0277, E0412. |
| 57 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments