Closed
Description
I would expect the following program to print right
. Instead it prints wrong
.
#![feature(macro_literal_matcher)]
macro_rules! a {
($i:literal) => { "right" };
($i:tt) => { "wrong" };
}
macro_rules! b {
($i:literal) => { a!($i) };
}
fn main() {
println!(b!(0));
}
Originally reported by @jendrikw in #35625 (comment).
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
literal
fragment specifier (RFC 1576) #356250e4ef622 commentedon Aug 5, 2018
Is any work being done on this? I found something that could help.
syntax::ext::tt::macro_parser: may_begin_with("literal", Interpolated((NtLiteral(..), None))) = false
kennytm commentedon Aug 5, 2018
@0e4ef622 you're welcome to submit a PR 😊. Just remember to add a test case in
src/test/run-pass
.Rollup merge of rust-lang#53093 - 0e4ef622:issue-52169-fix, r=petroch…