-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #83364 - sexxi-goose:fix-83176, r=nikomatsakis
2229 migration: Don't try resolve regions before writeback In the analysis use `resolve_vars_if_possible` instead of `fully_resolve`, because we might not have performed regionck yet. Fixes: #83176 r? `@nikomatsakis`
- Loading branch information
Showing
4 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// run-pass | ||
|
||
#![warn(disjoint_capture_drop_reorder)] | ||
|
||
fn main() { | ||
if let a = "" { | ||
//~^ WARNING: irrefutable `if let` pattern | ||
drop(|_: ()| drop(a)); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
warning: irrefutable `if let` pattern | ||
--> $DIR/issue-78720.rs:6:5 | ||
| | ||
LL | / if let a = "" { | ||
LL | | | ||
LL | | drop(|_: ()| drop(a)); | ||
LL | | } | ||
| |_____^ | ||
| | ||
= note: `#[warn(irrefutable_let_patterns)]` on by default | ||
= note: this pattern will always match, so the `if let` is useless | ||
= help: consider replacing the `if let` with a `let` | ||
|
||
warning: 1 warning emitted | ||
|