|
| 1 | +error: `<i32 as Trait>::Type` is forbidden as the type of a const generic parameter |
| 2 | + --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:12:25 |
| 3 | + | |
| 4 | +LL | struct Wrapper<const C: <i32 as Trait>::Type> {} |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: the only supported types are integers, `bool` and `char` |
| 8 | + |
| 9 | +error: the constant `C` is not of type `<i32 as Trait>::Type` |
| 10 | + --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:15:22 |
| 11 | + | |
| 12 | +LL | impl<const C: usize> Wrapper<C> {} |
| 13 | + | ^^^^^^^^^^ expected associated type, found `usize` |
| 14 | + | |
| 15 | + = help: consider constraining the associated type `<i32 as Trait>::Type` to `usize` |
| 16 | + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html |
| 17 | +note: required by a bound in `Wrapper` |
| 18 | + --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:12:16 |
| 19 | + | |
| 20 | +LL | struct Wrapper<const C: <i32 as Trait>::Type> {} |
| 21 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Wrapper` |
| 22 | + |
| 23 | +error[E0308]: mismatched types |
| 24 | + --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:15:30 |
| 25 | + | |
| 26 | +LL | impl<const C: usize> Wrapper<C> {} |
| 27 | + | ^ expected associated type, found `usize` |
| 28 | + | |
| 29 | + = note: expected associated type `<i32 as Trait>::Type` |
| 30 | + found type `usize` |
| 31 | + = help: consider constraining the associated type `<i32 as Trait>::Type` to `usize` |
| 32 | + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html |
| 33 | + |
| 34 | +error: aborting due to 3 previous errors |
| 35 | + |
| 36 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments