From fcca35969dd7c63a83ee34c4ce7d54cefdb72bbe Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 23 Mar 2019 16:28:47 +0300 Subject: allow dyn diagnostics --- crates/ra_hir/src/code_model_api.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/code_model_api.rs') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 58481e715..a37d960a1 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -17,7 +17,7 @@ use crate::{ ids::{FunctionId, StructId, EnumId, AstItemDef, ConstId, StaticId, TraitId, TypeId}, impl_block::ImplBlock, resolve::Resolver, - diagnostics::FunctionDiagnostic, + diagnostics::Diagnostics, }; /// hir::Crate describes a single crate. It's the main interface with which @@ -521,8 +521,10 @@ impl Function { r } - pub fn diagnostics(&self, db: &impl HirDatabase) -> Vec { - self.infer(db).diagnostics() + pub fn diagnostics(&self, db: &impl HirDatabase) -> Diagnostics { + let mut res = Diagnostics::default(); + self.infer(db).add_diagnostics(db, *self, &mut res); + res } } -- cgit v1.2.3