rust/src/test/compile-fail/issue-3668.rs

14 lines
287 B
Rust
Raw Normal View History

struct P { child: Option<@mut P> }
trait PTrait {
fn getChildOption() -> Option<@P>;
}
impl P: PTrait {
fn getChildOption() -> Option<@P> {
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
fail;
}
}
fn main() {}