Skip to content

Commit 5ba37f3

Browse files
committed
chore: fix a few spans without .entered()
1 parent d07f024 commit 5ba37f3

6 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎crates/hir-ty/src/diagnostics/unsafe_check.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
};
1414

1515
pubfnmissing_unsafe(db:&dynHirDatabase,def:DefWithBodyId) -> Vec<ExprId>{
16-
let _p = tracing::span!(tracing::Level::INFO,"missing_unsafe",);
16+
let _p = tracing::span!(tracing::Level::INFO,"missing_unsafe").entered();
1717

1818
letmut res = Vec::new();
1919
let is_unsafe = match def {

‎crates/hir-ty/src/inhabitedness.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
// FIXME: Turn this into a query, it can be quite slow
1616
/// Checks whether a type is visibly uninhabited from a particular module.
1717
pub(crate)fnis_ty_uninhabited_from(db:&dynHirDatabase,ty:&Ty,target_mod:ModuleId) -> bool{
18-
let _p = tracing::span!(tracing::Level::INFO,"is_ty_uninhabited_from", ?ty);
18+
let _p = tracing::span!(tracing::Level::INFO,"is_ty_uninhabited_from", ?ty).entered();
1919
letmut uninhabited_from =
2020
UninhabitedFrom{ target_mod, db,max_depth:500,recursive_ty:FxHashSet::default()};
2121
let inhabitedness = ty.visit_with(&mut uninhabited_from,DebruijnIndex::INNERMOST);
@@ -30,7 +30,7 @@ pub(crate) fn is_enum_variant_uninhabited_from(
3030
subst:&Substitution,
3131
target_mod:ModuleId,
3232
) -> bool{
33-
let _p = tracing::span!(tracing::Level::INFO,"is_enum_variant_uninhabited_from",);
33+
let _p = tracing::span!(tracing::Level::INFO,"is_enum_variant_uninhabited_from").entered();
3434

3535
letmut uninhabited_from =
3636
UninhabitedFrom{ target_mod, db,max_depth:500,recursive_ty:FxHashSet::default()};

‎crates/hir/src/lib.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl Crate {
239239
db:&dynDefDatabase,
240240
query: import_map::Query,
241241
) -> implIterator<Item = Either<ModuleDef,Macro>>{
242-
let _p = tracing::span!(tracing::Level::INFO,"query_external_importables");
242+
let _p = tracing::span!(tracing::Level::INFO,"query_external_importables").entered();
243243
import_map::search_dependencies(db,self.into(),&query).into_iter().map(|item| {
244244
matchItemInNs::from(item){
245245
ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id),
@@ -548,7 +548,8 @@ impl Module {
548548
acc:&mutVec<AnyDiagnostic>,
549549
style_lints:bool,
550550
){
551-
let _p = tracing::span!(tracing::Level::INFO,"Module::diagnostics", name = ?self.name(db));
551+
let _p = tracing::span!(tracing::Level::INFO,"Module::diagnostics", name = ?self.name(db))
552+
.entered();
552553
let def_map = self.id.def_map(db.upcast());
553554
for diag in def_map.diagnostics(){
554555
if diag.in_module != self.id.local_id{
@@ -4494,7 +4495,7 @@ impl Type {
44944495
name:Option<&Name>,
44954496
mutcallback:implFnMut(Function) -> Option<T>,
44964497
) -> Option<T>{
4497-
let _p = tracing::span!(tracing::Level::INFO,"iterate_method_candidates");
4498+
let _p = tracing::span!(tracing::Level::INFO,"iterate_method_candidates").entered();
44984499
letmut slot = None;
44994500

45004501
self.iterate_method_candidates_dyn(
@@ -4582,7 +4583,7 @@ impl Type {
45824583
name:Option<&Name>,
45834584
mutcallback:implFnMut(AssocItem) -> Option<T>,
45844585
) -> Option<T>{
4585-
let _p = tracing::span!(tracing::Level::INFO,"iterate_path_candidates");
4586+
let _p = tracing::span!(tracing::Level::INFO,"iterate_path_candidates").entered();
45864587
letmut slot = None;
45874588
self.iterate_path_candidates_dyn(
45884589
db,
@@ -4649,15 +4650,15 @@ impl Type {
46494650
&'aself,
46504651
db:&'adynHirDatabase,
46514652
) -> implIterator<Item = Trait> + 'a{
4652-
let _p = tracing::span!(tracing::Level::INFO,"applicable_inherent_traits");
4653+
let _p = tracing::span!(tracing::Level::INFO,"applicable_inherent_traits").entered();
46534654
self.autoderef_(db)
46544655
.filter_map(|ty| ty.dyn_trait())
46554656
.flat_map(move |dyn_trait_id| hir_ty::all_super_traits(db.upcast(), dyn_trait_id))
46564657
.map(Trait::from)
46574658
}
46584659

46594660
pubfnenv_traits<'a>(&'aself,db:&'adynHirDatabase) -> implIterator<Item = Trait> + 'a{
4660-
let _p = tracing::span!(tracing::Level::INFO,"env_traits");
4661+
let _p = tracing::span!(tracing::Level::INFO,"env_traits").entered();
46614662
self.autoderef_(db)
46624663
.filter(|ty| matches!(ty.kind(Interner),TyKind::Placeholder(_)))
46634664
.flat_map(|ty| {

‎crates/hir/src/semantics.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ impl<'db> SemanticsImpl<'db> {
722722
muttoken:SyntaxToken,
723723
f:&mutdynFnMut(InFile<SyntaxToken>) -> ControlFlow<()>,
724724
){
725-
let _p = tracing::span!(tracing::Level::INFO,"descend_into_macros");
725+
let _p = tracing::span!(tracing::Level::INFO,"descend_into_macros").entered();
726726
let(sa, span, file_id) =
727727
match token.parent().and_then(|parent| self.analyze_no_infer(&parent)){
728728
Some(sa) => match sa.file_id.file_id(){
@@ -1359,7 +1359,7 @@ impl<'db> SemanticsImpl<'db> {
13591359
offset:Option<TextSize>,
13601360
infer_body:bool,
13611361
) -> Option<SourceAnalyzer>{
1362-
let _p = tracing::span!(tracing::Level::INFO,"Semantics::analyze_impl");
1362+
let _p = tracing::span!(tracing::Level::INFO,"Semantics::analyze_impl").entered();
13631363
let node = self.find_file(node);
13641364

13651365
let container = self.with_ctx(|ctx| ctx.find_container(node))?;

‎crates/hir/src/semantics/source_to_def.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub(super) struct SourceToDefCtx<'a, 'b> {
118118

119119
implSourceToDefCtx<'_,'_>{
120120
pub(super)fnfile_to_def(&self,file:FileId) -> SmallVec<[ModuleId;1]>{
121-
let _p = tracing::span!(tracing::Level::INFO,"SourceBinder::file_to_module_def");
121+
let _p = tracing::span!(tracing::Level::INFO,"SourceBinder::file_to_module_def").entered();
122122
letmut mods = SmallVec::new();
123123
for&crate_id inself.db.relevant_crates(file).iter(){
124124
// FIXME: inner items
@@ -133,7 +133,7 @@ impl SourceToDefCtx<'_, '_> {
133133
}
134134

135135
pub(super)fnmodule_to_def(&mutself,src:InFile<ast::Module>) -> Option<ModuleId>{
136-
let _p = tracing::span!(tracing::Level::INFO,"module_to_def");
136+
let _p = tracing::span!(tracing::Level::INFO,"module_to_def").entered();
137137
let parent_declaration = src
138138
.syntax()
139139
.ancestors_with_macros_skip_attr_item(self.db.upcast())
@@ -158,7 +158,7 @@ impl SourceToDefCtx<'_, '_> {
158158
}
159159

160160
pub(super)fnsource_file_to_def(&self,src:InFile<ast::SourceFile>) -> Option<ModuleId>{
161-
let _p = tracing::span!(tracing::Level::INFO,"source_file_to_def");
161+
let _p = tracing::span!(tracing::Level::INFO,"source_file_to_def").entered();
162162
let file_id = src.file_id.original_file(self.db.upcast());
163163
self.file_to_def(file_id).first().copied()
164164
}

‎crates/ide-assists/src/handlers/add_missing_impl_members.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn add_missing_impl_members_inner(
105105
assist_id:&'staticstr,
106106
label:&'staticstr,
107107
) -> Option<()>{
108-
let _p = tracing::span!(tracing::Level::INFO,"add_missing_impl_members_inner");
108+
let _p = tracing::span!(tracing::Level::INFO,"add_missing_impl_members_inner").entered();
109109
let impl_def = ctx.find_node_at_offset::<ast::Impl>()?;
110110
let impl_ = ctx.sema.to_def(&impl_def)?;
111111

0 commit comments

Comments
 (0)