rust/tests/ui/issues/issue-3668.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
325 B
Rust
Raw Normal View History

2014-10-02 05:10:09 +00:00
struct P { child: Option<Box<P>> }
trait PTrait {
2014-10-02 05:10:09 +00:00
fn getChildOption(&self) -> Option<Box<P>>;
}
impl PTrait for P {
2014-10-02 05:10:09 +00:00
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() {}