2014-10-02 08:10:09 +03:00
|
|
|
struct P { child: Option<Box<P>> }
|
2012-09-18 22:33:49 -07:00
|
|
|
trait PTrait {
|
2014-10-02 08:10:09 +03:00
|
|
|
fn getChildOption(&self) -> Option<Box<P>>;
|
2012-09-18 22:33:49 -07:00
|
|
|
}
|
|
|
|
|
2013-02-14 11:47:00 -08:00
|
|
|
impl PTrait for P {
|
2014-10-02 08:10:09 +03:00
|
|
|
fn getChildOption(&self) -> Option<Box<P>> {
|
|
|
|
static childVal: Box<P> = self.child.get();
|
2019-02-07 16:03:12 +01:00
|
|
|
//~^ ERROR attempt to use a non-constant value in a constant
|
2014-10-09 15:17:22 -04:00
|
|
|
panic!();
|
2012-09-18 22:33:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|