diff --git a/crates/hir-def/src/adt.rs b/crates/hir-def/src/adt.rs index af8ca8571ba..938db032fbc 100644 --- a/crates/hir-def/src/adt.rs +++ b/crates/hir-def/src/adt.rs @@ -151,7 +151,7 @@ pub(crate) fn struct_data_query(db: &dyn DefDatabase, id: StructId) -> Arc (Arc, Arc>) { + ) -> (Arc, Arc<[DefDiagnostic]>) { let loc = id.lookup(db); let krate = loc.container.krate; let item_tree = loc.id.item_tree(db); @@ -176,7 +176,7 @@ pub(crate) fn struct_data_with_diagnostics_query( repr, visibility: item_tree[strukt.visibility].clone(), }), - Arc::new(diagnostics), + diagnostics.into(), ) } @@ -187,7 +187,7 @@ pub(crate) fn union_data_query(db: &dyn DefDatabase, id: UnionId) -> Arc (Arc, Arc>) { + ) -> (Arc, Arc<[DefDiagnostic]>) { let loc = id.lookup(db); let krate = loc.container.krate; let item_tree = loc.id.item_tree(db); @@ -212,7 +212,7 @@ pub(crate) fn union_data_with_diagnostics_query( repr, visibility: item_tree[union.visibility].clone(), }), - Arc::new(diagnostics), + diagnostics.into(), ) } } @@ -225,7 +225,7 @@ pub(crate) fn enum_data_query(db: &dyn DefDatabase, e: EnumId) -> Arc pub(crate) fn enum_data_with_diagnostics_query( db: &dyn DefDatabase, e: EnumId, - ) -> (Arc, Arc>) { + ) -> (Arc, Arc<[DefDiagnostic]>) { let loc = e.lookup(db); let krate = loc.container.krate; let item_tree = loc.id.item_tree(db); @@ -272,7 +272,7 @@ pub(crate) fn enum_data_with_diagnostics_query( repr, visibility: item_tree[enum_.visibility].clone(), }), - Arc::new(diagnostics), + diagnostics.into(), ) } diff --git a/crates/hir-def/src/data.rs b/crates/hir-def/src/data.rs index 631ae3cf11f..2dc69b00ace 100644 --- a/crates/hir-def/src/data.rs +++ b/crates/hir-def/src/data.rs @@ -219,7 +219,7 @@ pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc (Arc, Arc>) { + ) -> (Arc, Arc<[DefDiagnostic]>) { let tr_loc @ ItemLoc { container: module_id, id: tree_id } = tr.lookup(db); let item_tree = tree_id.item_tree(db); let tr_def = &item_tree[tree_id.value]; @@ -251,7 +251,7 @@ pub(crate) fn trait_data_with_diagnostics_query( visibility, skip_array_during_method_dispatch, }), - Arc::new(diagnostics), + diagnostics.into(), ) } @@ -299,7 +299,7 @@ pub(crate) fn impl_data_query(db: &dyn DefDatabase, id: ImplId) -> Arc pub(crate) fn impl_data_with_diagnostics_query( db: &dyn DefDatabase, id: ImplId, - ) -> (Arc, Arc>) { + ) -> (Arc, Arc<[DefDiagnostic]>) { let _p = profile::span("impl_data_with_diagnostics_query"); let ItemLoc { container: module_id, id: tree_id } = id.lookup(db); @@ -318,7 +318,7 @@ pub(crate) fn impl_data_with_diagnostics_query( ( Arc::new(ImplData { target_trait, self_ty, items, is_negative, attribute_calls }), - Arc::new(diagnostics), + diagnostics.into(), ) } diff --git a/crates/hir-def/src/db.rs b/crates/hir-def/src/db.rs index 93ffe29a1fe..431c8255497 100644 --- a/crates/hir-def/src/db.rs +++ b/crates/hir-def/src/db.rs @@ -98,38 +98,32 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast { fn struct_data(&self, id: StructId) -> Arc; #[salsa::invoke(StructData::struct_data_with_diagnostics_query)] - fn struct_data_with_diagnostics( - &self, - id: StructId, - ) -> (Arc, Arc>); + fn struct_data_with_diagnostics(&self, id: StructId) + -> (Arc, Arc<[DefDiagnostic]>); #[salsa::invoke(StructData::union_data_query)] fn union_data(&self, id: UnionId) -> Arc; #[salsa::invoke(StructData::union_data_with_diagnostics_query)] - fn union_data_with_diagnostics( - &self, - id: UnionId, - ) -> (Arc, Arc>); + fn union_data_with_diagnostics(&self, id: UnionId) -> (Arc, Arc<[DefDiagnostic]>); #[salsa::invoke(EnumData::enum_data_query)] fn enum_data(&self, e: EnumId) -> Arc; #[salsa::invoke(EnumData::enum_data_with_diagnostics_query)] - fn enum_data_with_diagnostics(&self, e: EnumId) -> (Arc, Arc>); + fn enum_data_with_diagnostics(&self, e: EnumId) -> (Arc, Arc<[DefDiagnostic]>); #[salsa::invoke(ImplData::impl_data_query)] fn impl_data(&self, e: ImplId) -> Arc; #[salsa::invoke(ImplData::impl_data_with_diagnostics_query)] - fn impl_data_with_diagnostics(&self, e: ImplId) -> (Arc, Arc>); + fn impl_data_with_diagnostics(&self, e: ImplId) -> (Arc, Arc<[DefDiagnostic]>); #[salsa::invoke(TraitData::trait_data_query)] fn trait_data(&self, e: TraitId) -> Arc; #[salsa::invoke(TraitData::trait_data_with_diagnostics_query)] - fn trait_data_with_diagnostics(&self, tr: TraitId) - -> (Arc, Arc>); + fn trait_data_with_diagnostics(&self, tr: TraitId) -> (Arc, Arc<[DefDiagnostic]>); #[salsa::invoke(TypeAliasData::type_alias_data_query)] fn type_alias_data(&self, e: TypeAliasId) -> Arc;