Skip to content

Duplicate crate macros failing to differentiate #71259

@LucioFranco

Description

@LucioFranco

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_eq allows the second one to compile properly. If its not commented out the tower03 version will fail to compile because it is attempting to use the tower01 version 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 nightly cargo 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.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.E-needs-testCall 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions