mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-13 09:11:51 +00:00
Never make type mismatch diagnostic stable, even when there is a fix
We show fixes now even for experimental diagnostics anyway, and it has false positives.
This commit is contained in:
parent
2b0c726e1b
commit
b46593ece2
1 changed files with 2 additions and 6 deletions
|
|
@ -39,7 +39,7 @@ pub(crate) fn type_mismatch(ctx: &DiagnosticsContext<'_>, d: &hir::TypeMismatch<
|
||||||
cov_mark::hit!(type_mismatch_range_adjustment);
|
cov_mark::hit!(type_mismatch_range_adjustment);
|
||||||
Some(salient_token_range)
|
Some(salient_token_range)
|
||||||
});
|
});
|
||||||
let mut diag = Diagnostic::new(
|
Diagnostic::new(
|
||||||
DiagnosticCode::RustcHardError("E0308"),
|
DiagnosticCode::RustcHardError("E0308"),
|
||||||
format!(
|
format!(
|
||||||
"expected {}, found {}",
|
"expected {}, found {}",
|
||||||
|
|
@ -52,11 +52,7 @@ pub(crate) fn type_mismatch(ctx: &DiagnosticsContext<'_>, d: &hir::TypeMismatch<
|
||||||
),
|
),
|
||||||
display_range,
|
display_range,
|
||||||
)
|
)
|
||||||
.with_fixes(fixes(ctx, d));
|
.with_fixes(fixes(ctx, d))
|
||||||
if diag.fixes.is_some() {
|
|
||||||
diag.experimental = false;
|
|
||||||
}
|
|
||||||
diag
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::TypeMismatch<'_>) -> Option<Vec<Assist>> {
|
fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::TypeMismatch<'_>) -> Option<Vec<Assist>> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue