Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMacros: limitation in the expression parser for <$:path>::<ident> #48067
Comments
behnam
changed the title
Macros: limitation in the expression parser for <$:path>::<tt>
Macros: limitation in the expression parser for <$:path>::<ident>
Feb 8, 2018
This comment has been minimized.
This comment has been minimized.
|
cc @jseyfried This is known issue, but I don't know how hard it would be to make it "just work". |
This comment has been minimized.
This comment has been minimized.
|
We can even do |
petrochenkov
self-assigned this
Feb 9, 2018
pietroalbini
added
C-enhancement
A-parser
A-macros
T-compiler
labels
Feb 10, 2018
petrochenkov
referenced this issue
Aug 14, 2018
Merged
rustc_resolve: don't allow paths starting with `::crate`. #53347
petrochenkov
referenced this issue
Feb 23, 2019
Open
Tracking issue for RFC 2338, "Type alias enum variants" #49683
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
behnam commentedFeb 8, 2018
•
edited
Background: https://users.rust-lang.org/t/macros-using-path-tokens-with-format-args/15480
When passing in a
pathtoken to a macro, then trying to suffix the metavariable with::<ident>(or more), the parser cannot recognize the whole thing as an:expr, which causes failures on calls to macros likeformat_args!.Repro:
It fails with three instances of this error (with
RUSTFLAGS='-Z external-macro-backtrace'):A workaround is to use:
{ use $path as base; base::say }but would be great if we could just use:
I couldn't find an existing report. I'm guessing it falls under RFE.