-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error output regression: spurious integer inference error that only occurs if another error occurs #93450
Comments
searched nightlies: from nightly-2021-10-17 to nightly-2021-11-28 bisected with cargo-bisect-rustc v0.6.1Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --preserve --start=2021-10-17 --end=2021-11-28 --script=./test.sh --regress=success Bisection points to #89427. There were some changes to when the compiler avoids emitting an ambiguity error when there are previous errors, but I'm not sure what the intent was. The appearance of ambiguity errors similar to this one was noted in PR review. @rustbot label regression-from-stable-to-stable |
@rustbot claim |
cc @estebank |
FWIW, using 1.58.1 I accidentally ran into the same regression (undesirable / surplus E0283) with the following defective code:
|
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
@compiler-errors I'm pretty sure this is caused by this removal: I would rather us not add it in the same place because IIRC I moved it (duplicated) deeper into the logic because otherwise with my other changes we had regressions. |
I was just going through my FizzBuzz article as I do every year or so to update compiler error messages and make any related changes necessary, and came across a regression in error output for Figure 3.
Given the following code:
This is the output in 1.57.0 (and it’s been just the one error that we now call E0308 right from the outset):
But the output in 1.58.0 and in currently nightly adds another error, E0283:
The integer type inference error is spurious, because if you resolve the if/else type mismatch (e.g. tack on
.to_string()
on the other branches), it also vanishes (resolved to the default of i32, I presume).The text was updated successfully, but these errors were encountered: