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(
38
38
return None ;
39
39
}
40
40
sema. resolve_trait ( & path. path ( ) ?) ?;
41
- paren . map_or_else ( || path. syntax ( ) . text_range ( ) , |it| it . text_range ( ) )
41
+ path. syntax ( ) . text_range ( )
42
42
}
43
43
Either :: Right ( dyn_) => {
44
44
if dyn_. dyn_token ( ) . is_some ( ) {
@@ -93,7 +93,7 @@ fn foo(_: &T, _: for<'a> T) {}
93
93
impl T {}
94
94
// ^ dyn
95
95
impl T for (T) {}
96
- // ^^ ^ dyn
96
+ // ^ dyn
97
97
impl T
98
98
"# ,
99
99
) ;
@@ -116,7 +116,7 @@ fn foo(
116
116
_: &mut (T + T)
117
117
// ^^^^^ dyn
118
118
_: *mut (T),
119
- // ^^ ^ dyn
119
+ // ^ dyn
120
120
) {}
121
121
"# ,
122
122
) ;
@@ -151,4 +151,15 @@ fn test<F>(f: F) where F: for<'a> FnOnce(&'a i32) {}
151
151
"# ,
152
152
) ;
153
153
}
154
+
155
+ #[ test]
156
+ fn with_parentheses ( ) {
157
+ check (
158
+ r#"
159
+ trait T {}
160
+ fn foo(v: &(T)) {}
161
+ // ^ dyn
162
+ "# ,
163
+ ) ;
164
+ }
154
165
}
You can’t perform that action at this time.
0 commit comments