aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/capture2.rs
blob: 1b088c69511bac3258532616c6ba01dc672d5859 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// -*- rust -*-

// error-pattern: attempted dynamic environment-capture

fn f(bool x) {
}

state obj foobar(bool x) {
  drop {
    auto y = x;
    fn test() {
      f(y);
    }
  }
}

fn main() {
}