]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-27282-mutate-before-diverging-arm-1.stderr
index a9d9651fb2a35e45bfc89b600b2d642d19a62650..199407ad77463f5f4b8b703b4bbc607966cbb353 100644 (file)
@@ -1,17 +1,14 @@
-error[E0500]: closure requires unique access to `x` but it is already borrowed
-  --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:33:14
+error[E0510]: cannot mutably borrow `x` in match guard
+  --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:23:14
    |
 LL |     match x {
-   |           - borrow occurs here
+   |           - value is immutable in match guard
 ...
 LL |             (|| { *x = None; drop(force_fn_once); })();
-   |              ^^    - second borrow occurs due to use of `x` in closure
+   |              ^^    - borrow occurs due to use of `x` in closure
    |              |
-   |              closure construction occurs here
-...
-LL |         &mut Some(&a) if { // this binds to garbage if we've corrupted discriminant
-   |         ------------- borrow later used here
+   |              cannot mutably borrow
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0500`.
+For more information about this error, try `rustc --explain E0510`.