diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-12 15:36:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-12 15:36:01 +0100 |
commit | 147547e7b85e80e2e30aa1a5ba4d9d0969908398 (patch) | |
tree | c39749d1b71b73b4017c2d0d848ebdc85e570c39 /crates/ra_hir_ty | |
parent | 6be5ab02008b442c85c201968b97f24f13c4692e (diff) | |
parent | 208b7bd7ba687fb570feb1b89219f14c63712ce8 (diff) |
Merge #5724
5724: Rename ra_prof -> profile
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/db.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/match_check.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lower.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/method_resolution.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 2 |
9 files changed, 13 insertions, 18 deletions
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml index 83397d579..380d5e601 100644 --- a/crates/ra_hir_ty/Cargo.toml +++ b/crates/ra_hir_ty/Cargo.toml | |||
@@ -20,9 +20,9 @@ stdx = { path = "../stdx" } | |||
20 | 20 | ||
21 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 21 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } |
22 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 22 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } |
23 | ra_arena = { path = "../ra_arena" } | 23 | arena = { path = "../arena" } |
24 | ra_db = { path = "../ra_db" } | 24 | ra_db = { path = "../ra_db" } |
25 | ra_prof = { path = "../ra_prof" } | 25 | profile = { path = "../profile" } |
26 | ra_syntax = { path = "../ra_syntax" } | 26 | ra_syntax = { path = "../ra_syntax" } |
27 | test_utils = { path = "../test_utils" } | 27 | test_utils = { path = "../test_utils" } |
28 | 28 | ||
diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs index c773adc67..7a28673b1 100644 --- a/crates/ra_hir_ty/src/db.rs +++ b/crates/ra_hir_ty/src/db.rs | |||
@@ -2,13 +2,12 @@ | |||
2 | 2 | ||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use arena::map::ArenaMap; | ||
5 | use hir_def::{ | 6 | use hir_def::{ |
6 | db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId, | 7 | db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId, |
7 | TypeParamId, VariantId, | 8 | TypeParamId, VariantId, |
8 | }; | 9 | }; |
9 | use ra_arena::map::ArenaMap; | ||
10 | use ra_db::{impl_intern_key, salsa, CrateId, Upcast}; | 10 | use ra_db::{impl_intern_key, salsa, CrateId, Upcast}; |
11 | use ra_prof::profile; | ||
12 | 11 | ||
13 | use crate::{ | 12 | use crate::{ |
14 | method_resolution::{InherentImpls, TraitImpls}, | 13 | method_resolution::{InherentImpls, TraitImpls}, |
@@ -123,7 +122,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> { | |||
123 | } | 122 | } |
124 | 123 | ||
125 | fn infer_wait(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { | 124 | fn infer_wait(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { |
126 | let _p = profile("infer:wait").detail(|| match def { | 125 | let _p = profile::span("infer:wait").detail(|| match def { |
127 | DefWithBodyId::FunctionId(it) => db.function_data(it).name.to_string(), | 126 | DefWithBodyId::FunctionId(it) => db.function_data(it).name.to_string(), |
128 | DefWithBodyId::StaticId(it) => { | 127 | DefWithBodyId::StaticId(it) => { |
129 | db.static_data(it).name.clone().unwrap_or_else(Name::missing).to_string() | 128 | db.static_data(it).name.clone().unwrap_or_else(Name::missing).to_string() |
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 7ab7f79db..55c02c1fe 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -8,7 +8,6 @@ use std::any::Any; | |||
8 | use hir_def::DefWithBodyId; | 8 | use hir_def::DefWithBodyId; |
9 | use hir_expand::diagnostics::{Diagnostic, DiagnosticSink}; | 9 | use hir_expand::diagnostics::{Diagnostic, DiagnosticSink}; |
10 | use hir_expand::{name::Name, HirFileId, InFile}; | 10 | use hir_expand::{name::Name, HirFileId, InFile}; |
11 | use ra_prof::profile; | ||
12 | use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; | 11 | use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; |
13 | use stdx::format_to; | 12 | use stdx::format_to; |
14 | 13 | ||
@@ -17,7 +16,7 @@ use crate::db::HirDatabase; | |||
17 | pub use crate::diagnostics::expr::{record_literal_missing_fields, record_pattern_missing_fields}; | 16 | pub use crate::diagnostics::expr::{record_literal_missing_fields, record_pattern_missing_fields}; |
18 | 17 | ||
19 | pub fn validate_body(db: &dyn HirDatabase, owner: DefWithBodyId, sink: &mut DiagnosticSink<'_>) { | 18 | pub fn validate_body(db: &dyn HirDatabase, owner: DefWithBodyId, sink: &mut DiagnosticSink<'_>) { |
20 | let _p = profile("validate_body"); | 19 | let _p = profile::span("validate_body"); |
21 | let infer = db.infer(owner); | 20 | let infer = db.infer(owner); |
22 | infer.add_diagnostics(db, owner, sink); | 21 | infer.add_diagnostics(db, owner, sink); |
23 | let mut validator = expr::ExprValidator::new(owner, infer.clone(), sink); | 22 | let mut validator = expr::ExprValidator::new(owner, infer.clone(), sink); |
diff --git a/crates/ra_hir_ty/src/diagnostics/match_check.rs b/crates/ra_hir_ty/src/diagnostics/match_check.rs index deca244db..7f007f1d6 100644 --- a/crates/ra_hir_ty/src/diagnostics/match_check.rs +++ b/crates/ra_hir_ty/src/diagnostics/match_check.rs | |||
@@ -218,13 +218,13 @@ | |||
218 | //! ``` | 218 | //! ``` |
219 | use std::sync::Arc; | 219 | use std::sync::Arc; |
220 | 220 | ||
221 | use arena::Idx; | ||
221 | use hir_def::{ | 222 | use hir_def::{ |
222 | adt::VariantData, | 223 | adt::VariantData, |
223 | body::Body, | 224 | body::Body, |
224 | expr::{Expr, Literal, Pat, PatId}, | 225 | expr::{Expr, Literal, Pat, PatId}, |
225 | AdtId, EnumVariantId, VariantId, | 226 | AdtId, EnumVariantId, VariantId, |
226 | }; | 227 | }; |
227 | use ra_arena::Idx; | ||
228 | use smallvec::{smallvec, SmallVec}; | 228 | use smallvec::{smallvec, SmallVec}; |
229 | 229 | ||
230 | use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; | 230 | use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; |
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 3d12039a6..784ae1c3c 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -18,6 +18,7 @@ use std::mem; | |||
18 | use std::ops::Index; | 18 | use std::ops::Index; |
19 | use std::sync::Arc; | 19 | use std::sync::Arc; |
20 | 20 | ||
21 | use arena::map::ArenaMap; | ||
21 | use hir_def::{ | 22 | use hir_def::{ |
22 | body::Body, | 23 | body::Body, |
23 | data::{ConstData, FunctionData, StaticData}, | 24 | data::{ConstData, FunctionData, StaticData}, |
@@ -30,8 +31,6 @@ use hir_def::{ | |||
30 | TypeAliasId, VariantId, | 31 | TypeAliasId, VariantId, |
31 | }; | 32 | }; |
32 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; | 33 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; |
33 | use ra_arena::map::ArenaMap; | ||
34 | use ra_prof::profile; | ||
35 | use ra_syntax::SmolStr; | 34 | use ra_syntax::SmolStr; |
36 | use rustc_hash::FxHashMap; | 35 | use rustc_hash::FxHashMap; |
37 | use stdx::impl_from; | 36 | use stdx::impl_from; |
@@ -64,7 +63,7 @@ mod coerce; | |||
64 | 63 | ||
65 | /// The entry point of type inference. | 64 | /// The entry point of type inference. |
66 | pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { | 65 | pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { |
67 | let _p = profile("infer_query"); | 66 | let _p = profile::span("infer_query"); |
68 | let resolver = def.resolver(db.upcast()); | 67 | let resolver = def.resolver(db.upcast()); |
69 | let mut ctx = InferenceContext::new(db, def, resolver); | 68 | let mut ctx = InferenceContext::new(db, def, resolver); |
70 | 69 | ||
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index 7638f167b..7b805fe7a 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs | |||
@@ -7,6 +7,7 @@ | |||
7 | //! This usually involves resolving names, collecting generic arguments etc. | 7 | //! This usually involves resolving names, collecting generic arguments etc. |
8 | use std::{iter, sync::Arc}; | 8 | use std::{iter, sync::Arc}; |
9 | 9 | ||
10 | use arena::map::ArenaMap; | ||
10 | use hir_def::{ | 11 | use hir_def::{ |
11 | adt::StructKind, | 12 | adt::StructKind, |
12 | builtin_type::BuiltinType, | 13 | builtin_type::BuiltinType, |
@@ -19,7 +20,6 @@ use hir_def::{ | |||
19 | UnionId, VariantId, | 20 | UnionId, VariantId, |
20 | }; | 21 | }; |
21 | use hir_expand::name::Name; | 22 | use hir_expand::name::Name; |
22 | use ra_arena::map::ArenaMap; | ||
23 | use ra_db::CrateId; | 23 | use ra_db::CrateId; |
24 | use smallvec::SmallVec; | 24 | use smallvec::SmallVec; |
25 | use stdx::impl_from; | 25 | use stdx::impl_from; |
diff --git a/crates/ra_hir_ty/src/method_resolution.rs b/crates/ra_hir_ty/src/method_resolution.rs index fb4b30a13..3b3bee6a7 100644 --- a/crates/ra_hir_ty/src/method_resolution.rs +++ b/crates/ra_hir_ty/src/method_resolution.rs | |||
@@ -13,7 +13,6 @@ use hir_def::{ | |||
13 | }; | 13 | }; |
14 | use hir_expand::name::Name; | 14 | use hir_expand::name::Name; |
15 | use ra_db::CrateId; | 15 | use ra_db::CrateId; |
16 | use ra_prof::profile; | ||
17 | use rustc_hash::{FxHashMap, FxHashSet}; | 16 | use rustc_hash::{FxHashMap, FxHashSet}; |
18 | 17 | ||
19 | use super::Substs; | 18 | use super::Substs; |
@@ -109,7 +108,7 @@ pub struct TraitImpls { | |||
109 | 108 | ||
110 | impl TraitImpls { | 109 | impl TraitImpls { |
111 | pub(crate) fn trait_impls_in_crate_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> { | 110 | pub(crate) fn trait_impls_in_crate_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> { |
112 | let _p = profile("trait_impls_in_crate_query"); | 111 | let _p = profile::span("trait_impls_in_crate_query"); |
113 | let mut impls = Self { map: FxHashMap::default() }; | 112 | let mut impls = Self { map: FxHashMap::default() }; |
114 | 113 | ||
115 | let crate_def_map = db.crate_def_map(krate); | 114 | let crate_def_map = db.crate_def_map(krate); |
@@ -135,7 +134,7 @@ impl TraitImpls { | |||
135 | } | 134 | } |
136 | 135 | ||
137 | pub(crate) fn trait_impls_in_deps_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> { | 136 | pub(crate) fn trait_impls_in_deps_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> { |
138 | let _p = profile("trait_impls_in_deps_query"); | 137 | let _p = profile::span("trait_impls_in_deps_query"); |
139 | let crate_graph = db.crate_graph(); | 138 | let crate_graph = db.crate_graph(); |
140 | let mut res = Self { map: FxHashMap::default() }; | 139 | let mut res = Self { map: FxHashMap::default() }; |
141 | 140 | ||
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 3f6d2cf35..2576a9dfc 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs | |||
@@ -5,7 +5,6 @@ use chalk_ir::cast::Cast; | |||
5 | use chalk_solve::Solver; | 5 | use chalk_solve::Solver; |
6 | use hir_def::{lang_item::LangItemTarget, TraitId}; | 6 | use hir_def::{lang_item::LangItemTarget, TraitId}; |
7 | use ra_db::CrateId; | 7 | use ra_db::CrateId; |
8 | use ra_prof::profile; | ||
9 | 8 | ||
10 | use crate::{db::HirDatabase, DebruijnIndex, Substs}; | 9 | use crate::{db::HirDatabase, DebruijnIndex, Substs}; |
11 | 10 | ||
@@ -125,7 +124,7 @@ pub(crate) fn trait_solve_query( | |||
125 | krate: CrateId, | 124 | krate: CrateId, |
126 | goal: Canonical<InEnvironment<Obligation>>, | 125 | goal: Canonical<InEnvironment<Obligation>>, |
127 | ) -> Option<Solution> { | 126 | ) -> Option<Solution> { |
128 | let _p = profile("trait_solve_query").detail(|| match &goal.value.value { | 127 | let _p = profile::span("trait_solve_query").detail(|| match &goal.value.value { |
129 | Obligation::Trait(it) => db.trait_data(it.trait_).name.to_string(), | 128 | Obligation::Trait(it) => db.trait_data(it.trait_).name.to_string(), |
130 | Obligation::Projection(_) => "projection".to_string(), | 129 | Obligation::Projection(_) => "projection".to_string(), |
131 | }); | 130 | }); |
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 1c7065364..3b6af5c9a 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -410,7 +410,7 @@ pub(crate) fn impl_datum_query( | |||
410 | krate: CrateId, | 410 | krate: CrateId, |
411 | impl_id: ImplId, | 411 | impl_id: ImplId, |
412 | ) -> Arc<ImplDatum> { | 412 | ) -> Arc<ImplDatum> { |
413 | let _p = ra_prof::profile("impl_datum"); | 413 | let _p = profile::span("impl_datum"); |
414 | debug!("impl_datum {:?}", impl_id); | 414 | debug!("impl_datum {:?}", impl_id); |
415 | let impl_: hir_def::ImplId = from_chalk(db, impl_id); | 415 | let impl_: hir_def::ImplId = from_chalk(db, impl_id); |
416 | impl_def_datum(db, krate, impl_id, impl_) | 416 | impl_def_datum(db, krate, impl_id, impl_) |