diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-11 06:33:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-11 06:33:59 -0700 |
| commit | ea342549a859cfef63b6ab5a9e9ba910d5a5e3c8 (patch) | |
| tree | 9080a3b43d1d5b9cd7df16b241145c072e6a80be | |
| parent | 853fe869064bc2d9a0120b906e2a5485529340d6 (diff) | |
| parent | 3c04ba2c34e5be05a68bcd228ae41edff1b520d5 (diff) | |
| download | rust-ea342549a859cfef63b6ab5a9e9ba910d5a5e3c8.tar.gz rust-ea342549a859cfef63b6ab5a9e9ba910d5a5e3c8.zip | |
Rollup merge of #35505 - futile:test_29053, r=nikomatsakis
Add test for issue #29053 This PR adds a test for #29053 (currently fails on stage 0, but works with stage 1, as it should). Fixes #29053
| -rw-r--r-- | src/test/run-pass/issue-29053.rs | 21 |
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"); +} |
