Vadim Petrochenkov | ca9faa5 | 2019-07-26 21:54:25 | [diff] [blame] | 1 | // run-pass |
Jeffrey Seyfried | faf0852 | 2016-01-22 09:55:29 | [diff] [blame] | 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 | } |