about summary refs log tree commit diff
path: root/tests/ui/issues/issue-29522.rs
blob: 2a39ef28bdbbca1349050be680999b9dfa23b791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ run-pass
#![allow(unused_variables)]
// check that we don't accidentally capture upvars just because their name
// occurs in a path

fn assert_static<T: 'static>(_t: T) {}

mod foo {
    pub fn scope() {}
}

fn main() {
    let scope = &mut 0;
    assert_static(|| {
       foo::scope();
    });
}