From f3aad362b814bc79b7a486ad728fab7af8c7df95 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 17 Dec 2024 17:15:24 +0100 Subject: [PATCH] Rust: add forgotten files --- .../internal/LangCrateRefImpl.qll | 21 ++++++++++++++++ .../internal/RepoCrateRefImpl.qll | 25 +++++++++++++++++++ .../internal/RustcCrateRefImpl.qll | 21 ++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 rust/ql/lib/codeql/rust/elements/canonical_paths/internal/LangCrateRefImpl.qll create mode 100644 rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RepoCrateRefImpl.qll create mode 100644 rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RustcCrateRefImpl.qll diff --git a/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/LangCrateRefImpl.qll b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/LangCrateRefImpl.qll new file mode 100644 index 000000000000..d169ce025b04 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/LangCrateRefImpl.qll @@ -0,0 +1,21 @@ +/** + * This module provides a hand-modifiable wrapper around the generated class `LangCrateRef`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.canonical_paths.LangCrateRef + +/** + * INTERNAL: This module contains the customizable definition of `LangCrateRef` and should not + * be referenced directly. + */ +module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file + /** + * A reference to a crate in the Rust standard libraries. + */ + class LangCrateRef extends Generated::LangCrateRef { + override string toString() { result = this.getName() } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RepoCrateRefImpl.qll b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RepoCrateRefImpl.qll new file mode 100644 index 000000000000..3c84b94f0e74 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RepoCrateRefImpl.qll @@ -0,0 +1,25 @@ +/** + * This module provides a hand-modifiable wrapper around the generated class `RepoCrateRef`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.canonical_paths.RepoCrateRef + +/** + * INTERNAL: This module contains the customizable definition of `RepoCrateRef` and should not + * be referenced directly. + */ +module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file + /** + * A reference to a crate in the repository. + */ + class RepoCrateRef extends Generated::RepoCrateRef { + override string toString() { + result = this.getName() + or + not this.hasName() and result = "?" + } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RustcCrateRefImpl.qll b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RustcCrateRefImpl.qll new file mode 100644 index 000000000000..919d3a5b02a4 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/canonical_paths/internal/RustcCrateRefImpl.qll @@ -0,0 +1,21 @@ +/** + * This module provides a hand-modifiable wrapper around the generated class `RustcCrateRef`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.canonical_paths.RustcCrateRef + +/** + * INTERNAL: This module contains the customizable definition of `RustcCrateRef` and should not + * be referenced directly. + */ +module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file + /** + * A reference to a crate provided by rustc. TODO: understand where these come from. + */ + class RustcCrateRef extends Generated::RustcCrateRef { + override string toString() { result = this.getName() } + } +}