-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add hint for unresolved associated trait items if the trait has a single item #87775
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nagisa (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
c846c0b
to
94f8741
Compare
not sure we have a dedicated diagnostics folder, but you could put them in the associated items folder.
I think a single
It would be enough, but it also doesn't hurt to test all three.
That would be cool, but not necessary. If you want to take a shot at it in this PR, feel free to do it. You can even test+bless it by adding a |
94f8741
to
6b7f4a2
Compare
I added the distinguishing enum to |
Thanks! This looks good now. Not sure why CI is failing, I'll try restarting it. |
This comment has been minimized.
This comment has been minimized.
6b7f4a2
to
d0d4947
Compare
@bors r+ rollup |
📌 Commit d0d4947 has been approved by |
Thanks for taking care of this so fast! |
Rollup of 7 pull requests Successful merges: - rust-lang#85807 (bootstrap: Disable initial-exec TLS model on powerpc) - rust-lang#87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - rust-lang#87775 (Add hint for unresolved associated trait items if the trait has a single item) - rust-lang#87779 (Remove special case for statement `NodeId` assignment) - rust-lang#87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - rust-lang#87809 (Fix typo in the ptr documentation) - rust-lang#87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This PR introduces a special-cased hint for unresolved trait items paths. It is shown if:
I didn't know where I should put tests, therefore so far I just managed to bless two existing tests. I would be glad for hints where should tests for a hint like this be created, how should they be named (with reference to the original issue?) and what tests should I create (is it enough to test it just for types? or create separate tests also for functions and constants?).
It could also be turned into a machine applicable suggestion I suppose.
This is my first
rustc
PR, so please go easy on me :)Fixes: #87638