|
1 | 1 | error[E0128]: generic parameters with a default cannot use forward declared identifiers
|
2 | | - --> $DIR/issue-26812.rs:3:10 |
| 2 | + --> $DIR/issue-26812.rs:1:10 |
3 | 3 | |
|
4 | 4 | LL | fn avg<T=T::Item>(_: T) {}
|
5 | 5 | | ^^^^^^^ defaulted generic parameters cannot be forward declared
|
6 | 6 |
|
7 | | -error: aborting due to 1 previous error |
| 7 | +error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions |
| 8 | + --> $DIR/issue-26812.rs:1:8 |
| 9 | + | |
| 10 | +LL | fn avg<T=T::Item>(_: T) {} |
| 11 | + | ^^^^^^^^^ |
| 12 | + | |
| 13 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 14 | + = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> |
| 15 | + = note: `#[deny(invalid_type_param_default)]` on by default |
| 16 | + |
| 17 | +error: aborting due to 2 previous errors |
8 | 18 |
|
9 | 19 | For more information about this error, try `rustc --explain E0128`.
|
| 20 | +Future incompatibility report: Future breakage diagnostic: |
| 21 | +error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions |
| 22 | + --> $DIR/issue-26812.rs:1:8 |
| 23 | + | |
| 24 | +LL | fn avg<T=T::Item>(_: T) {} |
| 25 | + | ^^^^^^^^^ |
| 26 | + | |
| 27 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 28 | + = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> |
| 29 | + = note: `#[deny(invalid_type_param_default)]` on by default |
| 30 | + |
0 commit comments