File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -160,27 +160,14 @@ where
160160 return ;
161161 }
162162 }
163- hir:: ExprKind :: MethodCall ( _ , args , call_span) => {
163+ hir:: ExprKind :: MethodCall ( path , _ , call_span) => {
164164 let types = tcx. typeck ( ex. hir_id . owner ) ;
165165 let Some ( def_id) = types. type_dependent_def_id ( ex. hir_id ) else {
166166 trace ! ( "type_dependent_def_id({}) = None" , ex. hir_id) ;
167167 return ;
168168 } ;
169169
170- // The MethodCall node doesn't directly contain a span for the
171- // method identifier, so we have to compute it by trimming the full
172- // span based on the arguments.
173- let ident_span = match args. get ( 1 ) {
174- // If there is an argument, e.g. "f(x)", then
175- // get the span "f(" and delete the lparen.
176- Some ( arg) => {
177- let with_paren = call_span. until ( arg. span ) ;
178- with_paren. with_hi ( with_paren. hi ( ) - BytePos ( 1 ) )
179- }
180- // Otherwise, just delete both parens directly.
181- None => call_span. with_hi ( call_span. hi ( ) - BytePos ( 2 ) ) ,
182- } ;
183-
170+ let ident_span = path. ident . span ;
184171 ( tcx. type_of ( def_id) , call_span, ident_span)
185172 }
186173 _ => {
You can’t perform that action at this time.
0 commit comments