]> git.lizzy.rs Git - rust.git/blob - tests/ui/lexical-scoping.rs
Auto merge of #106812 - oli-obk:output_filenames, r=petrochenkov
[rust.git] / tests / 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 }