mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
15 lines
325 B
Rust
15 lines
325 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 attempt to use a non-constant value in a constant
|
|
panic!();
|
|
}
|
|
}
|
|
|
|
fn main() {}
|