mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Diagnose value breaks in incorrect breakables
This commit is contained in:
parent
02eb2d758e
commit
41f234df09
5 changed files with 70 additions and 37 deletions
|
@ -167,7 +167,8 @@ pub enum InferenceDiagnostic {
|
|||
NoSuchField { expr: ExprId },
|
||||
PrivateField { expr: ExprId, field: FieldId },
|
||||
PrivateAssocItem { id: ExprOrPatId, item: AssocItemId },
|
||||
BreakOutsideOfLoop { expr: ExprId, is_break: bool },
|
||||
// FIXME: Make this proper
|
||||
BreakOutsideOfLoop { expr: ExprId, is_break: bool, bad_value_break: bool },
|
||||
MismatchedArgCount { call_expr: ExprId, expected: usize, found: usize },
|
||||
}
|
||||
|
||||
|
@ -411,7 +412,7 @@ struct BreakableContext {
|
|||
/// Whether this context contains at least one break expression.
|
||||
may_break: bool,
|
||||
/// The coercion target of the context.
|
||||
coerce: CoerceMany,
|
||||
coerce: Option<CoerceMany>,
|
||||
/// The optional label of the context.
|
||||
label: Option<name::Name>,
|
||||
kind: BreakableKind,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue