rust/src/test/compile-fail/issue-3668.rs
Tim Chevalier c5b82a65e9 Add test cases for #3668
Previous commits fix the issue.

Closes #3668
2012-10-15 14:41:09 -07:00

14 lines
287 B
Rust

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() {}