@@ -1716,7 +1716,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
17161716 // So it's safe to skip these.
17171717 ProjectionElem :: OpaqueCast ( _)
17181718 | ProjectionElem :: Subtype ( _)
1719- | ProjectionElem :: Downcast ( _, _) => ( ) ,
1719+ | ProjectionElem :: Downcast ( _, _)
1720+ | ProjectionElem :: UnsafeBinderCast ( _, _) => ( ) ,
17201721 }
17211722
17221723 place_ty = place_ty. projection_ty ( tcx, elem) ;
@@ -1944,7 +1945,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
19441945 ProjectionElem :: OpaqueCast ( _) |
19451946 ProjectionElem :: ConstantIndex { .. } |
19461947 // assigning to P[i] requires P to be valid.
1947- ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) =>
1948+ ProjectionElem :: Downcast ( _/*adt_def*/ , _/*variant_idx*/ ) |
1949+ ProjectionElem :: UnsafeBinderCast ( ..) =>
19481950 // assigning to (P->variant) is okay if assigning to `P` is okay
19491951 //
19501952 // FIXME: is this true even if P is an adt with a dtor?
@@ -2330,7 +2332,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
23302332 | ProjectionElem :: Subslice { .. }
23312333 | ProjectionElem :: Subtype ( ..)
23322334 | ProjectionElem :: OpaqueCast { .. }
2333- | ProjectionElem :: Downcast ( ..) => {
2335+ | ProjectionElem :: Downcast ( ..)
2336+ | ProjectionElem :: UnsafeBinderCast ( ..) => {
23342337 let upvar_field_projection = self . is_upvar_field_projection ( place) ;
23352338 if let Some ( field) = upvar_field_projection {
23362339 let upvar = & self . upvars [ field. index ( ) ] ;
0 commit comments