Add ui test fn-trait-use-named-params

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
xizheyin 2025-05-05 22:56:03 +08:00
parent d7df5bdf29
commit 896cf8029c
No known key found for this signature in database
GPG key ID: 0A0D90BE99CEDEAD
2 changed files with 26 additions and 0 deletions

View 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(){}

View 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