Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk

Begin to implement type system layer of unsafe binders

Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic.

r? oli-obk

Tracking:

- https://github.com/rust-lang/rust/issues/130516
This commit is contained in:
bors
2024-12-24 00:51:51 +00:00
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -877,7 +877,8 @@ fn for_mir_ty<'tcx>(tcx: TyCtxt<'tcx>, def_site_def_id: Option<DefId>, ty: Ty<'t
| ty::CoroutineClosure(..)
| ty::Never
| ty::Tuple(_)
| ty::Alias(ty::Projection, _) => Self::Deref,
| ty::Alias(ty::Projection, _)
| ty::UnsafeBinder(_) => Self::Deref,
};
}
}
+3 -1
View File
@@ -677,6 +677,9 @@ fn helper<'tcx, B>(
ExprKind::Type(e, _) => {
helper(typeck, consume, e, f)?;
},
ExprKind::UnsafeBinderCast(_, e, _) => {
helper(typeck, consume, e, f)?;
},
// Either drops temporaries, jumps out of the current expression, or has no sub expression.
ExprKind::DropTemps(_)
@@ -694,7 +697,6 @@ fn helper<'tcx, B>(
| ExprKind::Continue(_)
| ExprKind::InlineAsm(_)
| ExprKind::OffsetOf(..)
| ExprKind::UnsafeBinderCast(..)
| ExprKind::Err(_) => (),
}
ControlFlow::Continue(())