]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/lexical-scoping.rs
Auto merge of #61817 - eddyb:begone-gcx-attempt-2, r=oli-obk
[rust.git] / src / test / run-pass / lexical-scoping.rs
1 // Tests that items in subscopes can shadow type parameters and local variables (see issue #23880).
2
3 #![allow(unused)]
4 struct Foo<X> { x: Box<X> }
5 impl<Bar> Foo<Bar> {
6     fn foo(&self) {
7         type Bar = i32;
8         let _: Bar = 42;
9     }
10 }
11
12 fn main() {
13     let f = 1;
14     {
15         fn f() {}
16         f();
17     }
18 }