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