diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-24 21:18:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-24 21:18:01 +0100 |
commit | d7f1a53c6c1238828276a44866c2376588f435aa (patch) | |
tree | e41e3bc6ba72922d983ae8ae4db0ddc571925f5a /crates/ra_hir_ty/src | |
parent | 75e67ee74e5d3db5363732bb793b872c57408013 (diff) | |
parent | 92a4ec80a0ce1dd834578f53ea3fd018530ec0e6 (diff) |
Merge #5524
5524: Allow opting out of experimental diagnostics like MismatchedArgCount r=matklad a=jonas-schievink
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5448
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5419
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index d3ee9cf55..885abbaf2 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -234,6 +234,9 @@ impl Diagnostic for MismatchedArgCount { | |||
234 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 234 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
235 | self | 235 | self |
236 | } | 236 | } |
237 | fn is_experimental(&self) -> bool { | ||
238 | true | ||
239 | } | ||
237 | } | 240 | } |
238 | 241 | ||
239 | impl AstDiagnostic for MismatchedArgCount { | 242 | impl AstDiagnostic for MismatchedArgCount { |
@@ -248,7 +251,7 @@ impl AstDiagnostic for MismatchedArgCount { | |||
248 | #[cfg(test)] | 251 | #[cfg(test)] |
249 | mod tests { | 252 | mod tests { |
250 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId}; | 253 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId}; |
251 | use hir_expand::diagnostics::{Diagnostic, DiagnosticSink}; | 254 | use hir_expand::diagnostics::{Diagnostic, DiagnosticSinkBuilder}; |
252 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt}; | 255 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt}; |
253 | use ra_syntax::{TextRange, TextSize}; | 256 | use ra_syntax::{TextRange, TextSize}; |
254 | use rustc_hash::FxHashMap; | 257 | use rustc_hash::FxHashMap; |
@@ -280,7 +283,7 @@ mod tests { | |||
280 | } | 283 | } |
281 | 284 | ||
282 | for f in fns { | 285 | for f in fns { |
283 | let mut sink = DiagnosticSink::new(&mut cb); | 286 | let mut sink = DiagnosticSinkBuilder::new().build(&mut cb); |
284 | validate_body(self, f.into(), &mut sink); | 287 | validate_body(self, f.into(), &mut sink); |
285 | } | 288 | } |
286 | } | 289 | } |