rust/tests/ui/issues/issue-26812.stderr
Ralf Jung 9d9b55cd2b make invalid_type_param_default lint show up in cargo future-compat reports
and remove the feature gate that silenced the lint
2024-07-15 22:05:45 +02:00

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