Bless output of test nll/get_default.rs for Polonius
2 of the 3 errors are "fixed by Polonius" 🎉
This commit is contained in:
parent
6a7c15ed25
commit
c5a1bc1e5c
1 changed files with 15 additions and 0 deletions
15
src/test/ui/nll/get_default.polonius.stderr
Normal file
15
src/test/ui/nll/get_default.polonius.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable
|
||||
--> $DIR/get_default.rs:32:17
|
||||
|
|
||||
LL | match map.get() {
|
||||
| --- immutable borrow occurs here
|
||||
LL | Some(v) => {
|
||||
LL | map.set(String::new()); // Both AST and MIR error here
|
||||
| ^^^ mutable borrow occurs here
|
||||
LL |
|
||||
LL | return v;
|
||||
| - immutable borrow later used here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0502`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue