@@ -107,14 +107,16 @@ pub(crate) fn inlay_hints(
107107 }
108108 } ;
109109 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) ;
115118 }
116- hints ( event) ;
117- }
119+ } ) ;
118120 if let Some ( range_limit) = range_limit {
119121 acc. retain ( |hint| range_limit. contains_range ( hint. range ) ) ;
120122 }
@@ -736,7 +738,7 @@ fn label_of_ty(
736738 config : & InlayHintsConfig ,
737739 display_target : DisplayTarget ,
738740 ) -> 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) ;
740742 match iter_item_type {
741743 Some ( ( iter_trait, item, ty) ) => {
742744 const LABEL_START : & str = "impl " ;
0 commit comments