Skip to content

Commit c5b82a6

Browse files
committed
Add test cases for #3668
Previous commits fix the issue. Closes #3668
1 parent 4f9e7ba commit c5b82a6

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn f(x:int) {
2+
const child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
3+
}
4+
5+
fn main() {}

src/test/run-pass/issue-3668.rs renamed to src/test/compile-fail/issue-3668.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// xfail-test
21
struct P { child: Option<@mut P> }
32
trait PTrait {
43
fn getChildOption() -> Option<@P>;
54
}
65

76
impl P: PTrait {
87
fn getChildOption() -> Option<@P> {
9-
const childVal: @P = self.child.get();
8+
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
109
fail;
1110
}
1211
}

src/test/run-pass/issue-3688-2.rs

-6
This file was deleted.

0 commit comments

Comments
 (0)