Wrap inner tail expressions in MissingOkOrSomeInTailExpr

This commit is contained in:
Lukas Wirth 2021-07-31 20:00:09 +02:00
parent eb513c22f7
commit 1edbaa29f9
8 changed files with 69 additions and 11 deletions

View file

@ -9,6 +9,8 @@ use hir_def::path::ModPath;
use hir_expand::{name::Name, HirFileId, InFile};
use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
use crate::Type;
macro_rules! diagnostics {
($($diag:ident,)*) => {
pub enum AnyDiagnostic {$(
@ -142,6 +144,7 @@ pub struct MissingOkOrSomeInTailExpr {
pub expr: InFile<AstPtr<ast::Expr>>,
// `Some` or `Ok` depending on whether the return type is Result or Option
pub required: String,
pub expected: Type,
}
#[derive(Debug)]