-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Duplicate crate macros failing to differentiate #71259
Copy link
Copy link
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Here is a reproduction:
https://github.com/LucioFranco/rustc-duplicate-macro-bug/
I've added comments on how to trigger the bug. But it looks like if we have one crate but two versions imported into the same project. Aka using cargo's rename feature, then rust picks up that if we use one of the macros that the other one even if its from a different version is the same. Commenting out the tower01
assert_request_eqallows the second one to compile properly. If its not commented out thetower03version will fail to compile because it is attempting to use thetower01version which doesn't await the inner future.Meta
This happens currently on
rustc 1.42.0 (b8cedc004 2020-03-09)but not on a newer nightlycargo 1.44.0-nightly (390e8f245 2020-04-07). So this has probably been fixed but I couldn't find any issue for this specific problem.