mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
19 lines
410 B
Rust
19 lines
410 B
Rust
//! Regression test for https://github.com/rust-lang/rust/issues/3668
|
|
//!
|
|
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() {}
|