parent
4f9e7babeb
commit
c5b82a65e9
5
src/test/compile-fail/issue-3668-2.rs
Normal file
5
src/test/compile-fail/issue-3668-2.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
fn f(x:int) {
|
||||||
|
const child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
@ -1,4 +1,3 @@
|
|||||||
// xfail-test
|
|
||||||
struct P { child: Option<@mut P> }
|
struct P { child: Option<@mut P> }
|
||||||
trait PTrait {
|
trait PTrait {
|
||||||
fn getChildOption() -> Option<@P>;
|
fn getChildOption() -> Option<@P>;
|
||||||
@ -6,7 +5,7 @@ trait PTrait {
|
|||||||
|
|
||||||
impl P: PTrait {
|
impl P: PTrait {
|
||||||
fn getChildOption() -> Option<@P> {
|
fn getChildOption() -> Option<@P> {
|
||||||
const childVal: @P = self.child.get();
|
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
|
||||||
fail;
|
fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +0,0 @@
|
|||||||
// xfail-test
|
|
||||||
fn f(x:int) {
|
|
||||||
const child: int = x + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
Loading…
Reference in New Issue
Block a user