|
| 1 | +error: generic parameters with a default must be trailing |
| 2 | + --> $DIR/issue-105631.rs:4:16 |
| 3 | + | |
| 4 | +LL | struct A<const B: str = 1, C>; |
| 5 | + | ^ |
| 6 | + |
| 7 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 8 | + --> $DIR/issue-105631.rs:4:25 |
| 9 | + | |
| 10 | +LL | struct A<const B: str = 1, C>; |
| 11 | + | ^ doesn't have a size known at compile-time |
| 12 | + | |
| 13 | + = help: the trait `Sized` is not implemented for `str` |
| 14 | + = note: constant expressions must have a statically known size |
| 15 | + |
| 16 | +error[E0308]: mismatched types |
| 17 | + --> $DIR/issue-105631.rs:4:25 |
| 18 | + | |
| 19 | +LL | struct A<const B: str = 1, C>; |
| 20 | + | ^ expected `str`, found integer |
| 21 | + |
| 22 | +error[E0392]: parameter `C` is never used |
| 23 | + --> $DIR/issue-105631.rs:4:28 |
| 24 | + | |
| 25 | +LL | struct A<const B: str = 1, C>; |
| 26 | + | ^ unused parameter |
| 27 | + | |
| 28 | + = help: consider removing `C`, referring to it in a field, or using a marker such as `PhantomData` |
| 29 | + = help: if you intended `C` to be a const parameter, use `const C: usize` instead |
| 30 | + |
| 31 | +error: `str` is forbidden as the type of a const generic parameter |
| 32 | + --> $DIR/issue-105631.rs:4:19 |
| 33 | + | |
| 34 | +LL | struct A<const B: str = 1, C>; |
| 35 | + | ^^^ |
| 36 | + | |
| 37 | + = note: the only supported types are integers, `bool` and `char` |
| 38 | + = help: more complex types are supported with `#![feature(adt_const_params)]` |
| 39 | + |
| 40 | +error: aborting due to 5 previous errors |
| 41 | + |
| 42 | +Some errors have detailed explanations: E0277, E0308, E0392. |
| 43 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments