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
This commit is contained in:
Jonathan Turner 2016-08-11 06:33:59 -07:00 committed by GitHub
commit ea342549a8

View File

@ -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");
}