Skip to content

Commit 06b9cce

Browse files
add issue links and blessborrowck tests
1 parent a1fd54e commit 06b9cce

31 files changed

Lines changed: 38 additions & 21 deletions

tests/ui/borrowck/assign-op-invariance-lifetime.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `line` does not live long enough
2-
--> $DIR/issue-52126-assign-op-invariance.rs:34:28
2+
--> $DIR/assign-op-invariance-lifetime.rs:34:28
33
|
44
LL | for line in vec!["123456789".to_string(), "12345678".to_string()] {
55
| ---- binding `line` declared here

tests/ui/borrowck/borrowed-mut-pointer-assign-overflow-off.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Issue link https://github.com/rust-lang/rust/issues/45697
12
// Test that assignments to an `&mut` pointer which is found in a
23
// borrowed (but otherwise non-aliasable) location is illegal.
34

tests/ui/borrowck/borrowed-mut-pointer-assign-overflow-off.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0503]: cannot use `*y.pointer` because it was mutably borrowed
2-
--> $DIR/issue-45697.rs:20:9
2+
--> $DIR/borrowed-mut-pointer-assign-overflow-off.rs:21:9
33
|
44
LL | let z = copy_borrowed_ptr(&mut y);
55
| ------ `y` is borrowed here
@@ -10,7 +10,7 @@ LL | *z.pointer += 1;
1010
| --------------- borrow later used here
1111

1212
error[E0506]: cannot assign to `*y.pointer` because it is borrowed
13-
--> $DIR/issue-45697.rs:20:9
13+
--> $DIR/borrowed-mut-pointer-assign-overflow-off.rs:21:9
1414
|
1515
LL | let z = copy_borrowed_ptr(&mut y);
1616
| ------ `*y.pointer` is borrowed here

tests/ui/borrowck/borrowed-mut-pointer-assign-overflow-on.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Issue link https://github.com/rust-lang/rust/issues/45697
12
// Test that assignments to an `&mut` pointer which is found in a
23
// borrowed (but otherwise non-aliasable) location is illegal.
34

tests/ui/borrowck/borrowed-mut-pointer-assign-overflow-on.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0503]: cannot use `*y.pointer` because it was mutably borrowed
2-
--> $DIR/issue-45697-1.rs:20:9
2+
--> $DIR/borrowed-mut-pointer-assign-overflow-on.rs:21:9
33
|
44
LL | let z = copy_borrowed_ptr(&mut y);
55
| ------ `y` is borrowed here
@@ -10,7 +10,7 @@ LL | *z.pointer += 1;
1010
| --------------- borrow later used here
1111

1212
error[E0506]: cannot assign to `*y.pointer` because it is borrowed
13-
--> $DIR/issue-45697-1.rs:20:9
13+
--> $DIR/borrowed-mut-pointer-assign-overflow-on.rs:21:9
1414
|
1515
LL | let z = copy_borrowed_ptr(&mut y);
1616
| ------ `*y.pointer` is borrowed here

tests/ui/borrowck/cannot-assign-borrowed-ref-in-slice.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/40288
12
fn save_ref<'a>(refr: &'a i32, to: &mut [&'a i32]) {
23
for val in &mut *to {
34
*val = refr;

tests/ui/borrowck/cannot-assign-borrowed-ref-in-slice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0506]: cannot assign to `*refr` because it is borrowed
2-
--> $DIR/issue-40288.rs:16:5
2+
--> $DIR/cannot-assign-borrowed-ref-in-slice.rs:17:5
33
|
44
LL | save_ref(&*refr, &mut out);
55
| ------ `*refr` is borrowed here

tests/ui/borrowck/cannot-borrow-index-of-hashmap-in-for.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/41726
12
use std::collections::HashMap;
23
fn main() {
34
let things: HashMap<String, Vec<String>> = HashMap::new();

tests/ui/borrowck/cannot-borrow-index-of-hashmap-in-for.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0596]: cannot borrow data in an index of `HashMap<String, Vec<String>>` as mutable
2-
--> $DIR/issue-41726.rs:5:9
2+
--> $DIR/cannot-borrow-index-of-hashmap-in-for.rs:6:9
33
|
44
LL | things[src.as_str()].sort();
55
| ^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

tests/ui/borrowck/cannot-borrow-index-output-mutably.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/44405
12
use std::ops::Index;
23

34
struct Test;

0 commit comments

Comments
 (0)