Add ui test fn-trait-use-named-params
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
parent
d7df5bdf29
commit
896cf8029c
2 changed files with 26 additions and 0 deletions
6
tests/ui/fn/fn-trait-use-named-params-issue-140169.rs
Normal file
6
tests/ui/fn/fn-trait-use-named-params-issue-140169.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fn g(_: fn(a: u8)) {}
|
||||
fn x(_: impl Fn(u8, vvvv: u8)) {} //~ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
fn y(_: impl Fn(aaaa: u8, u8)) {} //~ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
fn z(_: impl Fn(aaaa: u8, vvvv: u8)) {} //~ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
|
||||
fn main(){}
|
||||
20
tests/ui/fn/fn-trait-use-named-params-issue-140169.stderr
Normal file
20
tests/ui/fn/fn-trait-use-named-params-issue-140169.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
--> $DIR/fn-trait-use-named-params-issue-140169.rs:2:25
|
||||
|
|
||||
LL | fn x(_: impl Fn(u8, vvvv: u8)) {}
|
||||
| ^ expected one of 7 possible tokens
|
||||
|
||||
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
--> $DIR/fn-trait-use-named-params-issue-140169.rs:3:21
|
||||
|
|
||||
LL | fn y(_: impl Fn(aaaa: u8, u8)) {}
|
||||
| ^ expected one of 7 possible tokens
|
||||
|
||||
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
|
||||
--> $DIR/fn-trait-use-named-params-issue-140169.rs:4:21
|
||||
|
|
||||
LL | fn z(_: impl Fn(aaaa: u8, vvvv: u8)) {}
|
||||
| ^ expected one of 7 possible tokens
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue