Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
roxelo committed Sep 27, 2021
1 parent 8701020 commit d0e2b60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/test/ui/closures/2229_closure_analysis/issue-88118-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// edition:2021
// run-pass
#![feature(if_let_guard)]
#[allow(unused_must_use)]
#[allow(dead_code)]

fn print_error_count(registry: &Registry) {
|x: &Registry| {
Expand Down
11 changes: 2 additions & 9 deletions src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: irrefutable `if let` guard pattern
--> $DIR/issue-88118-2.rs:7:29
--> $DIR/issue-88118-2.rs:10:29
|
LL | Registry if let _ = registry.try_find_description() => { }
| ^
Expand All @@ -8,12 +8,5 @@ LL | Registry if let _ = registry.try_find_description() => { }
= note: this pattern will always match, so the guard is useless
= help: consider removing the guard and adding a `let` inside the match arm

error[E0507]: cannot move out of `*registry` which is behind a shared reference
--> $DIR/issue-88118-2.rs:7:33
|
LL | Registry if let _ = registry.try_find_description() => { }
| ^^^^^^^^ move occurs because `*registry` has type `Registry`, which does not implement the `Copy` trait

error: aborting due to previous error; 1 warning emitted
warning: 1 warning emitted

For more information about this error, try `rustc --explain E0507`.

0 comments on commit d0e2b60

Please sign in to comment.