summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-3668.rs
blob: 0e1f19a75baeb1d7507f9a4cd349272b98aa666c (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 attempt to use a non-constant value in a constant
       panic!();
   }
}

fn main() {}