Skip to content

Commit ca5f6b9

Browse files
committed
Relocate issues/issue-51515.rs to
borrowck/assignment-to-immutable-ref.rs
1 parent 17e40db commit ca5f6b9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/ui/issues/issue-51515.rs renamed to tests/ui/borrowck/assignment-to-immutable-ref.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Regression test for issue <https://github.com/rust-lang/rust/issues/51515>
2+
//! Test that assigning through an immutable reference (`&`) correctly yields an assignment error (E0594) and suggests using a mutable reference.
3+
14
fn main() {
25
let foo = &16;
36
//~^ HELP consider changing this to be a mutable reference

tests/ui/issues/issue-51515.stderr renamed to tests/ui/borrowck/assignment-to-immutable-ref.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
2-
--> $DIR/issue-51515.rs:4:5
2+
--> $DIR/assignment-to-immutable-ref.rs:7:5
33
|
44
LL | *foo = 32;
55
| ^^^^^^^^^ `foo` is a `&` reference, so it cannot be written to
@@ -10,7 +10,7 @@ LL | let foo = &mut 16;
1010
| +++
1111

1212
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
13-
--> $DIR/issue-51515.rs:8:5
13+
--> $DIR/assignment-to-immutable-ref.rs:11:5
1414
|
1515
LL | *bar = 64;
1616
| ^^^^^^^^^ `bar` is a `&` reference, so it cannot be written to

0 commit comments

Comments
 (0)