diff options
| author | Michael Goulet <michael@errs.io> | 2022-07-04 10:50:49 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-18 03:46:20 +0000 |
| commit | 32e0ef34b470d47fcd99c310ab399c0599e1c680 (patch) | |
| tree | 164fb6ba59d4c027e78488539cd4e02c8288b738 | |
| parent | db41351753df840773ca628d8daa040e95d00eef (diff) | |
| download | rust-32e0ef34b470d47fcd99c310ab399c0599e1c680.tar.gz rust-32e0ef34b470d47fcd99c310ab399c0599e1c680.zip | |
Add some additional double-adjustment regression tests
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-98894.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-98894.stderr | 19 | ||||
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-98897.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-98897.stderr | 19 |
4 files changed, 46 insertions, 0 deletions
diff --git a/src/test/ui/argument-suggestions/issue-98894.rs b/src/test/ui/argument-suggestions/issue-98894.rs new file mode 100644 index 00000000000..c2618a96716 --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-98894.rs @@ -0,0 +1,4 @@ +fn main() { + (|_, ()| ())(if true {} else {return;}); + //~^ ERROR this function takes 2 arguments but 1 argument was supplied +} diff --git a/src/test/ui/argument-suggestions/issue-98894.stderr b/src/test/ui/argument-suggestions/issue-98894.stderr new file mode 100644 index 00000000000..0c8b94901e1 --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-98894.stderr @@ -0,0 +1,19 @@ +error[E0057]: this function takes 2 arguments but 1 argument was supplied + --> $DIR/issue-98894.rs:2:5 + | +LL | (|_, ()| ())(if true {} else {return;}); + | ^^^^^^^^^^^^--------------------------- an argument of type `()` is missing + | +note: closure defined here + --> $DIR/issue-98894.rs:2:6 + | +LL | (|_, ()| ())(if true {} else {return;}); + | ^^^^^^^ +help: provide the argument + | +LL | (|_, ()| ())(if true {} else {return;}, ()); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/issue-98897.rs b/src/test/ui/argument-suggestions/issue-98897.rs new file mode 100644 index 00000000000..c55f495d698 --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-98897.rs @@ -0,0 +1,4 @@ +fn main() { + (|_, ()| ())([return, ()]); + //~^ ERROR this function takes 2 arguments but 1 argument was supplied +} diff --git a/src/test/ui/argument-suggestions/issue-98897.stderr b/src/test/ui/argument-suggestions/issue-98897.stderr new file mode 100644 index 00000000000..8f0d98d09e8 --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-98897.stderr @@ -0,0 +1,19 @@ +error[E0057]: this function takes 2 arguments but 1 argument was supplied + --> $DIR/issue-98897.rs:2:5 + | +LL | (|_, ()| ())([return, ()]); + | ^^^^^^^^^^^^-------------- an argument of type `()` is missing + | +note: closure defined here + --> $DIR/issue-98897.rs:2:6 + | +LL | (|_, ()| ())([return, ()]); + | ^^^^^^^ +help: provide the argument + | +LL | (|_, ()| ())([return, ()], ()); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0057`. |
