]>
Commit | Line | Data |
---|---|---|
1a4d82fc | 1 | // macro f should not be able to inject a reference to 'n'. |
970d7e83 | 2 | |
1a4d82fc | 3 | macro_rules! f { () => (n) } |
32a655c1 SL |
4 | //~^ ERROR cannot find value `n` in this scope |
5 | //~| ERROR cannot find value `n` in this scope | |
6 | //~| ERROR cannot find value `n` in this scope | |
7 | //~| ERROR cannot find value `n` in this scope | |
223e47cc | 8 | |
1a4d82fc | 9 | fn main() -> (){ |
85aaf69f | 10 | for n in 0..1 { |
a7813a04 | 11 | println!("{}", f!()); |
1a4d82fc | 12 | } |
b039eaaf SL |
13 | |
14 | if let Some(n) = None { | |
a7813a04 | 15 | println!("{}", f!()); |
b039eaaf SL |
16 | } |
17 | ||
18 | if false { | |
19 | } else if let Some(n) = None { | |
a7813a04 | 20 | println!("{}", f!()); |
b039eaaf SL |
21 | } |
22 | ||
23 | while let Some(n) = None { | |
a7813a04 | 24 | println!("{}", f!()); |
b039eaaf | 25 | } |
223e47cc | 26 | } |