You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![feature(plugin)]#[plugin]#[no_link]externcrate quote_fail;#[test]fnit_works(){let a = "hello";macro_test!(a);}
The latter fails to compile with the following error:
<quote expansion>:1:27: 1:28 error: unresolved name `a`
<quote expansion>:1 name_228,ctxt_0!("{}" , a)
^
note: in expansion of format_args!
<std macros>:2:42: 2:75 note: expansion site
<std macros>:1:1: 2:77 note: in expansion of println!
<quote expansion>:1:1: 1:29 note: expansion site
/home/chris/dev/quote_fail/tests/tests.rs:1:1: 9:1 note: in expansion of macro_test!
/home/chris/dev/quote_fail/tests/tests.rs:8:5: 8:20 note: expansion site
error: aborting due to previous error
Could not compile `quote_fail`.
This error goes away if I do either of these things:
Remove the println! call, i.e. replace println!("{}", $tt) with $tt
Call quote_expr! only once instead of twice, i.e. MacExpr::new(e)
I'm using rustc commit 8903c21 built 2015-01-16 on Ubuntu 14.10 x86_64.
The text was updated successfully, but these errors were encountered:
Sorry about the long title. I couldn't find a better way to express the issue :)
Given the following syntax extension:
and this test file:
The latter fails to compile with the following error:
This error goes away if I do either of these things:
println!
call, i.e. replaceprintln!("{}", $tt)
with$tt
quote_expr!
only once instead of twice, i.e.MacExpr::new(e)
I'm using
rustc
commit8903c21
built2015-01-16
on Ubuntu 14.10 x86_64.The text was updated successfully, but these errors were encountered: