-
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
Added shadowed hint for overlapping associated types #117661
Added shadowed hint for overlapping associated types #117661
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
4a71828
to
45f2eac
Compare
This comment has been minimized.
This comment has been minimized.
45f2eac
to
f106bfd
Compare
This comment has been minimized.
This comment has been minimized.
f106bfd
to
6d8c642
Compare
tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr
Outdated
Show resolved
Hide resolved
After rebasing to try to resolve the conflict I get the following error when running |
Could you push the rebased version to github? |
It gives the error too when it runs |
That's a git hook installed by |
c347492
to
1404dbd
Compare
@rustbot review |
@rustbot review |
r=me after removing the second commit (but keeping #117661 (comment)). |
Shadowing the associated type of a supertrait is allowed. This however makes it impossible to set the associated type of the supertrait in a dyn object. This PR makes the error message for that case clearer, like adding a note that shadowing is happening, as well as suggesting renaming of one of the associated types. r=petrochenckov
1476d5c
to
3234418
Compare
@rustbot review |
Thanks! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (dd6126e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.083s -> 674.182s (-0.13%) |
Previously, when you tried to set an associated type that is shadowed by an associated type in a subtrait, like this:
Now instead, the error shows that the associated type is shadowed, and suggests renaming as a potential fix.
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0191, E0719.
For more information about an error, try
rustc --explain E0191
.The rename help message is only emitted when the trait is local. This is true both for the supertrait as for the subtrait.
There might be cases where you can use the fully qualified path (for instance, in a where clause), but this PR currently does not deal with that.
fixes #100109
(continues from #117642, because I didn't know renaming the branch would close the PR)