@@ -160,16 +160,6 @@ module Impl {
160
160
string toString ( ) { result = name_ }
161
161
162
162
string getName ( ) { result = name_ }
163
-
164
- predicate hasLocationInfo (
165
- string filepath , int startline , int startcolumn , int endline , int endcolumn
166
- ) {
167
- this .( PathExpr )
168
- .getLocation ( )
169
- .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn ) or
170
- this .( FormatTemplateVariableAccess )
171
- .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
172
- }
173
163
}
174
164
175
165
private AstNode getAnAncestorInVariableScope ( AstNode n ) {
@@ -290,7 +280,7 @@ module Impl {
290
280
) {
291
281
name = cand .getName ( ) and
292
282
scope = [ cand .( VariableScope ) , getEnclosingScope ( cand ) ] and
293
- cand .hasLocationInfo ( _, startline , startcolumn , endline , endcolumn ) and
283
+ cand .getLocation ( ) . hasLocationInfo ( _, startline , startcolumn , endline , endcolumn ) and
294
284
nestLevel = 0
295
285
or
296
286
exists ( VariableScope inner |
@@ -365,14 +355,8 @@ module Impl {
365
355
result = this .asVariable ( ) .toString ( ) or result = this .asVariableAccessCand ( ) .toString ( )
366
356
}
367
357
368
- predicate hasLocationInfo (
369
- string filepath , int startline , int startcolumn , int endline , int endcolumn
370
- ) {
371
- this .asVariable ( )
372
- .getLocation ( )
373
- .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn ) or
374
- this .asVariableAccessCand ( )
375
- .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
358
+ Location getLocation ( ) {
359
+ result = this .asVariable ( ) .getLocation ( ) or result = this .asVariableAccessCand ( ) .getLocation ( )
376
360
}
377
361
378
362
pragma [ nomagic]
@@ -445,8 +429,6 @@ module Impl {
445
429
)
446
430
}
447
431
448
- private import codeql.rust.elements.internal.generated.Synth
449
-
450
432
/** A variable access. */
451
433
class VariableAccess extends PathExprBaseImpl:: PathExprBase instanceof VariableAccessCand {
452
434
private string name ;
0 commit comments