diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-13 17:25:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-13 17:25:31 +0100 |
| commit | 5c9b227a3df48cff16a7f66957806db46caeeac8 (patch) | |
| tree | 9994cef76fa8b2d8b9d4d77bc90fca06842c8654 /compiler/rustc_ast/src/visit.rs | |
| parent | 9f6b07e2f5a1267c976a0f8a30dbea6e461a198e (diff) | |
| parent | b8c5a0f0eba036700775a33c924deaeeb34f3974 (diff) | |
| download | rust-5c9b227a3df48cff16a7f66957806db46caeeac8.tar.gz rust-5c9b227a3df48cff16a7f66957806db46caeeac8.zip | |
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
Diffstat (limited to 'compiler/rustc_ast/src/visit.rs')
| -rw-r--r-- | compiler/rustc_ast/src/visit.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index a6232b6dfaf..22db4438e31 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -522,6 +522,10 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) -> V::Result { walk_list!(visitor, visit_generic_param, generic_params); try_visit!(visitor.visit_fn_decl(decl)); } + TyKind::UnsafeBinder(binder) => { + walk_list!(visitor, visit_generic_param, &binder.generic_params); + try_visit!(visitor.visit_ty(&binder.inner_ty)); + } TyKind::Path(maybe_qself, path) => { try_visit!(visitor.visit_qself(maybe_qself)); try_visit!(visitor.visit_path(path, *id)); @@ -1226,6 +1230,10 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V ExprKind::TryBlock(body) => try_visit!(visitor.visit_block(body)), ExprKind::Lit(_token) => {} ExprKind::IncludedBytes(_bytes) => {} + ExprKind::UnsafeBinderCast(_kind, expr, ty) => { + try_visit!(visitor.visit_expr(expr)); + visit_opt!(visitor, visit_ty, ty); + } ExprKind::Err(_guar) => {} ExprKind::Dummy => {} } |
