diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-04 19:20:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-04 19:20:01 +0200 |
| commit | a89eab9bca8b7efc37d386ff38d663035a5192de (patch) | |
| tree | a213e9209a8268ba71722f3f1e70e4db468ea317 /src/tools | |
| parent | 6c135561830a4126d1ce2c4767c8388b3c57bc86 (diff) | |
| parent | c29dc120e5e43a4757d8f7f20db35c61767fe987 (diff) | |
| download | rust-a89eab9bca8b7efc37d386ff38d663035a5192de.tar.gz rust-a89eab9bca8b7efc37d386ff38d663035a5192de.zip | |
Rollup merge of #83521 - sexxi-goose:quick-diagnostic-fix, r=nikomatsakis
2229: Fix diagnostic issue when using FakeReads in closures This PR fixes a diagnostic issue caused by https://github.com/rust-lang/rust/pull/82536. A temporary work around was used in this merged PR which involved feature gating the addition of FakeReads introduced as a result of pattern matching in closures. The fix involves adding an optional closure DefId to ForLet and ForMatchedPlace FakeReadCauses. This DefId will only be added if a closure pattern matches a Place starting with an Upvar. r? ```@nikomatsakis```
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index 1391f7505e2..dac4d93499d 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -212,7 +212,7 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen check_rvalue(tcx, body, def_id, rval, span) } - StatementKind::FakeRead(_, place) | + StatementKind::FakeRead(box (_, place)) => check_place(tcx, *place, span, body), // just an assignment StatementKind::SetDiscriminant { place, .. } => check_place(tcx, **place, span, body), |
