internal: Resolve labels in body lowering

This commit is contained in:
Lukas Wirth 2023-04-06 12:50:16 +02:00
parent e9e57725aa
commit 0e7117900c
13 changed files with 420 additions and 182 deletions

View file

@ -32,7 +32,6 @@ macro_rules! diagnostics {
}
diagnostics![
BreakOutsideOfLoop,
ExpectedFunction,
InactiveCode,
IncorrectCase,
@ -50,7 +49,9 @@ diagnostics![
PrivateField,
ReplaceFilterMapNextWithFindMap,
TypeMismatch,
UndeclaredLabel,
UnimplementedBuiltinMacro,
UnreachableLabel,
UnresolvedExternCrate,
UnresolvedField,
UnresolvedImport,
@ -84,6 +85,17 @@ pub struct UnresolvedMacroCall {
pub path: ModPath,
pub is_bang: bool,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct UnreachableLabel {
pub node: InFile<AstPtr<ast::Lifetime>>,
pub name: Name,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct UndeclaredLabel {
pub node: InFile<AstPtr<ast::Lifetime>>,
pub name: Name,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct InactiveCode {
@ -166,13 +178,6 @@ pub struct PrivateField {
pub field: Field,
}
#[derive(Debug)]
pub struct BreakOutsideOfLoop {
pub expr: InFile<AstPtr<ast::Expr>>,
pub is_break: bool,
pub bad_value_break: bool,
}
#[derive(Debug)]
pub struct MissingUnsafe {
pub expr: InFile<AstPtr<ast::Expr>>,