Skip to content

Commit

Permalink
Perform OpaqueCast field projection on HIR, too.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
oli-obk committed Jul 24, 2023
1 parent 5a6c4d7 commit d94d85f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d94d85f

Please sign in to comment.