@@ -15,17 +15,15 @@ private import codeql.rust.elements.internal.generated.Raw
1515 * be referenced directly.
1616 */
1717module Impl {
18- class Locatable extends Generated:: Locatable {
19- pragma [ nomagic]
20- final Location getLocation ( ) {
21- exists ( @location_default location |
22- result = LocationImpl:: TLocationDefault ( location ) and
23- locatable_locations ( Synth:: convertLocatableToRaw ( this ) , location )
24- )
25- or
18+ abstract class SynthLocatable extends Locatable {
19+ abstract predicate hasSynthLocationInfo (
20+ File file , int startline , int startcolumn , int endline , int endcolumn
21+ ) ;
22+
23+ final override Location getLocation ( ) {
2624 not locatable_locations ( Synth:: convertLocatableToRaw ( this ) , _) and
2725 exists ( File file , int beginLine , int beginColumn , int endLine , int endColumn |
28- this .hasLocationInfo ( file . getAbsolutePath ( ) , beginLine , beginColumn , endLine , endColumn )
26+ this .hasSynthLocationInfo ( file , beginLine , beginColumn , endLine , endColumn )
2927 |
3028 result = LocationImpl:: TLocationSynth ( file , beginLine , beginColumn , endLine , endColumn )
3129 or
@@ -35,18 +33,15 @@ module Impl {
3533 )
3634 )
3735 }
36+ }
3837
39- /**
40- * Holds if this element is at the specified location.
41- * The location spans column `startcolumn` of line `startline` to
42- * column `endcolumn` of line `endline` in file `filepath`.
43- * For more information, see
44- * [Providing locations in CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
45- */
46- predicate hasLocationInfo (
47- string filepath , int startline , int startcolumn , int endline , int endcolumn
48- ) {
49- this .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
38+ class Locatable extends Generated:: Locatable {
39+ pragma [ nomagic]
40+ Location getLocation ( ) {
41+ exists ( @location_default location |
42+ result = LocationImpl:: TLocationDefault ( location ) and
43+ locatable_locations ( Synth:: convertLocatableToRaw ( this ) , location )
44+ )
5045 }
5146
5247 /**
0 commit comments