@@ -1728,7 +1728,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
17281728 // So it's safe to skip these.
17291729 ProjectionElem :: OpaqueCast ( _)
17301730 | ProjectionElem :: Subtype ( _)
1731- | ProjectionElem :: Downcast ( _, _) => ( ) ,
1731+ | ProjectionElem :: Downcast ( _, _)
1732+ | ProjectionElem :: UnsafeBinderCast ( _, _) => ( ) ,
17321733 }
17331734
17341735 place_ty = place_ty. projection_ty ( tcx, elem) ;
@@ -1956,7 +1957,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
19561957 ProjectionElem :: OpaqueCast ( _) |
19571958 ProjectionElem :: ConstantIndex { .. } |
19581959 // assigning to P[i] requires P to be valid.
1959- ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) =>
1960+ ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) |
1961+ ProjectionElem :: UnsafeBinderCast ( ..) =>
19601962 // assigning to (P->variant) is okay if assigning to `P` is okay
19611963 //
19621964 // FIXME: is this true even if P is an adt with a dtor?
@@ -2345,7 +2347,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
23452347 | ProjectionElem :: Subslice { .. }
23462348 | ProjectionElem :: Subtype ( ..)
23472349 | ProjectionElem :: OpaqueCast { .. }
2348- | ProjectionElem :: Downcast ( ..) => {
2350+ | ProjectionElem :: Downcast ( ..)
2351+ | ProjectionElem :: UnsafeBinderCast ( ..) => {
23492352 let upvar_field_projection = self . is_upvar_field_projection ( place) ;
23502353 if let Some ( field) = upvar_field_projection {
23512354 let upvar = & self . upvars [ field. index ( ) ] ;
0 commit comments