Suggest parentheses for possible range method calling#102454
Suggest parentheses for possible range method calling#102454bors merged 3 commits intorust-lang:masterfrom
Conversation
|
r? @TaKO8Ki (rust-highfive has picked a reviewer for you, use r? to override) |
5039d7e to
04e6dc4
Compare
This comment has been minimized.
This comment has been minimized.
6c0766b to
2e717c6
Compare
5ee7bdb to
348d082
Compare
348d082 to
86947ab
Compare
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
|
☔ The latest upstream changes (presumably #102395) made this pull request unmergeable. Please resolve the merge conflicts. |
17f2311 to
c141b82
Compare
c141b82 to
854844e
Compare
854844e to
e747201
Compare
|
r? @lcnr |
| let pick = | ||
| self.lookup_probe(span, item_name, range_ty, expr, ProbeScope::AllTraits); |
There was a problem hiding this comment.
can you emit a comment for why we're using ProbeScope::AllTraits here, I remember that you mentioned the reason for that before but I forgot that again 😁
also, i think ideally we would use probe_for_name directly here with IsSuggestion(true). Not sure what IsSuggestion does but we are emitting a suggestion here, so setting that to true seems like it should be done 😅
There was a problem hiding this comment.
Seems IsSuggestion only used at here:
Use ProbeScope::TraitsInScope can not find the pick, but ProbeScope::AllTraits will find it.
There was a problem hiding this comment.
it seems helpful to not emit unstable_name_collision_hints while looking for diagnostics, so that should still be done.
ProbeScope::TraitsInScope that feels weird and shouldn't be the case as Iterator is in scope. Is this still the case with the current code?
There was a problem hiding this comment.
updated the code to use probe_for_name.
ProbeScope::TraitsInScope means find with the scope of expr,
othewise try to find methods in all traits.
At this function, we are at a point of error handling of range type checking, since error happened so the Iterator is not in the scope? it's only my guess😁
|
@bors r+ rollup |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#102454 (Suggest parentheses for possible range method calling) - rust-lang#102466 (only allow `ConstEquate` with `feature(gce)`) - rust-lang#102945 (Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false) - rust-lang#103091 (rustdoc: remove unused HTML class `sidebar-title`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #102396