mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
internal: use cov-mark rather than bailing out diagnostic
This commit is contained in:
parent
b292e1b9da
commit
935c53b92e
5 changed files with 62 additions and 108 deletions
|
@ -3,8 +3,6 @@
|
|||
//!
|
||||
//! This probably isn't the best way to do this -- ideally, diagnistics should
|
||||
//! be expressed in terms of hir types themselves.
|
||||
use std::any::Any;
|
||||
|
||||
use cfg::{CfgExpr, CfgOptions};
|
||||
use either::Either;
|
||||
use hir_def::path::ModPath;
|
||||
|
@ -157,25 +155,4 @@ pub struct MissingMatchArms {
|
|||
pub arms: AstPtr<ast::MatchArmList>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct InternalBailedOut {
|
||||
pub file: HirFileId,
|
||||
pub pat_syntax_ptr: SyntaxNodePtr,
|
||||
}
|
||||
|
||||
impl Diagnostic for InternalBailedOut {
|
||||
fn code(&self) -> DiagnosticCode {
|
||||
DiagnosticCode("internal:match-check-bailed-out")
|
||||
}
|
||||
fn message(&self) -> String {
|
||||
format!("Internal: match check bailed out")
|
||||
}
|
||||
fn display_source(&self) -> InFile<SyntaxNodePtr> {
|
||||
InFile { file_id: self.file, value: self.pat_syntax_ptr.clone() }
|
||||
}
|
||||
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub use hir_ty::diagnostics::IncorrectCase;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue