Skip to content
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

back out bogus Ok-wrapping suggestion on ? arm type mismatch #55423

Merged

Conversation

zackmdavis
Copy link
Member

This suggestion was introduced in #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 #52537, resolves #54578.

r? @estebank

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.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2018
@zackmdavis
Copy link
Member Author

I could see a case for beta-backporting if we think that 1.31 will get a lot of new users coming to check out the edition, and we don't want to make a bad impression with a bad suggestion, but maybe backports should only be for higher-priority edition-critical things? On the other hand, this is a very low-risk patch (straightforwardly removes an if let and updates tests).

@zackmdavis zackmdavis added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 27, 2018
@estebank
Copy link
Contributor

I'm a bit sad about seeing the suggestion going away entirely. Did you find it impossible to restrict the suggestion any further instead of removing it?

@zackmdavis
Copy link
Member Author

Did you find it impossible to restrict the suggestion any further instead of removing it?

Not impossible, just not a prioritized use of my time right now. (Whereas getting rid of the false positive is a priority, because it's been independently reported four times.) I've now filed a separate issue so that the opportunity isn't forgotten: #55429

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 28, 2018

📌 Commit b754615 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2018
@Mark-Simulacrum Mark-Simulacrum added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Oct 28, 2018
@Mark-Simulacrum
Copy link
Member

Accepting for beta promotion. I agree that a faulty diagnostic isn't good to ship, and the edition only reinforces that. Code changes are minimal enough that I feel comfortable with a backport.

@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 28, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request 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
bors added a commit that referenced this pull request Oct 29, 2018
Rollup of 9 pull requests

Successful merges:

 - #54965 (update tcp stream documentation)
 - #55269 (fix typos in various places)
 - #55384 (Avoid unnecessary allocations in `float_lit` and `integer_lit`.)
 - #55423 (back out bogus `Ok`-wrapping suggestion on `?` arm type mismatch)
 - #55426 (Make a bunch of trivial methods of NonNull be `#[inline]`)
 - #55438 (Avoid directly catching BaseException in bootstrap configure script)
 - #55439 (Remove unused sys import from generate-deriving-span-tests)
 - #55440 (Remove unreachable code in hasClass function in Rustdoc)
 - #55447 (Fix invalid path in generate-deriving-span-tests.py.)

Failed merges:

r? @ghost
@bors bors merged commit b754615 into rust-lang:master Oct 29, 2018
bors added a commit that referenced this pull request Oct 29, 2018
[beta]: Prepare the 1.31.0 beta release

* Update to Cargo's branched 1.31.0 branch
* Update the channel to `beta`

Rolled up beta-accepted PRs:

* #55362: Remove `cargo new --edition` from release notes.
* #55325: Fix link to macros chapter
* #55358: Remove redundant clone (2)
* #55346: Shrink `Statement`.
* #55274: Handle bindings in substructure of patterns with type ascriptions
* #55297: Partial implementation of uniform paths 2.0 to land before beta
* #55192: Fix ordering of nested modules in non-mod.rs mods
* #55185: path suggestions in Rust 2018 should point out the change in semantics
* #55423: back out bogus `Ok`-wrapping suggestion on `?` arm type mismatch

Note that **this does not update the bootstrap compiler** due to #55404
@zackmdavis zackmdavis deleted the back_out_bogus_ok_wrapping_suggestion branch November 11, 2018 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust claims that Ok(T) is the same as &T [ui] Incorrect hint: Ok(wrap) instead *Deref
6 participants