-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Filter out intrinsics if we have other import candidates to suggest #97822
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Filter out intrinsics if we have other import candidates to suggest #97822
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
5c9f012
to
ab0938d
Compare
let path = path_names_to_string(&sugg.path); | ||
path.starts_with("core::intrinsics::") || path.starts_with("std::intrinsics::") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add a #[diagnostic_item]
attribute to the intrinsics extern
block and check that the parent of the suggestion is not that specific diagnostic item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I have access to diagnostic items in rustc_resolve? i don't have a tcx here, i don't think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right :D
just plain filtering them out sgtm |
@bors r+ rollup |
📌 Commit ab0938d has been approved by |
…-intrinsics, r=oli-obk Filter out intrinsics if we have other import candidates to suggest Fixes rust-lang#97618 Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.
…-intrinsics, r=oli-obk Filter out intrinsics if we have other import candidates to suggest Fixes rust-lang#97618 Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.
Rollup of 7 pull requests Successful merges: - rust-lang#97822 (Filter out intrinsics if we have other import candidates to suggest) - rust-lang#98026 (Move some tests to more reasonable directories) - rust-lang#98067 (compiler: remove unused deps) - rust-lang#98078 (Use unchecked mul to compute slice sizes) - rust-lang#98083 (Rename rustc_serialize::opaque::Encoder as MemEncoder.) - rust-lang#98087 (Suggest adding a `#[macro_export]` to a private macro) - rust-lang#98113 (Fix misspelling of "constraint" as "contraint") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #97618
Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.