Skip to content

Commit d0e2b60

Browse files
committed
Fix test
1 parent 8701020 commit d0e2b60

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/test/ui/closures/2229_closure_analysis/issue-88118-2.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// edition:2021
2+
// run-pass
23
#![feature(if_let_guard)]
4+
#[allow(unused_must_use)]
5+
#[allow(dead_code)]
36

47
fn print_error_count(registry: &Registry) {
58
|x: &Registry| {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: irrefutable `if let` guard pattern
2-
--> $DIR/issue-88118-2.rs:7:29
2+
--> $DIR/issue-88118-2.rs:10:29
33
|
44
LL | Registry if let _ = registry.try_find_description() => { }
55
| ^
@@ -8,12 +8,5 @@ LL | Registry if let _ = registry.try_find_description() => { }
88
= note: this pattern will always match, so the guard is useless
99
= help: consider removing the guard and adding a `let` inside the match arm
1010

11-
error[E0507]: cannot move out of `*registry` which is behind a shared reference
12-
--> $DIR/issue-88118-2.rs:7:33
13-
|
14-
LL | Registry if let _ = registry.try_find_description() => { }
15-
| ^^^^^^^^ move occurs because `*registry` has type `Registry`, which does not implement the `Copy` trait
16-
17-
error: aborting due to previous error; 1 warning emitted
11+
warning: 1 warning emitted
1812

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

0 commit comments

Comments
 (0)