rust/tests/ui/issues/issue-15167.rs

27 lines
574 B
Rust
Raw Normal View History

2014-06-25 01:49:19 +00:00
// macro f should not be able to inject a reference to 'n'.
macro_rules! f { () => (n) }
//~^ ERROR cannot find value `n` in this scope
//~| ERROR cannot find value `n` in this scope
//~| ERROR cannot find value `n` in this scope
//~| ERROR cannot find value `n` in this scope
2014-06-25 01:49:19 +00:00
fn main() -> (){
2015-01-31 16:23:42 +00:00
for n in 0..1 {
2016-05-18 11:26:54 +00:00
println!("{}", f!());
2014-06-25 01:49:19 +00:00
}
if let Some(n) = None {
2016-05-18 11:26:54 +00:00
println!("{}", f!());
}
if false {
} else if let Some(n) = None {
2016-05-18 11:26:54 +00:00
println!("{}", f!());
}
while let Some(n) = None {
2016-05-18 11:26:54 +00:00
println!("{}", f!());
}
2014-06-25 01:49:19 +00:00
}