14 lines
309 B
Rust
14 lines
309 B
Rust
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() {}
|