-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Type inference regression on beta using as _
#45480
Comments
I believe this is expected breakage from #44287. |
The regression is filed as rust-lang/rust#45480. It seems this broke because of rust-lang/rust#44287.
It would be valuable to have a list breaking changes that's updated whenever something breaking lands. |
The regression is filed as rust-lang/rust#45480. It seems this broke because of rust-lang/rust#44287.
This also happens when using methods like fn main() {
let mut var = 0;
let other = "10".parse().unwrap(); // Fails on beta/nightly
var += other;
} Edit: and also this, which is a bit annoying: fn main() {
let mut result = 0;
result += "10".parse().unwrap(); // Fails on beta/nightly
println!("{}", result);
} |
Also occurs in average-0.6.2 cc @vks |
As well as: |
And also whiteread-0.4.3 cc @krdln |
Thanks for the heads-up, this was fixed in average-0.6.3, or vks/average@b8d31c8. As suggested by @ollie27, this was an expected breakage due to #44287.
|
Should Other cases may be more ambiguous (e.g. adding a Also, just because the stability guarantees technically allow these types of breaking changes, doesn't necessarily mean it's a great idea to do so. It seems a lot of valid code is broken, and fixing it requires extra verbosity compared to what the compiler was previously able to resolve, which goes against the spirit of the ergonomics initiative. |
Yep, this looks really bad:
|
@rust-lang/libs: Closing this as we can't revert now as this has leaked onto stable. Ideally we'd probably have type defaults or something to avoid this in the future. |
Spotted by @gankro :
The text was updated successfully, but these errors were encountered: