File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
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(
17
17
let parent = path. syntax ( ) . parent ( ) ?;
18
18
let range = match path {
19
19
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 ( ) ;
22
26
let parent = paren. as_ref ( ) . and_then ( |it| it. parent ( ) ) . unwrap_or ( parent) ;
23
27
if ast:: TypeBound :: can_cast ( parent. kind ( ) )
24
28
|| ast:: TypeAnchor :: can_cast ( parent. kind ( ) )
@@ -136,4 +140,15 @@ fn foo(
136
140
"# ] ] ,
137
141
) ;
138
142
}
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
+ }
139
154
}
You can’t perform that action at this time.
0 commit comments