about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-10 07:43:52 -0700
committerGitHub <noreply@github.com>2016-06-10 07:43:52 -0700
commita267d6cee40c2f2fa3db999afbb2bd1384f7840a (patch)
tree7f019ee7195a933addb73b8f0dee845c1349bd08 /src/test
parent68241f00ad8fb90474748b37ebd68b6bd46c796b (diff)
parent107d423f1ab9a110fdf2253e7d0074f0ab5bf868 (diff)
downloadrust-a267d6cee40c2f2fa3db999afbb2bd1384f7840a.tar.gz
rust-a267d6cee40c2f2fa3db999afbb2bd1384f7840a.zip
Auto merge of #34200 - sanxiyn:rollup, r=sanxiyn
Rollup of 12 pull requests

- Successful merges: #34088, #34129, #34136, #34145, #34146, #34148, #34159, #34160, #34165, #34175, #34184, #34185
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-25579.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-25579.rs b/src/test/compile-fail/issue-25579.rs
new file mode 100644
index 00000000000..849c9aa18c9
--- /dev/null
+++ b/src/test/compile-fail/issue-25579.rs
@@ -0,0 +1,27 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Sexpression {
+    Num(()),
+    Cons(&'static mut Sexpression)
+}
+
+fn causes_ice(mut l: &mut Sexpression) {
+    loop { match l {
+        &mut Sexpression::Num(ref mut n) => {},
+        &mut Sexpression::Cons(ref mut expr) => { //~ ERROR cannot borrow `l.0`
+            //~| ERROR cannot borrow `l.0`
+            l = &mut **expr; //~ ERROR cannot assign to `l`
+        }
+    }}
+}
+
+fn main() {
+}