Skip to content

Commit 1589759

Browse files
authored
Rollup merge of rust-lang#114022 - oli-obk:tait_ice_alias_field_projection, r=cjgillot
Perform OpaqueCast field projection on HIR, too. fixes rust-lang#105819 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). See rust-lang#99806 for when and why we added OpaqueCast to MIR.
2 parents d412b91 + d94d85f commit 1589759

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_utils/src/sugg.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,8 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
10111011
},
10121012
// note: unable to trigger `Subslice` kind in tests
10131013
ProjectionKind::Subslice => (),
1014+
// Doesn't have surface syntax. Only occurs in patterns.
1015+
ProjectionKind::OpaqueCast => (),
10141016
ProjectionKind::Deref => {
10151017
// Explicit derefs are typically handled later on, but
10161018
// some items do not need explicit deref, such as array accesses,

0 commit comments

Comments
 (0)