rust/tests/ui/binding/shadow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
496 B
Rust
Raw Normal View History

// run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
fn foo(c: Vec<isize> ) {
let a: isize = 5;
let mut b: Vec<isize> = Vec::new();
2011-07-27 12:19:39 +00:00
match t::none::<isize> {
t::some::<isize>(_) => {
2015-01-31 17:20:46 +00:00
for _i in &c {
2014-10-15 01:07:11 +00:00
println!("{}", a);
2015-01-25 21:05:03 +00:00
let a = 17;
b.push(a);
}
}
_ => { }
}
}
enum t<T> { none, some(T), }
pub fn main() { let x = 10; let x = x + 20; assert_eq!(x, 30); foo(Vec::new()); }