File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
error[E0594]: cannot assign to `x`, as it is not declared as mutable
2
- --> $DIR/cannot-mutate-captured-non-mut-var .rs:9:25
2
+ --> $DIR/closure-immut-capture-error .rs:14:9
3
3
|
4
- LL | to_fn_once(move|| { x = 2; }) ;
5
- | ^^^^^ cannot assign
4
+ LL | x = 2;
5
+ | ^^^^^ cannot assign
6
6
|
7
7
help: consider changing this to be mutable
8
8
|
9
9
LL | let mut x = 1;
10
10
| +++
11
11
12
12
error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable
13
- --> $DIR/cannot-mutate-captured-non-mut-var .rs:13:25
13
+ --> $DIR/closure-immut-capture-error .rs:20:9
14
14
|
15
- LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); } );
16
- | ^ cannot borrow as mutable
15
+ LL | s.read_to_end(&mut Vec::new());
16
+ | ^ cannot borrow as mutable
17
17
|
18
18
help: consider changing this to be mutable
19
19
|
Original file line number Diff line number Diff line change 1
1
error[E0308]: mismatched types
2
- --> $DIR/break-diverging-value .rs:11 :26
2
+ --> $DIR/loop- break-never-type-mismatch .rs:17 :26
3
3
|
4
4
LL | fn loop_break_break() -> i32 {
5
5
| ---------------- ^^^ expected `i32`, found `()`
6
6
| |
7
7
| implicitly returns `()` as its body has no tail or `return` expression
8
8
9
9
error[E0308]: mismatched types
10
- --> $DIR/break-diverging-value .rs:25 :25
10
+ --> $DIR/loop- break-never-type-mismatch .rs:39 :25
11
11
|
12
12
LL | fn loop_break_void() -> i32 {
13
13
| --------------- ^^^ expected `i32`, found `()`
You can’t perform that action at this time.
0 commit comments