diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-07-20 16:17:21 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-20 16:17:21 +0530 |
| commit | d9a71c1e0225e6179f75f7bb9d7e4e9c67cb71c7 (patch) | |
| tree | 04b45ce552fcf5d27dddaf647bd7eb129ff09cb1 /src | |
| parent | fffc6504bcfa416f09f7d441f57f71e7aec28a00 (diff) | |
| parent | 43c0c63edafbff109b42bd1d01cbfda5b5e55bb8 (diff) | |
| download | rust-d9a71c1e0225e6179f75f7bb9d7e4e9c67cb71c7.tar.gz rust-d9a71c1e0225e6179f75f7bb9d7e4e9c67cb71c7.zip | |
Rollup merge of #99483 - compiler-errors:issue-99482, r=jyn514
Fix a numerical underflow in tuple wrap suggestion Fixes #99482 I'm a clown, I rewrote the arg mismatch algo to use well-typed indices to avoid things like this, but then I added my own indexing bug, lol.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-99482.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/argument-suggestions/issue-99482.stderr | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/argument-suggestions/issue-99482.rs b/src/test/ui/argument-suggestions/issue-99482.rs new file mode 100644 index 00000000000..731b863069b --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-99482.rs @@ -0,0 +1,5 @@ +fn main() { + let f = |_: (), f: fn()| f; + let _f = f(main); + //~^ ERROR this function takes 2 arguments but 1 argument was supplied +} diff --git a/src/test/ui/argument-suggestions/issue-99482.stderr b/src/test/ui/argument-suggestions/issue-99482.stderr new file mode 100644 index 00000000000..bc005e82a2c --- /dev/null +++ b/src/test/ui/argument-suggestions/issue-99482.stderr @@ -0,0 +1,19 @@ +error[E0057]: this function takes 2 arguments but 1 argument was supplied + --> $DIR/issue-99482.rs:3:14 + | +LL | let _f = f(main); + | ^ ---- an argument of type `()` is missing + | +note: closure defined here + --> $DIR/issue-99482.rs:2:13 + | +LL | let f = |_: (), f: fn()| f; + | ^^^^^^^^^^^^^^^^ +help: provide the argument + | +LL | let _f = f((), main); + | ~~~~~~~~~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0057`. |
