Skip to content

Commit d2b873b

Browse files
update ui tests
1 parent 983e035 commit d2b873b

5 files changed

+9
-10
lines changed

src/test/ui/borrowck/borrowck-closures-mut-of-imm.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Tests that two closures cannot simultaneously have mutable
22
// and immutable access to the variable. Issue #6801.
33

4-
fn get(x: &isize) -> isize {
5-
*x
6-
}
7-
84
fn set(x: &mut isize) {
95
*x = 4;
106
}

src/test/ui/borrowck/borrowck-closures-mut-of-imm.stderr

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
2-
--> $DIR/borrowck-closures-mut-of-imm.rs:13:25
2+
--> $DIR/borrowck-closures-mut-of-imm.rs:9:25
33
|
44
LL | let mut c1 = || set(&mut *x);
55
| ^^^^^^^ cannot borrow as mutable
66

77
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
8-
--> $DIR/borrowck-closures-mut-of-imm.rs:15:25
8+
--> $DIR/borrowck-closures-mut-of-imm.rs:11:25
99
|
1010
LL | let mut c2 = || set(&mut *x);
1111
| ^^^^^^^ cannot borrow as mutable
1212

1313
error[E0524]: two closures require unique access to `x` at the same time
14-
--> $DIR/borrowck-closures-mut-of-imm.rs:15:18
14+
--> $DIR/borrowck-closures-mut-of-imm.rs:11:18
1515
|
1616
LL | let mut c1 = || set(&mut *x);
1717
| -- - first borrow occurs due to use of `x` in closure
@@ -28,4 +28,5 @@ LL | c2(); c1();
2828

2929
error: aborting due to 3 previous errors
3030

31-
For more information about this error, try `rustc --explain E0596`.
31+
Some errors have detailed explanations: E0524, E0596.
32+
For more information about an error, try `rustc --explain E0524`.

src/test/ui/borrowck/borrowck-closures-mut-of-mut.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ LL | c2(); c1();
1515

1616
error: aborting due to previous error
1717

18+
For more information about this error, try `rustc --explain E0524`.

src/test/ui/borrowck/borrowck-closures-unique.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ LL | let c1 = |y: &'static mut isize| x = y;
5050

5151
error: aborting due to 4 previous errors
5252

53-
For more information about this error, try `rustc --explain E0500`.
53+
Some errors have detailed explanations: E0500, E0524.
54+
For more information about an error, try `rustc --explain E0500`.

src/test/ui/nll/closures-in-loops.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ LL | v.push(|| *x = String::new());
2727

2828
error: aborting due to 3 previous errors
2929

30-
Some errors have detailed explanations: E0382, E0499.
30+
Some errors have detailed explanations: E0382, E0499, E0524.
3131
For more information about an error, try `rustc --explain E0382`.

0 commit comments

Comments
 (0)