File tree 2 files changed +5
-9
lines changed
src/test/ui/closures/2229_closure_analysis
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
// edition:2021
2
+ // run-pass
2
3
#![ feature( if_let_guard) ]
4
+ #[ allow( unused_must_use) ]
5
+ #[ allow( dead_code) ]
3
6
4
7
fn print_error_count ( registry : & Registry ) {
5
8
|x : & Registry | {
Original file line number Diff line number Diff line change 1
1
warning: irrefutable `if let` guard pattern
2
- --> $DIR/issue-88118-2.rs:7 :29
2
+ --> $DIR/issue-88118-2.rs:10 :29
3
3
|
4
4
LL | Registry if let _ = registry.try_find_description() => { }
5
5
| ^
@@ -8,12 +8,5 @@ LL | Registry if let _ = registry.try_find_description() => { }
8
8
= note: this pattern will always match, so the guard is useless
9
9
= help: consider removing the guard and adding a `let` inside the match arm
10
10
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
18
12
19
- For more information about this error, try `rustc --explain E0507`.
You can’t perform that action at this time.
0 commit comments