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 11error[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
33 |
4- LL | to_fn_once(move|| { x = 2; }) ;
5- | ^^^^^ cannot assign
4+ LL | x = 2;
5+ | ^^^^^ cannot assign
66 |
77help: consider changing this to be mutable
88 |
99LL | let mut x = 1;
1010 | +++
1111
1212error[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
1414 |
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
1717 |
1818help: consider changing this to be mutable
1919 |
Original file line number Diff line number Diff line change 11error[E0308]: mismatched types
2- --> $DIR/break-diverging-value .rs:11 :26
2+ --> $DIR/loop- break-never-type-mismatch .rs:17 :26
33 |
44LL | fn loop_break_break() -> i32 {
55 | ---------------- ^^^ expected `i32`, found `()`
66 | |
77 | implicitly returns `()` as its body has no tail or `return` expression
88
99error[E0308]: mismatched types
10- --> $DIR/break-diverging-value .rs:25 :25
10+ --> $DIR/loop- break-never-type-mismatch .rs:39 :25
1111 |
1212LL | fn loop_break_void() -> i32 {
1313 | --------------- ^^^ expected `i32`, found `()`
You can’t perform that action at this time.
0 commit comments