From 262b9c39824b58068d89d6c5cf53d8fea782b11c Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 23 Dec 2020 16:34:30 +0100 Subject: Track labels in the HIR --- crates/hir_def/src/body.rs | 24 ++++++++++- crates/hir_def/src/body/lower.rs | 92 ++++++++++++++++++++-------------------- crates/hir_def/src/expr.rs | 14 ++++-- 3 files changed, 78 insertions(+), 52 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/body.rs b/crates/hir_def/src/body.rs index 998b82601..d07004b9d 100644 --- a/crates/hir_def/src/body.rs +++ b/crates/hir_def/src/body.rs @@ -26,7 +26,7 @@ pub(crate) use lower::LowerCtx; use crate::{ attr::{Attrs, RawAttrs}, db::DefDatabase, - expr::{Expr, ExprId, Pat, PatId}, + expr::{Expr, ExprId, Label, LabelId, Pat, PatId}, item_scope::BuiltinShadowMode, item_scope::ItemScope, nameres::CrateDefMap, @@ -226,6 +226,7 @@ pub(crate) struct Mark { pub struct Body { pub exprs: Arena, pub pats: Arena, + pub labels: Arena