Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous macro use does not compile #337

Closed
hhamana opened this issue Dec 27, 2021 · 3 comments
Closed

Ambiguous macro use does not compile #337

hhamana opened this issue Dec 27, 2021 · 3 comments
Labels
C-question Category: A question

Comments

@hhamana
Copy link

hhamana commented Dec 27, 2021

Environment:
pin-project 1.09, with dependency on pin-project-internal 0.4.27
Windows 10. rustc 1.57.0 (f1edd0429 2021-11-29)

error[E0659]: `parse_quote_spanned` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
   --> \.cargo\registry\src\gitpro.ttaallkk.top-1ecc6299db9ec823\pin-project-internal-0.4.27\src\pin_project\derive.rs:865:67
    |
865 |                 proj_generics.make_where_clause().predicates.push(parse_quote_spanned! { span =>
    |                                                                   ^^^^^^^^^^^^^^^^^^^ ambiguous name
    |
note: `parse_quote_spanned` could refer to the macro defined here
   --> \.cargo\registry\src\gitpro.ttaallkk.top-1ecc6299db9ec823\pin-project-internal-0.4.27\src\utils.rs:22:1
    |
22  | / macro_rules! parse_quote_spanned {
23  | |     ($span:expr => $($tt:tt)*) => {
24  | |         syn::parse2(quote::quote_spanned!($span => $($tt)*)).unwrap_or_else(|e| panic!("{}", e))
25  | |     };
26  | | }
    | |_^
note: `parse_quote_spanned` could also refer to the macro imported here
   --> \.cargo\registry\src\gitpro.ttaallkk.top-1ecc6299db9ec823\pin-project-internal-0.4.27\src\pin_project\derive.rs:7:5
    |
7   |     *,
    |     ^
    = help: use `self::parse_quote_spanned` to refer to this macro unambiguously
@taiki-e
Copy link
Owner

taiki-e commented Dec 27, 2021

This is already fixed in 0.4.29. See #335 for more.

@taiki-e taiki-e closed this as completed Dec 27, 2021
@hhamana
Copy link
Author

hhamana commented Dec 27, 2021

hmm, interesting. since this came up after adding a dependency that relied on this, I assumed 0.4.27 was the latest, turns out cargo had decided to lock to that version.
cargo update unpinned the dependency and fetched the version with fix.
thank you~

@taiki-e
Copy link
Owner

taiki-e commented Dec 31, 2021

I've reverted the increase in the minimum version of syn in pin-project 1.0.10 (because adding pin-project 1.0.9 to the dependencies was forcing syn 1.0.84+), and yanked the old versions of pin-project that did not compile with the latest syn. So the chances of users encountering this issue will be much lower.

In any case, users who run into this problem can fix this issue by updating pin-project by cargo update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question
Projects
None yet
Development

No branches or pull requests

2 participants