File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/tools/rust-analyzer/crates/ide/src/inlay_hints Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,12 @@ pub(super) fn hints(
1717 let parent = path. syntax ( ) . parent ( ) ?;
1818 let range = match path {
1919 Either :: Left ( path) => {
20- let paren =
21- parent. ancestors ( ) . take_while ( |it| ast:: ParenType :: can_cast ( it. kind ( ) ) ) . last ( ) ;
20+ let paren = parent
21+ . ancestors ( )
22+ . take_while ( |it| {
23+ ast:: ParenType :: can_cast ( it. kind ( ) ) || ast:: ForType :: can_cast ( it. kind ( ) )
24+ } )
25+ . last ( ) ;
2226 let parent = paren. as_ref ( ) . and_then ( |it| it. parent ( ) ) . unwrap_or ( parent) ;
2327 if ast:: TypeBound :: can_cast ( parent. kind ( ) )
2428 || ast:: TypeAnchor :: can_cast ( parent. kind ( ) )
@@ -136,4 +140,15 @@ fn foo(
136140 "# ] ] ,
137141 ) ;
138142 }
143+
144+ #[ test]
145+ fn hrtb_bound_does_not_add_dyn ( ) {
146+ check (
147+ r#"
148+ //- minicore: fn
149+ fn test<F>(f: F) where F: for<'a> FnOnce(&'a i32) {}
150+ // ^: Sized
151+ "# ,
152+ ) ;
153+ }
139154}
You can’t perform that action at this time.
0 commit comments