diff options
| author | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-05-31 23:00:58 +0800 |
|---|---|---|
| committer | ashtneoi <ashtneoi@gmail.com> | 2018-07-12 22:51:30 -0700 |
| commit | 4e5d22889bb299290fba61c9b51afe75bac583a0 (patch) | |
| tree | 7f837e9c009bf42d0ca7ffa69c4bce391be41e92 | |
| parent | 246caea009fd7b652d00f1b0a94108b7ac5b7938 (diff) | |
| download | rust-4e5d22889bb299290fba61c9b51afe75bac583a0.tar.gz rust-4e5d22889bb299290fba61c9b51afe75bac583a0.zip | |
update test
| -rw-r--r-- | src/test/ui/suggestions/issue-51244.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/suggestions/issue-51244.stderr | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-51244.rs b/src/test/ui/suggestions/issue-51244.rs new file mode 100644 index 00000000000..efb8a03a45c --- /dev/null +++ b/src/test/ui/suggestions/issue-51244.rs @@ -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; +} diff --git a/src/test/ui/suggestions/issue-51244.stderr b/src/test/ui/suggestions/issue-51244.stderr new file mode 100644 index 00000000000..b6663c3789e --- /dev/null +++ b/src/test/ui/suggestions/issue-51244.stderr @@ -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`. |
