Skip to content

Rust: Fix bad join #20015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions rust/ql/lib/codeql/rust/frameworks/stdlib/Stdlib.qll
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private class StartswithCall extends Path::SafeAccessCheck::Range, CfgNodes::Met
* [1]: https://doc.rust-lang.org/std/option/enum.Option.html
*/
class OptionEnum extends Enum {
pragma[nomagic]
OptionEnum() { this.getCanonicalPath() = "core::option::Option" }

/** Gets the `Some` variant. */
Expand All @@ -41,6 +42,7 @@ class OptionEnum extends Enum {
* [1]: https://doc.rust-lang.org/stable/std/result/enum.Result.html
*/
class ResultEnum extends Enum {
pragma[nomagic]
ResultEnum() { this.getCanonicalPath() = "core::result::Result" }

/** Gets the `Ok` variant. */
Expand All @@ -56,6 +58,7 @@ class ResultEnum extends Enum {
* [1]: https://doc.rust-lang.org/core/ops/struct.Range.html
*/
class RangeStruct extends Struct {
pragma[nomagic]
RangeStruct() { this.getCanonicalPath() = "core::ops::range::Range" }

/** Gets the `start` field. */
Expand All @@ -71,6 +74,7 @@ class RangeStruct extends Struct {
* [1]: https://doc.rust-lang.org/core/ops/struct.RangeFrom.html
*/
class RangeFromStruct extends Struct {
pragma[nomagic]
RangeFromStruct() { this.getCanonicalPath() = "core::ops::range::RangeFrom" }

/** Gets the `start` field. */
Expand All @@ -83,6 +87,7 @@ class RangeFromStruct extends Struct {
* [1]: https://doc.rust-lang.org/core/ops/struct.RangeTo.html
*/
class RangeToStruct extends Struct {
pragma[nomagic]
RangeToStruct() { this.getCanonicalPath() = "core::ops::range::RangeTo" }

/** Gets the `end` field. */
Expand All @@ -95,6 +100,7 @@ class RangeToStruct extends Struct {
* [1]: https://doc.rust-lang.org/core/ops/struct.RangeInclusive.html
*/
class RangeInclusiveStruct extends Struct {
pragma[nomagic]
RangeInclusiveStruct() { this.getCanonicalPath() = "core::ops::range::RangeInclusive" }

/** Gets the `start` field. */
Expand All @@ -110,6 +116,7 @@ class RangeInclusiveStruct extends Struct {
* [1]: https://doc.rust-lang.org/core/ops/struct.RangeToInclusive.html
*/
class RangeToInclusiveStruct extends Struct {
pragma[nomagic]
RangeToInclusiveStruct() { this.getCanonicalPath() = "core::ops::range::RangeToInclusive" }

/** Gets the `end` field. */
Expand All @@ -122,6 +129,7 @@ class RangeToInclusiveStruct extends Struct {
* [1]: https://doc.rust-lang.org/std/future/trait.Future.html
*/
class FutureTrait extends Trait {
pragma[nomagic]
FutureTrait() { this.getCanonicalPath() = "core::future::future::Future" }

/** Gets the `Output` associated type. */
Expand All @@ -138,6 +146,7 @@ class FutureTrait extends Trait {
* [1]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
*/
class IteratorTrait extends Trait {
pragma[nomagic]
IteratorTrait() { this.getCanonicalPath() = "core::iter::traits::iterator::Iterator" }

/** Gets the `Item` associated type. */
Expand All @@ -154,6 +163,7 @@ class IteratorTrait extends Trait {
* [1]: https://doc.rust-lang.org/std/iter/trait.IntoIterator.html
*/
class IntoIteratorTrait extends Trait {
pragma[nomagic]
IntoIteratorTrait() { this.getCanonicalPath() = "core::iter::traits::collect::IntoIterator" }

/** Gets the `Item` associated type. */
Expand All @@ -170,5 +180,6 @@ class IntoIteratorTrait extends Trait {
* [1]: https://doc.rust-lang.org/std/string/struct.String.html
*/
class StringStruct extends Struct {
pragma[nomagic]
StringStruct() { this.getCanonicalPath() = "alloc::string::String" }
}