diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-24 14:47:32 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-24 15:19:26 +0000 |
| commit | e390dc9c36448ca033aad48a6e7fd5ecc3f038d2 (patch) | |
| tree | 5575c1bc21075ea6bb4e40876db1f475ae70cb38 /src/tools/clippy | |
| parent | d14569bd64e468bb08472f4885b4796ba8354474 (diff) | |
| download | rust-e390dc9c36448ca033aad48a6e7fd5ecc3f038d2.tar.gz rust-e390dc9c36448ca033aad48a6e7fd5ecc3f038d2.zip | |
Perform OpaqueCast field projection on HIR, too.
This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).
Diffstat (limited to 'src/tools/clippy')
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/sugg.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/clippy/clippy_utils/src/sugg.rs b/src/tools/clippy/clippy_utils/src/sugg.rs index 5d7e1494fcf..a43a81bc63a 100644 --- a/src/tools/clippy/clippy_utils/src/sugg.rs +++ b/src/tools/clippy/clippy_utils/src/sugg.rs @@ -1011,6 +1011,8 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> { }, // note: unable to trigger `Subslice` kind in tests ProjectionKind::Subslice => (), + // Doesn't have surface syntax. Only occurs in patterns. + ProjectionKind::OpaqueCast => (), ProjectionKind::Deref => { // Explicit derefs are typically handled later on, but // some items do not need explicit deref, such as array accesses, |
