File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
branches/try/src/test/compile-fail Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: e0f59e835e062d27543ae5085b49effb13294b61
5
+ refs/heads/try: b93839408c9f35cd8497d1de5b48639eb8ae7f8d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments