Filter out intrinsics if we have other import candidates to suggest#97822
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 15, 2022
Merged
Conversation
Contributor
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
5c9f012 to
ab0938d
Compare
oli-obk
reviewed
Jun 13, 2022
Comment on lines
+403
to
+404
| let path = path_names_to_string(&sugg.path); | ||
| path.starts_with("core::intrinsics::") || path.starts_with("std::intrinsics::") |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
do I have access to diagnostic items in rustc_resolve? i don't have a tcx here, i don't think.
Contributor
|
just plain filtering them out sgtm |
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit ab0938d has been approved by |
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jun 14, 2022
…-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.
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jun 14, 2022
…-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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 15, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #97618
Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.