Adjust parser generic parameter errors
This commit is contained in:
parent
899d013fef
commit
bbdcc4e7ce
18 changed files with 93 additions and 54 deletions
19
src/test/ui/const-generics/const-expression-parameter.rs
Normal file
19
src/test/ui/const-generics/const-expression-parameter.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
#![feature(const_generics)]
|
||||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
|
||||
fn u32_identity<const X: u32>() -> u32 {
|
||||
//~^ ERROR const generics in any position are currently unsupported
|
||||
5
|
||||
}
|
||||
|
||||
fn foo_a() {
|
||||
u32_identity::<-1>(); //~ ERROR expected identifier, found `<-`
|
||||
}
|
||||
|
||||
fn foo_b() {
|
||||
u32_identity::<1 + 2>(); //~ ERROR expected one of `,` or `>`, found `+`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
u32_identity::<5>(); // ok
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue