Skip to content

Commit f21ca11

Browse files
committed
---
yaml --- r: 16003 b: refs/heads/try c: b938394 h: refs/heads/master i: 16001: ab6ec4e 15999: 5ba5733 v: v3
1 parent 810182f commit f21ca11

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: e0f59e835e062d27543ae5085b49effb13294b61
5+
refs/heads/try: b93839408c9f35cd8497d1de5b48639eb8ae7f8d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// xfail-fast (compile-flags unsupported on windows)
2+
// compile-flags:--borrowck=err
3+
4+
fn impure(_i: int) {}
5+
6+
fn foo(v: &const option<int>) {
7+
alt *v {
8+
some(i) {
9+
//!^ NOTE pure context is required due to an illegal borrow: enum variant in aliasable, mutable location
10+
// check that unchecked alone does not override borrowck:
11+
unchecked {
12+
impure(i); //! ERROR access to non-pure functions prohibited in a pure context
13+
}
14+
}
15+
none {
16+
}
17+
}
18+
}
19+
20+
fn bar(v: &const option<int>) {
21+
alt *v {
22+
some(i) {
23+
unsafe {
24+
impure(i);
25+
}
26+
}
27+
none {
28+
}
29+
}
30+
}
31+
32+
fn main() {
33+
}

0 commit comments

Comments
 (0)