Add reference here diagnostic

This commit is contained in:
ivan770 2021-08-08 10:12:40 +02:00
parent a9f115b36f
commit be3e70c604
No known key found for this signature in database
GPG key ID: D8C4BD5AE4D9CC4D
5 changed files with 231 additions and 5 deletions

View file

@ -5,7 +5,7 @@
//! be expressed in terms of hir types themselves.
use cfg::{CfgExpr, CfgOptions};
use either::Either;
use hir_def::path::ModPath;
use hir_def::{path::ModPath, type_ref::Mutability};
use hir_expand::{name::Name, HirFileId, InFile};
use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
@ -28,6 +28,7 @@ macro_rules! diagnostics {
}
diagnostics![
AddReferenceHere,
BreakOutsideOfLoop,
InactiveCode,
IncorrectCase,
@ -154,4 +155,10 @@ pub struct MissingMatchArms {
pub arms: AstPtr<ast::MatchArmList>,
}
#[derive(Debug)]
pub struct AddReferenceHere {
pub expr: InFile<AstPtr<ast::Expr>>,
pub mutability: Mutability,
}
pub use hir_ty::diagnostics::IncorrectCase;