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

Pasted identifier may not refer to a captured local variable #1

Closed
dtolnay opened this issue Nov 1, 2018 · 0 comments
Closed

Pasted identifier may not refer to a captured local variable #1

dtolnay opened this issue Nov 1, 2018 · 0 comments

Comments

@dtolnay
Copy link
Owner

dtolnay commented Nov 1, 2018

This is a consequence of hygiene rules.

extern crate paste;

fn main() {
    let yy = 0;

    paste::expr! {
        println!("{}", [<y y>]);
    }
}
error[E0425]: cannot find value `yy` in this scope                                                                             
 --> src/main.rs:6:5                                                                                                           
  |                                                                                                                            
6 | /     paste::expr! {                                                                                                       
7 | |         println!("{}", [<y y>]);                                                                                         
8 | |     }                                                                                                                    
  | |_____^ not found in this scope
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant