summary refs log tree commit diff
path: root/src/test/ui/issues/issue-3668.rs
blob: 3f61b1b02e7796a960b354c2bbb92239c354d9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct P { child: Option<Box<P>> }
trait PTrait {
   fn getChildOption(&self) -> Option<Box<P>>;
}

impl PTrait for P {
   fn getChildOption(&self) -> Option<Box<P>> {
       static childVal: Box<P> = self.child.get();
       //~^ ERROR can't capture dynamic environment
       panic!();
   }
}

fn main() {}