Skip to content

Commit ce0adf0

Browse files
authored
Rollup merge of rust-lang#141433 - compiler-errors:unsafe-binder-captures, r=oli-obk
Properly analyze captures from unsafe binders We need to represent the unsafe binder unwrap as an adjustment in HIR. Pretty straightforward b/c we already represent it as a projection elem in MIR. Fixes rust-lang#141418 Fixes rust-lang#141417 r? oli-obk
2 parents 09c50a4 + 6059d59 commit ce0adf0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_utils/src/sugg.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,8 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
941941
ProjectionKind::Subslice |
942942
// Doesn't have surface syntax. Only occurs in patterns.
943943
ProjectionKind::OpaqueCast => (),
944+
// Only occurs in closure captures.
945+
ProjectionKind::UnwrapUnsafeBinder => (),
944946
ProjectionKind::Deref => {
945947
// Explicit derefs are typically handled later on, but
946948
// some items do not need explicit deref, such as array accesses,

0 commit comments

Comments
 (0)