mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
9d9b55cd2b
and remove the feature gate that silenced the lint
31 lines
1.4 KiB
Plaintext
31 lines
1.4 KiB
Plaintext
error[E0128]: generic parameters with a default cannot use forward declared identifiers
|
|
--> $DIR/issue-26812.rs:1:10
|
|
|
|
|
LL | fn avg<T=T::Item>(_: T) {}
|
|
| ^^^^^^^ defaulted generic parameters cannot be forward declared
|
|
|
|
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
|
--> $DIR/issue-26812.rs:1:8
|
|
|
|
|
LL | fn avg<T=T::Item>(_: T) {}
|
|
| ^^^^^^^^^
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
|
= note: `#[deny(invalid_type_param_default)]` on by default
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0128`.
|
|
Future incompatibility report: Future breakage diagnostic:
|
|
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
|
--> $DIR/issue-26812.rs:1:8
|
|
|
|
|
LL | fn avg<T=T::Item>(_: T) {}
|
|
| ^^^^^^^^^
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
|
= note: `#[deny(invalid_type_param_default)]` on by default
|
|
|