Skip to content

Commit 7bccde1

Browse files
committed
Auto merge of #95093 - compiler-errors:beta-correctly, r=Mark-Simulacrum
[beta] Remove statement that was forgotten when backporting #94596 This `if` statement was introduced in #94438, then removed in #94596. Both of these PRs were beta-backported in #94933, but I think there was a mistake in the order they were applied or this removal was overlooked. I think this fixes the remaining issues referenced in #94511 (comment). Not sure this is the correct way to put something up for beta-backport, but the PR is at least open so it can be referenced and the commit can be cherry-picked. Feel free to close this PR. r? `@Mark-Simulacrum` cc: #94511
2 parents 6ee5a40 + 3191ede commit 7bccde1

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

compiler/rustc_typeck/src/check/fn_ctxt/checks.rs

-5
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
234234
// This is more complicated than just checking type equality, as arguments could be coerced
235235
// This version writes those types back so further type checking uses the narrowed types
236236
let demand_compatible = |idx, final_arg_types: &mut Vec<Option<(Ty<'tcx>, Ty<'tcx>)>>| {
237-
// Do not check argument compatibility if the number of args do not match
238-
if arg_count_error.is_some() {
239-
return;
240-
}
241-
242237
let formal_input_ty: Ty<'tcx> = formal_input_tys[idx];
243238
let expected_input_ty: Ty<'tcx> = expected_input_tys[idx];
244239
let provided_arg = &provided_args[idx];

src/test/ui/mismatched_types/overloaded-calls-bad.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ fn main() {
3030
//~^ ERROR this function takes 1 argument but 0 arguments were supplied
3131
let ans = s("burma", "shave");
3232
//~^ ERROR this function takes 1 argument but 2 arguments were supplied
33+
//~| ERROR mismatched types
3334
}

src/test/ui/mismatched_types/overloaded-calls-bad.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ note: associated function defined here
1818
LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
1919
| ^^^^^^^^
2020

21+
error[E0308]: mismatched types
22+
--> $DIR/overloaded-calls-bad.rs:31:17
23+
|
24+
LL | let ans = s("burma", "shave");
25+
| ^^^^^^^ expected `isize`, found `&str`
26+
2127
error[E0057]: this function takes 1 argument but 2 arguments were supplied
2228
--> $DIR/overloaded-calls-bad.rs:31:15
2329
|
@@ -32,7 +38,7 @@ note: associated function defined here
3238
LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
3339
| ^^^^^^^^
3440

35-
error: aborting due to 3 previous errors
41+
error: aborting due to 4 previous errors
3642

3743
Some errors have detailed explanations: E0057, E0308.
3844
For more information about an error, try `rustc --explain E0057`.

0 commit comments

Comments
 (0)