File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
rustc_mir_build/src/builder/expr Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ impl<'tcx> CapturedPlace<'tcx> {
117117 }
118118 } ,
119119
120+ HirProjectionKind :: UnwrapUnsafeBinder => {
121+ write ! ( & mut symbol, "__unwrap" ) . unwrap ( ) ;
122+ }
123+
120124 // Ignore derefs for now, as they are likely caused by
121125 // autoderefs that don't appear in the original code.
122126 HirProjectionKind :: Deref => { }
Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ fn convert_to_hir_projections_and_truncate_for_capture(
101101 variant = Some ( * idx) ;
102102 continue ;
103103 }
104+ ProjectionElem :: UnwrapUnsafeBinder ( _) => HirProjectionKind :: UnwrapUnsafeBinder ,
104105 // These do not affect anything, they just make sure we know the right type.
105106 ProjectionElem :: OpaqueCast ( _) | ProjectionElem :: Subtype ( ..) => continue ,
106107 ProjectionElem :: Index ( ..)
107108 | ProjectionElem :: ConstantIndex { .. }
108- | ProjectionElem :: Subslice { .. }
109- | ProjectionElem :: UnwrapUnsafeBinder ( _) => {
109+ | ProjectionElem :: Subslice { .. } => {
110110 // We don't capture array-access projections.
111111 // We can stop here as arrays are captured completely.
112112 break ;
Original file line number Diff line number Diff line change 1+ //@ revisions: e2015 e2021
2+ //@[e2015] edition: 2015
3+ //@[e2021] edition: 2021
14//@ check-pass
25
36#![ feature( unsafe_binders) ]
You can’t perform that action at this time.
0 commit comments