Skip to content

Suggest importing the right kind of macro. - #88229

Merged
bors merged 1 commit into
rust-lang:masterfrom
m-ou-se:macro-suggest-right-kind
Aug 22, 2021
Merged

Suggest importing the right kind of macro.#88229
bors merged 1 commit into
rust-lang:masterfrom
m-ou-se:macro-suggest-right-kind

Conversation

@m-ou-se

Copy link
Copy Markdown
Member

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna have a merge conflict with the other PR, right?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That other PR includes this one as the first commit (with identical hash even), so should be fine. ^^

@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Aug 22, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit bcc5ecb has been approved by estebank

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2021
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
@bors
bors merged commit 518b27b into rust-lang:masterAug 22, 2021
@rustbotrustbot added this to the 1.56.0 milestone Aug 22, 2021
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};
| ^^^^^^^^^
```
Fixesrust-lang#88206
Includes rust-lang#88229
r? `@estebank`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing derive macro suggests importing regular macro

5 participants

@m-ou-se@estebank@bors@rust-highfive@rustbot