about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorFelix Rath <felixr@archlinux.info>2016-08-08 21:04:51 +0200
committerFelix Rath <felixr@archlinux.info>2016-08-08 21:04:51 +0200
commit3c04ba2c34e5be05a68bcd228ae41edff1b520d5 (patch)
tree3ea5f98380e6766d307f077ac1e7ed9f327a786c /src/test
parentb42a384a8078d79b299f2029b6c183b5e9288062 (diff)
downloadrust-3c04ba2c34e5be05a68bcd228ae41edff1b520d5.tar.gz
rust-3c04ba2c34e5be05a68bcd228ae41edff1b520d5.zip
add test for issue #29053
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-29053.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-29053.rs b/src/test/run-pass/issue-29053.rs
new file mode 100644
index 00000000000..72655071e41
--- /dev/null
+++ b/src/test/run-pass/issue-29053.rs
@@ -0,0 +1,21 @@
+// Copyright 2016 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.
+
+fn main() {
+    let x: &'static str = "x";
+
+    {
+        let y = "y".to_string();
+        let ref mut x = &*x;
+        *x = &*y;
+    }
+
+    assert_eq!(x, "x");
+}