mashup icon indicating copy to clipboard operation
mashup copied to clipboard

Concatenated identifier may not refer to a captured local variable

Open dtolnay opened this issue 7 years ago • 0 comments
trafficstars

This is a consequence of hygiene rules.

#[macro_use]
extern crate mashup;

fn main() {
    let yy = 0;

    mashup! {
        m["y"] = y y;
    }

    m! {
        println!("{}", "y");
    }
}
error[E0425]: cannot find value `yy` in this scope
  --> src/main.rs:11:5
   |
11 | /     m! {
12 | |         println!("{}", "y");
13 | |     }
   | |_____^ not found in this scope
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

dtolnay avatar Jul 09 '18 17:07 dtolnay