|
| 1 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 2 | + --> $DIR/issue-144074.rs:4:25 |
| 3 | + | |
| 4 | +LL | assert_sized(Struct(*"")); |
| 5 | + | ------ ^^^ doesn't have a size known at compile-time |
| 6 | + | | |
| 7 | + | required by a bound introduced by this call |
| 8 | + | |
| 9 | + = help: the trait `Sized` is not implemented for `str` |
| 10 | +note: required by a bound in `Struct` |
| 11 | + --> $DIR/issue-144074.rs:1:15 |
| 12 | + | |
| 13 | +LL | struct Struct<T>(T); |
| 14 | + | ^ required by this bound in `Struct` |
| 15 | +help: references are always `Sized`, even if they point to unsized data; consider not dereferencing the expression |
| 16 | + | |
| 17 | +LL - assert_sized(Struct(*"")); |
| 18 | +LL + assert_sized(Struct("")); |
| 19 | + | |
| 20 | + |
| 21 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 22 | + --> $DIR/issue-144074.rs:4:5 |
| 23 | + | |
| 24 | +LL | assert_sized(Struct(*"")); |
| 25 | + | ^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 26 | + | |
| 27 | + = help: the trait `Sized` is not implemented for `str` |
| 28 | +note: required by an implicit `Sized` bound in `Struct` |
| 29 | + --> $DIR/issue-144074.rs:1:15 |
| 30 | + | |
| 31 | +LL | struct Struct<T>(T); |
| 32 | + | ^ required by the implicit `Sized` requirement on this type parameter in `Struct` |
| 33 | +help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>` |
| 34 | + --> $DIR/issue-144074.rs:1:15 |
| 35 | + | |
| 36 | +LL | struct Struct<T>(T); |
| 37 | + | ^ - ...if indirection were used here: `Box<T>` |
| 38 | + | | |
| 39 | + | this could be changed to `T: ?Sized`... |
| 40 | + |
| 41 | +error: aborting due to 2 previous errors |
| 42 | + |
| 43 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments