update test

This commit is contained in:
csmoe 2018-05-31 23:00:58 +08:00 committed by ashtneoi
parent 246caea009
commit 4e5d22889b
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,14 @@
// Copyright 2018 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 ref my_ref @ _ = 0;
*my_ref = 0;
}

View File

@ -0,0 +1,11 @@
error[E0594]: cannot assign to immutable borrowed content `*my_ref`
--> $DIR/issue-51244.rs:13:5
|
LL | let ref my_ref @ _ = 0;
| -------------- consider changing this to `ref mut my_ref @ _`
LL | *my_ref = 0;
| ^^^^^^^^^^^ cannot borrow as mutable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0594`.