Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/diagnostics.rs')
| -rw-r--r-- | crates/hir/src/diagnostics.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs index 095b527cb0..082c29c174 100644 --- a/crates/hir/src/diagnostics.rs +++ b/crates/hir/src/diagnostics.rs @@ -112,6 +112,7 @@ diagnostics![AnyDiagnostic<'db> -> MissingLifetime, ElidedLifetimesInPath, TypeMustBeKnown<'db>, + UnionExprMustHaveExactlyOneField, ]; #[derive(Debug)] @@ -489,6 +490,11 @@ pub struct GenericDefaultRefersToSelf { } #[derive(Debug)] +pub struct UnionExprMustHaveExactlyOneField { + pub expr: InFile<ExprOrPatPtr>, +} + +#[derive(Debug)] pub struct InvalidLhsOfAssignment { pub lhs: InFile<AstPtr<Either<ast::Expr, ast::Pat>>>, } @@ -853,6 +859,10 @@ impl<'db> AnyDiagnostic<'db> { }); TypeMustBeKnown { at_point, top_term }.into() } + &InferenceDiagnostic::UnionExprMustHaveExactlyOneField { expr } => { + let expr = expr_syntax(expr)?; + UnionExprMustHaveExactlyOneField { expr }.into() + } }) } |