@@ -107,14 +107,16 @@ pub(crate) fn inlay_hints(
107
107
}
108
108
} ;
109
109
let mut preorder = file. preorder ( ) ;
110
- while let Some ( event) = preorder. next ( ) {
111
- if matches ! ( ( & event, range_limit) , ( WalkEvent :: Enter ( node) , Some ( range) ) if range. intersect( node. text_range( ) ) . is_none( ) )
112
- {
113
- preorder. skip_subtree ( ) ;
114
- continue ;
110
+ salsa:: attach ( sema. db , || {
111
+ while let Some ( event) = preorder. next ( ) {
112
+ if matches ! ( ( & event, range_limit) , ( WalkEvent :: Enter ( node) , Some ( range) ) if range. intersect( node. text_range( ) ) . is_none( ) )
113
+ {
114
+ preorder. skip_subtree ( ) ;
115
+ continue ;
116
+ }
117
+ hints ( event) ;
115
118
}
116
- hints ( event) ;
117
- }
119
+ } ) ;
118
120
if let Some ( range_limit) = range_limit {
119
121
acc. retain ( |hint| range_limit. contains_range ( hint. range ) ) ;
120
122
}
@@ -736,7 +738,7 @@ fn label_of_ty(
736
738
config : & InlayHintsConfig ,
737
739
display_target : DisplayTarget ,
738
740
) -> Result < ( ) , HirDisplayError > {
739
- let iter_item_type = salsa :: attach ( sema . db , || hint_iterator ( sema, famous_defs, ty) ) ;
741
+ let iter_item_type = hint_iterator ( sema, famous_defs, ty) ;
740
742
match iter_item_type {
741
743
Some ( ( iter_trait, item, ty) ) => {
742
744
const LABEL_START : & str = "impl " ;
0 commit comments