]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lexical-scoping.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / lexical-scoping.rs
1 // run-pass
2 // Tests that items in subscopes can shadow type parameters and local variables (see issue #23880).
3
4 #![allow(unused)]
5 struct Foo<X> { x: Box<X> }
6 impl<Bar> Foo<Bar> {
7 fn foo(&self) {
8 type Bar = i32;
9 let _: Bar = 42;
10 }
11 }
12
13 fn main() {
14 let f = 1;
15 {
16 fn f() {}
17 f();
18 }
19 }