Skip to content

Commit 9d6ab9a

Browse files
committed
Update error message and un-xfail test
1 parent 39c306e commit 9d6ab9a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/compile-fail/regions-var-type-out-of-scope.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// xfail-test
2-
31
fn foo(cond: bool) {
42
// Here we will infer a type that uses the
53
// region of the if stmt then block:
6-
let mut x; //~ ERROR foo
4+
let mut x;
75

86
if cond {
9-
x = &3;
7+
x = &3; //~ ERROR illegal borrow: borrowed value does not live long enough
8+
assert (*x == 3);
109
}
1110
}
1211

0 commit comments

Comments
 (0)