mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
chore: Prefer tracing span shorthand macros
This commit is contained in:
parent
5f3de7863a
commit
27182bb96b
82 changed files with 240 additions and 275 deletions
|
@ -144,8 +144,7 @@ pub struct TraitImpls {
|
|||
|
||||
impl TraitImpls {
|
||||
pub(crate) fn trait_impls_in_crate_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> {
|
||||
let _p =
|
||||
tracing::span!(tracing::Level::INFO, "trait_impls_in_crate_query", ?krate).entered();
|
||||
let _p = tracing::info_span!("trait_impls_in_crate_query", ?krate).entered();
|
||||
let mut impls = FxHashMap::default();
|
||||
|
||||
Self::collect_def_map(db, &mut impls, &db.crate_def_map(krate));
|
||||
|
@ -157,7 +156,7 @@ impl TraitImpls {
|
|||
db: &dyn HirDatabase,
|
||||
block: BlockId,
|
||||
) -> Option<Arc<Self>> {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "trait_impls_in_block_query").entered();
|
||||
let _p = tracing::info_span!("trait_impls_in_block_query").entered();
|
||||
let mut impls = FxHashMap::default();
|
||||
|
||||
Self::collect_def_map(db, &mut impls, &db.block_def_map(block));
|
||||
|
@ -173,8 +172,7 @@ impl TraitImpls {
|
|||
db: &dyn HirDatabase,
|
||||
krate: CrateId,
|
||||
) -> Arc<[Arc<Self>]> {
|
||||
let _p =
|
||||
tracing::span!(tracing::Level::INFO, "trait_impls_in_deps_query", ?krate).entered();
|
||||
let _p = tracing::info_span!("trait_impls_in_deps_query", ?krate).entered();
|
||||
let crate_graph = db.crate_graph();
|
||||
|
||||
Arc::from_iter(
|
||||
|
@ -280,8 +278,7 @@ pub struct InherentImpls {
|
|||
|
||||
impl InherentImpls {
|
||||
pub(crate) fn inherent_impls_in_crate_query(db: &dyn HirDatabase, krate: CrateId) -> Arc<Self> {
|
||||
let _p =
|
||||
tracing::span!(tracing::Level::INFO, "inherent_impls_in_crate_query", ?krate).entered();
|
||||
let _p = tracing::info_span!("inherent_impls_in_crate_query", ?krate).entered();
|
||||
let mut impls = Self { map: FxHashMap::default(), invalid_impls: Vec::default() };
|
||||
|
||||
let crate_def_map = db.crate_def_map(krate);
|
||||
|
@ -295,7 +292,7 @@ impl InherentImpls {
|
|||
db: &dyn HirDatabase,
|
||||
block: BlockId,
|
||||
) -> Option<Arc<Self>> {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "inherent_impls_in_block_query").entered();
|
||||
let _p = tracing::info_span!("inherent_impls_in_block_query").entered();
|
||||
let mut impls = Self { map: FxHashMap::default(), invalid_impls: Vec::default() };
|
||||
|
||||
let block_def_map = db.block_def_map(block);
|
||||
|
@ -368,7 +365,7 @@ pub(crate) fn incoherent_inherent_impl_crates(
|
|||
krate: CrateId,
|
||||
fp: TyFingerprint,
|
||||
) -> SmallVec<[CrateId; 2]> {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "incoherent_inherent_impl_crates").entered();
|
||||
let _p = tracing::info_span!("incoherent_inherent_impl_crates").entered();
|
||||
let mut res = SmallVec::new();
|
||||
let crate_graph = db.crate_graph();
|
||||
|
||||
|
@ -937,8 +934,7 @@ pub fn iterate_method_candidates_dyn(
|
|||
mode: LookupMode,
|
||||
callback: &mut dyn FnMut(ReceiverAdjustments, AssocItemId, bool) -> ControlFlow<()>,
|
||||
) -> ControlFlow<()> {
|
||||
let _p = tracing::span!(
|
||||
tracing::Level::INFO,
|
||||
let _p = tracing::info_span!(
|
||||
"iterate_method_candidates_dyn",
|
||||
?mode,
|
||||
?name,
|
||||
|
@ -1504,7 +1500,7 @@ fn is_valid_impl_fn_candidate(
|
|||
}
|
||||
}
|
||||
table.run_in_snapshot(|table| {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "subst_for_def").entered();
|
||||
let _p = tracing::info_span!("subst_for_def").entered();
|
||||
let impl_subst =
|
||||
TyBuilder::subst_for_def(db, impl_id, None).fill_with_inference_vars(table).build();
|
||||
let expect_self_ty = db.impl_self_ty(impl_id).substitute(Interner, &impl_subst);
|
||||
|
@ -1512,7 +1508,7 @@ fn is_valid_impl_fn_candidate(
|
|||
check_that!(table.unify(&expect_self_ty, self_ty));
|
||||
|
||||
if let Some(receiver_ty) = receiver_ty {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "check_receiver_ty").entered();
|
||||
let _p = tracing::info_span!("check_receiver_ty").entered();
|
||||
check_that!(data.has_self_param());
|
||||
|
||||
let fn_subst = TyBuilder::subst_for_def(db, fn_id, Some(impl_subst.clone()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue