File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
tests/ui/type-alias-impl-trait Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 1+ error: `Bar` is forbidden as the type of a const generic parameter
2+ --> $DIR/const_generic_type.rs:7:24
3+ |
4+ LL | async fn test<const N: crate::Bar>() {
5+ | ^^^^^^^^^^
6+ |
7+ = note: the only supported types are integers, `bool` and `char`
8+
9+ error: aborting due to 1 previous error
10+
Original file line number Diff line number Diff line change 11error[E0283]: type annotations needed
2- --> $DIR/const_generic_type.rs:6 :1
2+ --> $DIR/const_generic_type.rs:7 :1
33 |
4- LL | async fn test<const N: crate::Bar>() {}
4+ LL | async fn test<const N: crate::Bar>() {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
66 |
77 = note: cannot satisfy `_: std::fmt::Display`
88
99error: `Bar` is forbidden as the type of a const generic parameter
10- --> $DIR/const_generic_type.rs:6 :24
10+ --> $DIR/const_generic_type.rs:7 :24
1111 |
12- LL | async fn test<const N: crate::Bar>() {}
12+ LL | async fn test<const N: crate::Bar>() {
1313 | ^^^^^^^^^^
1414 |
1515 = note: the only supported types are integers, `bool` and `char`
Original file line number Diff line number Diff line change 11//@edition: 2021
2+ //@revisions: infer no_infer
23
34#![ feature( type_alias_impl_trait) ]
45type Bar = impl std:: fmt:: Display ;
56
6- async fn test < const N : crate :: Bar > ( ) { }
7- //~^ ERROR: type annotations needed
8- //~| ERROR: `Bar` is forbidden as the type of a const generic parameter
7+ async fn test < const N : crate :: Bar > ( ) {
8+ //[no_infer]~^ ERROR: type annotations needed
9+ //~^^ ERROR: `Bar` is forbidden as the type of a const generic parameter
10+ #[ cfg( infer) ]
11+ let x: u32 = N ;
12+ }
913
1014fn main ( ) { }
You can’t perform that action at this time.
0 commit comments