Try to suggest dereferences on trait selection failed#72456
Try to suggest dereferences on trait selection failed#72456bors merged 3 commits intorust-lang:masterfrom
Conversation
|
☔ The latest upstream changes (presumably #72256) made this pull request unmergeable. Please resolve the merge conflicts. |
8d3898b to
e66f84e
Compare
|
☔ The latest upstream changes (presumably #72778) made this pull request unmergeable. Please resolve the merge conflicts. |
c3fb825 to
3fc1c11
Compare
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
79a33b0 to
0c0b32d
Compare
|
☔ The latest upstream changes (presumably #73504) made this pull request unmergeable. Please resolve the merge conflicts. |
estebank
left a comment
There was a problem hiding this comment.
Apologies for the delay on reviewing this. I have a couple of nitpicks. Could you address them as you rebase? Other than that, I'm happy with the changes!
src/librustc_trait_selection/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
src/librustc_trait_selection/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
|
Rebase done, nitpicks applied. |
|
@bors r+ |
|
📌 Commit f1e0710 has been approved by |
…arth Rollup of 9 pull requests Successful merges: - rust-lang#72456 (Try to suggest dereferences on trait selection failed) - rust-lang#72788 (Projection bound validation) - rust-lang#72790 (core/time: Add Duration methods for zero) - rust-lang#73227 (Allow multiple `asm!` options groups and report an error on duplicate options) - rust-lang#73287 (lint: normalize projections using opaque types) - rust-lang#73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs) - rust-lang#73378 (Remove use of specialization from librustc_arena) - rust-lang#73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15)) - rust-lang#73443 (ci: allow gating GHA on everything but macOS) Failed merges: r? @ghost
Fixes #39029 Fixes #62530
This PR consists of two parts:
AutoderefwithFnCtxtand moveAutodereftolibrustc_trait_selection.The first is needed because:
Autoderefshould be used. But before this PR, it is placed inlibrustc_typeck, which depends onlibrustc_trait_selection. But trait selection error emitting happens inlibrustc_trait_selection, if we want to useAutoderefin it, dependency loop is inevitable. So I moved theAutodereftolibrustc_trait_selection.FnCtxtis coupled toAutoderef, andFnCtxtonly exists inlibrustc_typeck. So decoupling is needed.After this PR, we can get suggestion like this:
r? @estebank