forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#94636 - compiler-errors:issue-94599, r=davi…
…dtwco Check extra function arg exprs even if the fn is not C-variadic We should still call check_expr on the args that exceed the formal input ty count, so that we have expr types to emit during writeback. Not sure where this regressed, but it wasn't due to the same root cause as rust-lang#94334 I think. I thought this might've regressed in rust-lang#92360, but I think that is in stable, ad the test I provided (which minimizes rust-lang#94599) passes on stable in playground. Maybe it regressed in rust-lang#93118. Anywho, fixes rust-lang#94599.
- Loading branch information
Showing
3 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() { | ||
(|| {})(|| { | ||
//~^ ERROR this function takes 0 arguments but 1 argument was supplied | ||
let b = 1; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0057]: this function takes 0 arguments but 1 argument was supplied | ||
--> $DIR/wrong_argument_ice-4.rs:2:5 | ||
| | ||
LL | (|| {})(|| { | ||
| _____^^^^^^^_- | ||
| | | | ||
| | expected 0 arguments | ||
LL | | | ||
LL | | let b = 1; | ||
LL | | }); | ||
| |_____- supplied 1 argument | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0057`. |