Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

"Expected identifier after :" error when :: is used inside attribute #70

Closed
SabrinaJewson opened this issue Nov 6, 2021 · 1 comment · Fixed by #71
Closed

"Expected identifier after :" error when :: is used inside attribute #70

SabrinaJewson opened this issue Nov 6, 2021 · 1 comment · Fixed by #71

Comments

@SabrinaJewson
Copy link

This simple example:

macro_rules! a { (#[x = $x:ty]) => {}; }
paste::paste!(a!(#[x = foo::Bar]));

Fails with the error message:

error: expected identifier after `:`
 --> src/lib.rs:3:27
  |
3 | paste::paste!(a!(#[x = foo::Bar]));
  |                           ^^

It seems like paste! is treating the attribute as a doc attribute even though it isn't.

@dtolnay
Copy link
Owner

dtolnay commented Nov 7, 2021

Good catch. I've published a fix in 1.0.6.

@dtolnay dtolnay changed the title "Expected identifier after : error" when :: is used inside attribute "Expected identifier after :" error when :: is used inside attribute Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants