Merge pull request #20150 from geoffw0/ctorinit

Rust: Update BadCtorInitialization.ql to use getCanonicalPath.
This commit is contained in:
Geoffrey White
2025-08-11 09:41:16 +01:00
committed by GitHub

View File

@@ -32,8 +32,7 @@ class CtorAttr extends Attr {
*/
class StdCall extends Expr {
StdCall() {
this.(CallExpr).getFunction().(PathExpr).getResolvedCrateOrigin() = "lang:std" or
this.(MethodCallExpr).getResolvedCrateOrigin() = "lang:std"
this.(CallExprBase).getStaticTarget().getCanonicalPath().matches(["std::%", "<std::%"])
}
}