-
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
Rust claims that Ok(T)
is the same as &T
#54578
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
The error used to be mostly correct at least as recently as 1.26.1 (I don't have 1.27 or 1.28 installed to quickly check), though "mismatched types" read "match arm with an incompatible type". I suspect this regression occurred in whatever commit fixed that bug. |
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Oct 27, 2018
This suggestion was introduced in rust-lang#51938 / 6cc78bf (while introducing different language for type errors coming from `?` rather than a `match`), but it has a lot of false-positives (as repeatedly reported in Issues rust-lang#52537, rust-lang#52598, rust-lang#54578, rust-lang#55336), and incorrect suggestions carry more badness than marginal good suggestions do goodness. Just get rid of it (unless and until someone figures out how to do it correctly). Resolves rust-lang#52537, resolves rust-lang#54578.
#55423 will/would change the output to
|
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this issue
Oct 29, 2018
…ng_suggestion, r=estebank back out bogus `Ok`-wrapping suggestion on `?` arm type mismatch This suggestion was introduced in rust-lang#51938 / 6cc78bf (while introducing different language for type errors coming from `?` rather than a `match`), but it has a lot of false-positives, and incorrect suggestions carry more badness than marginal good suggestions do goodness. I regret not doing this earlier. 😞 Resolves rust-lang#52537, resolves rust-lang#54578. r? @estebank
pietroalbini
pushed a commit
to alexcrichton/rust
that referenced
this issue
Oct 29, 2018
This suggestion was introduced in rust-lang#51938 / 6cc78bf (while introducing different language for type errors coming from `?` rather than a `match`), but it has a lot of false-positives (as repeatedly reported in Issues rust-lang#52537, rust-lang#52598, rust-lang#54578, rust-lang#55336), and incorrect suggestions carry more badness than marginal good suggestions do goodness. Just get rid of it (unless and until someone figures out how to do it correctly). Resolves rust-lang#52537, resolves rust-lang#54578.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce:
?
&
Example code: https://play.rust-lang.org/?gist=c75cddbb4c5d8a1b63ec11dc3c5bca43&version=stable&mode=debug&edition=2015
Output:
Expected output:
The text was updated successfully, but these errors were encountered: