Skip to content

Commit

Permalink
Add test cases for #3668
Browse files Browse the repository at this point in the history
Previous commits fix the issue.

Closes #3668
  • Loading branch information
catamorphism committed Oct 15, 2012
1 parent 4f9e7ba commit c5b82a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/test/compile-fail/issue-3668-2.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// xfail-test
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();
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
fail;
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/test/run-pass/issue-3688-2.rs

This file was deleted.

0 comments on commit c5b82a6

Please sign in to comment.