Suggest importing the right kind of macro.#88229
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 22, 2021
Merged
Conversation
estebank
approved these changes
Aug 22, 2021
Comment on lines
952
to
+953
| let import_suggestions = | ||
| self.lookup_import_candidates(ident, Namespace::MacroNS, parent_scope, |res| { | ||
| matches!(res, Res::Def(DefKind::Macro(MacroKind::Bang), _)) | ||
| }); | ||
| self.lookup_import_candidates(ident, Namespace::MacroNS, parent_scope, is_expected); |
Contributor
There was a problem hiding this comment.
This is gonna have a merge conflict with the other PR, right?
Member
Author
There was a problem hiding this comment.
That other PR includes this one as the first commit (with identical hash even), so should be fine. ^^
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit bcc5ecb has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 22, 2021
…laumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#86747 (Improve wording of the `drop_bounds` lint) - rust-lang#87166 (Show discriminant before overflow in diagnostic for duplicate values.) - rust-lang#88077 (Generate an iOS LLVM target with a specific version) - rust-lang#88164 (PassWrapper: adapt for LLVM 14 changes) - rust-lang#88211 (cleanup: `Span::new` -> `Span::with_lo`) - rust-lang#88229 (Suggest importing the right kind of macro.) - rust-lang#88238 (Stop tracking namespace in used_imports.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this pull request
Aug 23, 2021
…-macro, r=estebank
Add notes to macro-not-found diagnostics to point out how things with the same name were not a match.
This adds notes like:
```
error: cannot find derive macro `Serialize` in this scope
--> $DIR/issue-88206.rs:22:10
|
LL | #[derive(Serialize)]
| ^^^^^^^^^
|
note: `Serialize` is imported here, but it is not a derive macro
--> $DIR/issue-88206.rs:17:11
|
LL | use hey::{Serialize, Deserialize};
| ^^^^^^^^^
```
Fixes rust-lang#88206
Includes rust-lang#88229
r? `@estebank`
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 #88228.
r? @estebank