We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f9e7ba commit c5b82a6Copy full SHA for c5b82a6
src/test/compile-fail/issue-3668-2.rs
@@ -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,12 +1,11 @@
-// xfail-test
struct P { child: Option<@mut P> }
trait PTrait {
fn getChildOption() -> Option<@P>;
}
6
7
impl P: PTrait {
8
fn getChildOption() -> Option<@P> {
9
- const childVal: @P = self.child.get();
+ const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
10
fail;
11
12
src/test/run-pass/issue-3688-2.rs
0 commit comments