1
Fork 0

Rollup merge of #134140 - compiler-errors:unsafe-binders-ast, r=oli-obk

Add AST support for unsafe binders

I'm splitting up #130514 into pieces. It's impossible for me to keep up with a huge PR like that. I'll land type system support for this next, probably w/o MIR lowering, which will come later.

r? `@oli-obk`
cc `@BoxyUwU` and `@lcnr` who also may want to look at this, though this PR doesn't do too much yet
This commit is contained in:
Matthias Krüger 2024-12-13 17:25:31 +01:00 committed by GitHub
commit 5c9b227a3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 616 additions and 18 deletions

View file

@ -192,6 +192,8 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool {
| ExprKind::DropTemps(..)
| ExprKind::Let(..) => false,
ExprKind::UnsafeBinderCast(..) => false,
// Not applicable
ExprKind::Type(..) | ExprKind::Err(..) => false,
}

View file

@ -422,6 +422,7 @@ impl<'tcx, 'a> Visitor<'tcx> for FindSignificantDropper<'tcx, 'a> {
hir::ExprKind::Unary(_, expr)
| hir::ExprKind::Cast(expr, _)
| hir::ExprKind::Type(expr, _)
| hir::ExprKind::UnsafeBinderCast(_, expr, _)
| hir::ExprKind::Yield(expr, _)
| hir::ExprKind::AddrOf(_, _, expr)
| hir::ExprKind::Match(expr, _, _)