rust/tests/ui/lifetimes/unusual-rib-combinations.stderr
Matthias Krüger cc61dc8b2d
Rollup merge of #127655 - RalfJung:invalid_type_param_default, r=compiler-errors
turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps`

`````@rust-lang/types````` I assume the plan is still to disallow this? It has been a future-compat lint for a long time, seems ripe to go for hard error.

However, turns out that outright removing it right now would lead to [tons of crater regressions](https://github.com/rust-lang/rust/pull/127655#issuecomment-2228285460), so for now this PR just makes this future-compat lint show up in cargo's reports, so people are warned when they use a dependency that is affected by this.

Fixes https://github.com/rust-lang/rust/issues/27336 by removing the feature gate (so there's no way to silence the lint even on nightly)
CC https://github.com/rust-lang/rust/issues/36887
2024-08-05 05:40:19 +02:00

86 lines
3.3 KiB
Plaintext

error[E0106]: missing lifetime specifier
--> $DIR/unusual-rib-combinations.rs:21:15
|
LL | fn d<const C: S>() {}
| ^ expected named lifetime parameter
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/unusual-rib-combinations.rs:26:22
|
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
| ^^ the type must not depend on the parameter `'a`
|
= note: lifetime parameters may not be used in the type of const parameters
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:11:15
|
LL | fn b<const C: u8()>() {}
| ^^^^ only `Fn` traits may use parentheses
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:15:10
|
LL | fn c<T = u8()>() {}
| ^^^^ only `Fn` traits may use parentheses
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/unusual-rib-combinations.rs:15:6
|
LL | fn c<T = u8()>() {}
| ^^^^^^^^
|
= 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[E0308]: mismatched types
--> $DIR/unusual-rib-combinations.rs:5:16
|
LL | fn a() -> [u8; foo()] {
| ^^^^^ expected `usize`, found `()`
error: `S<'_>` is forbidden as the type of a const generic parameter
--> $DIR/unusual-rib-combinations.rs:21:15
|
LL | fn d<const C: S>() {}
| ^
|
= note: the only supported types are integers, `bool` and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter
--> $DIR/unusual-rib-combinations.rs:26:21
|
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
LL + #![feature(unsized_const_params)]
|
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0106, E0214, E0308, E0770.
For more information about an error, try `rustc --explain E0106`.
Future incompatibility report: Future breakage diagnostic:
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/unusual-rib-combinations.rs:15:6
|
LL | fn c<T = u8()>() {}
| ^^^^^^^^
|
= 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