2022-10-09 08:56:40 -05:00
|
|
|
error[E0106]: missing lifetime specifier
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:21:15
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
|
|
|
LL | fn d<const C: S>() {}
|
|
|
|
| ^ expected named lifetime parameter
|
|
|
|
|
2023-05-05 15:42:51 -05:00
|
|
|
error[E0770]: the type of const parameters must not depend on other generic parameters
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:26:22
|
2023-03-16 10:17:56 -05:00
|
|
|
|
|
|
|
|
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
|
2023-05-05 15:42:51 -05:00
|
|
|
| ^^ the type must not depend on the parameter `'a`
|
2023-03-16 10:17:56 -05:00
|
|
|
|
|
2023-05-05 15:42:51 -05:00
|
|
|
= note: lifetime parameters may not be used in the type of const parameters
|
2023-03-16 10:17:56 -05:00
|
|
|
|
2022-10-09 08:56:40 -05:00
|
|
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:11:15
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
|
|
|
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
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:15:10
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
|
|
|
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
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:15:6
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
|
|
|
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
|
2024-04-19 10:54:41 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:5:16
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
2024-05-28 06:38:30 -05:00
|
|
|
LL | fn a() -> [u8; foo()] {
|
|
|
|
| ^^^^^ expected `usize`, found `()`
|
2022-10-09 08:56:40 -05:00
|
|
|
|
2023-02-03 17:21:56 -06:00
|
|
|
error: `S<'_>` is forbidden as the type of a const generic parameter
|
2024-05-28 06:38:30 -05:00
|
|
|
--> $DIR/unusual-rib-combinations.rs:21:15
|
2022-10-09 08:56:40 -05:00
|
|
|
|
|
|
|
|
LL | fn d<const C: S>() {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: the only supported types are integers, `bool` and `char`
|
2024-03-07 16:09:00 -06:00
|
|
|
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
|
|
|
|
|
|
|
|
LL + #![feature(adt_const_params)]
|
|
|
|
|
|
2022-10-09 08:56:40 -05:00
|
|
|
|
2024-05-28 06:38:30 -05:00
|
|
|
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)]
|
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
|
|
|
|
|
|
|
|
LL + #![feature(unsized_const_params)]
|
|
|
|
|
|
2024-05-28 06:38:30 -05:00
|
|
|
|
2024-01-10 08:58:03 -06:00
|
|
|
error: aborting due to 8 previous errors
|
2022-10-09 08:56:40 -05:00
|
|
|
|
2023-05-05 15:42:51 -05:00
|
|
|
Some errors have detailed explanations: E0106, E0214, E0308, E0770.
|
2022-10-09 08:56:40 -05:00
|
|
|
For more information about an error, try `rustc --explain E0106`.
|
2024-07-15 14:25:03 -05:00
|
|
|
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
|
|
|
|
|