File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/tools/rust-analyzer/crates/ide/src/inlay_hints Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ pub(super) fn hints(
3838 return None ;
3939 }
4040 sema. resolve_trait ( & path. path ( ) ?) ?;
41- paren . map_or_else ( || path. syntax ( ) . text_range ( ) , |it| it . text_range ( ) )
41+ path. syntax ( ) . text_range ( )
4242 }
4343 Either :: Right ( dyn_) => {
4444 if dyn_. dyn_token ( ) . is_some ( ) {
@@ -93,7 +93,7 @@ fn foo(_: &T, _: for<'a> T) {}
9393impl T {}
9494 // ^ dyn
9595impl T for (T) {}
96- // ^^ ^ dyn
96+ // ^ dyn
9797impl T
9898"# ,
9999 ) ;
@@ -116,7 +116,7 @@ fn foo(
116116 _: &mut (T + T)
117117 // ^^^^^ dyn
118118 _: *mut (T),
119- // ^^ ^ dyn
119+ // ^ dyn
120120) {}
121121"# ,
122122 ) ;
@@ -151,4 +151,15 @@ fn test<F>(f: F) where F: for<'a> FnOnce(&'a i32) {}
151151 "# ,
152152 ) ;
153153 }
154+
155+ #[ test]
156+ fn with_parentheses ( ) {
157+ check (
158+ r#"
159+ trait T {}
160+ fn foo(v: &(T)) {}
161+ // ^ dyn
162+ "# ,
163+ ) ;
164+ }
154165}
You can’t perform that action at this time.
0 commit comments