Rust: Move everything type inference related into the typeinference directory#21152
Rust: Move everything type inference related into the typeinference directory#21152paldepind merged 2 commits intogithub:mainfrom
Conversation
6c702b5 to
bdc581d
Compare
bdc581d to
9e74a78
Compare
There was a problem hiding this comment.
Pull request overview
This PR reorganizes type inference related code by moving all type inference imports to use the typeinference subdirectory path, completing the migration that was started previously when the typeinference directory was introduced.
Changes:
- Updated import paths across 28 files to use
codeql.rust.internal.typeinference.*instead ofcodeql.rust.internal.* - Moved
TypeInferenceConsistency.qllinto thetypeinferencedirectory (new file addition) - Updated files within the
typeinferencedirectory to use consistent import patterns for external dependencies
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/test/library-tests/type-inference/type-inference.ql | Updated test imports to use typeinference subdirectory |
| rust/ql/src/queries/telemetry/DatabaseQuality.qll | Updated telemetry imports for type inference modules |
| rust/ql/src/queries/summary/Stats.qll | Updated consistency check import path |
| rust/ql/src/queries/summary/NodesWithTypeAtLengthLimit.ql | Updated TypeInference import path |
| rust/ql/src/queries/diagnostics/TypeInferenceConsistencyCounts.ql | Updated consistency check import path |
| rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll | Updated test utility imports |
| rust/ql/lib/codeql/rust/security/Barriers.qll | Updated security library imports |
| rust/ql/lib/codeql/rust/security/AccessInvalidPointerExtensions.qll | Updated security extension imports |
| rust/ql/lib/codeql/rust/security/AccessAfterLifetimeExtensions.qll | Updated security extension imports |
| rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll | Fixed PathResolution import to use absolute path |
| rust/ql/lib/codeql/rust/internal/typeinference/TypeInferenceConsistency.qll | New file with consistency check predicates using relative imports |
| rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll | Updated PathResolution import and added DerefChain absolute path |
| rust/ql/lib/codeql/rust/internal/typeinference/Type.qll | Updated PathResolution import to use absolute path |
| rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll | Changed to use relative imports for typeinference modules |
| rust/ql/lib/codeql/rust/internal/typeinference/FunctionOverloading.qll | Changed to use relative imports for typeinference modules |
| rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll | Changed Type and TypeInference to relative imports, TypeMention to absolute path |
| rust/ql/lib/codeql/rust/internal/typeinference/BlanketImplementation.qll | Changed to use relative imports for typeinference modules |
| rust/ql/lib/codeql/rust/internal/CachedStages.qll | Updated TypeInferenceStage module imports |
| rust/ql/lib/codeql/rust/frameworks/rustcrypto/RustCrypto.qll | Updated framework imports for type inference |
| rust/ql/lib/codeql/rust/elements/internal/InvocationExprImpl.qll | Updated internal element imports |
| rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll | Updated internal element imports |
| rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll | Updated internal element imports |
| rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll | Updated internal element imports |
| rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll | Updated dataflow imports for type inference modules |
| rust/ql/lib/codeql/rust/dataflow/internal/Node.qll | Updated dataflow node imports |
| rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll | Updated debug module imports |
| rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll | Updated dataflow implementation imports |
| rust/ql/consistency-queries/TypeInferenceConsistency.ql | Updated consistency query import |
Comments suppressed due to low confidence (1)
rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll:10
- Inconsistent import pattern: This line uses an absolute path
codeql.rust.internal.typeinference.DerefChainwhile other imports in the same file (lines 7, 9, 11-13) use relative imports for other typeinference modules likeType,TypeMention,FunctionType, etc. For consistency, this should use a relative import:private import DerefChain
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private import codeql.rust.internal.TypeMention | ||
| private import Type | ||
| private import TypeInference | ||
| private import codeql.rust.internal.typeinference.TypeMention |
There was a problem hiding this comment.
Inconsistent import pattern: This line uses an absolute path codeql.rust.internal.typeinference.TypeMention while other imports in the same file (lines 5-6) use relative imports for Type and TypeInference. For consistency with the other typeinference module imports, this should use a relative import: private import TypeMention
| private import codeql.rust.internal.typeinference.TypeMention | |
| private import TypeMention |
| private import codeql.rust.internal.TypeMention | ||
| private import Type | ||
| private import TypeInference | ||
| private import codeql.rust.internal.typeinference.TypeMention |
| private import typeinference.FunctionType | ||
| private import typeinference.FunctionOverloading as FunctionOverloading | ||
| private import typeinference.BlanketImplementation as BlanketImplementation | ||
| private import codeql.rust.internal.typeinference.DerefChain |
There was a problem hiding this comment.
| private import codeql.rust.internal.typeinference.DerefChain | |
| private import DerefChain |
There was a problem hiding this comment.
Unfortunately that results in an error:
reference to 'DerefChain' references a local library, not the named module
It somehow seems that since there's a module named DerefChain the import path can't also be DerefChain.
A
typeinferencedirectory was introduced a while ago, but there's still some type inference related files that are not inside that directory.