From 38f00775bd87f6c1f27608dc23e072671c07cda5 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Fri, 25 Apr 2025 14:49:01 -0400 Subject: [PATCH 01/96] Exclude artifacts downloaded to runner temp. --- .../ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll index d8d5f83c867..24e0f400e92 100644 --- a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll +++ b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll @@ -262,8 +262,9 @@ class ArtifactPoisoningSink extends DataFlow::Node { ArtifactPoisoningSink() { download.getAFollowingStep() = poisonable and - // excluding artifacts downloaded to /tmp + // excluding artifacts downloaded to /tmp and runner.tmp not download.getPath().regexpMatch("^/tmp.*") and + not download.getPath().regexpMatch("^\${{\s?runner.temp\s?}}.*") and ( poisonable.(Run).getScript() = this.asExpr() and ( From a9c4d6f383c68df3491fb6537519139aacee7681 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Fri, 25 Apr 2025 15:00:14 -0400 Subject: [PATCH 02/96] Fix escaping. --- .../ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll index 24e0f400e92..8c6471b3c58 100644 --- a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll +++ b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll @@ -264,7 +264,7 @@ class ArtifactPoisoningSink extends DataFlow::Node { download.getAFollowingStep() = poisonable and // excluding artifacts downloaded to /tmp and runner.tmp not download.getPath().regexpMatch("^/tmp.*") and - not download.getPath().regexpMatch("^\${{\s?runner.temp\s?}}.*") and + not download.getPath().regexpMatch("^\\${{\\s?runner.temp\\s?}}.*") and ( poisonable.(Run).getScript() = this.asExpr() and ( From cb6640474ed280239eb7496828b8c9575d479685 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 19 Jun 2025 19:39:38 +0100 Subject: [PATCH 03/96] Rust: Translate more legacy models -> new models (from data + manual extrapolation). --- .../codeql/rust/frameworks/postgres.model.yml | 22 ++--- .../rustcrypto/rustcrypto.model.yml | 12 +-- .../rust/frameworks/stdlib/io.model.yml | 64 +++++++------- .../rust/frameworks/tokio-postgres.model.yml | 33 ++++--- .../codeql/rust/frameworks/tokio/io.model.yml | 88 +++++++++---------- 5 files changed, 109 insertions(+), 110 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/postgres.model.yml b/rust/ql/lib/codeql/rust/frameworks/postgres.model.yml index 4aba20e3450..81877ed17bd 100644 --- a/rust/ql/lib/codeql/rust/frameworks/postgres.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/postgres.model.yml @@ -1,15 +1,15 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::execute", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::batch_execute", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::prepare", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::prepare_typed", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query_one", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query_opt", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query_raw", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query_typed", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:postgres", "::query_typed_raw", "Argument[0]", "sql-injection", "manual"] + - ["::execute", "Argument[0]", "sql-injection", "manual"] + - ["::batch_execute", "Argument[0]", "sql-injection", "manual"] + - ["::prepare", "Argument[0]", "sql-injection", "manual"] + - ["::prepare_typed", "Argument[0]", "sql-injection", "manual"] + - ["::query", "Argument[0]", "sql-injection", "manual"] + - ["::query_one", "Argument[0]", "sql-injection", "manual"] + - ["::query_opt", "Argument[0]", "sql-injection", "manual"] + - ["::query_raw", "Argument[0]", "sql-injection", "manual"] + - ["::query_typed", "Argument[0]", "sql-injection", "manual"] + - ["::query_typed_raw", "Argument[0]", "sql-injection", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml index 7b7a7964400..d1aefe5b983 100644 --- a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml @@ -1,10 +1,10 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: - - ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::new_with_prefix", "Argument[0]", "hasher-input", "manual"] - - ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::update", "Argument[0]", "hasher-input", "manual"] - - ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::chain_update", "Argument[0]", "hasher-input", "manual"] - - ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::digest", "Argument[0]", "hasher-input", "manual"] - - ["repo:https://github.com/stainless-steel/md5:md5", "crate::compute", "Argument[0]", "hasher-input", "manual"] + - ["::new_with_prefix", "Argument[0]", "hasher-input", "manual"] + - ["::update", "Argument[0]", "hasher-input", "manual"] + - ["::chain_update", "Argument[0]", "hasher-input", "manual"] + - ["::digest", "Argument[0]", "hasher-input", "manual"] + - ["md5::compute", "Argument[0]", "hasher-input", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index fc86d2fb908..b05ee510586 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -1,39 +1,39 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"] + - ["std::io::stdio::stdin", "ReturnValue", "stdin", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: - - ["lang:std", "::new", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::fill_buf", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:std", "::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::split", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::lines", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::chain", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::chain", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::take", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::lock", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::next", "Argument[self]", "ReturnValue.Field[core::option::Option::Some(0)].Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::new", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["::fill_buf", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::split", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::BufRead>::lines", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::chain", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::chain", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::take", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::lock", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::next", "Argument[self]", "ReturnValue.Field[core::option::Option::Some(0)].Field[core::result::Result::Ok(0)]", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml b/rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml index 7ad54022784..9cac599357d 100644 --- a/rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml @@ -1,24 +1,23 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::execute", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::batch_execute", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::execute_raw", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::prepare", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::prepare_typed", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::query", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::query_opt", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::query_raw", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::query_typed", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::query_typed_raw", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::simple_query", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::simple_query_raw", "Argument[0]", "sql-injection", "manual"] - + - ["::execute", "Argument[0]", "sql-injection", "manual"] + - ["::batch_execute", "Argument[0]", "sql-injection", "manual"] + - ["::execute_raw", "Argument[0]", "sql-injection", "manual"] + - ["::prepare", "Argument[0]", "sql-injection", "manual"] + - ["::prepare_typed", "Argument[0]", "sql-injection", "manual"] + - ["::query", "Argument[0]", "sql-injection", "manual"] + - ["::query_opt", "Argument[0]", "sql-injection", "manual"] + - ["::query_raw", "Argument[0]", "sql-injection", "manual"] + - ["::query_typed", "Argument[0]", "sql-injection", "manual"] + - ["::query_typed_raw", "Argument[0]", "sql-injection", "manual"] + - ["::simple_query", "Argument[0]", "sql-injection", "manual"] + - ["::simple_query_raw", "Argument[0]", "sql-injection", "manual"] - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::get", "ReturnValue", "database", "manual"] - - ["repo:https://github.com/sfackler/rust-postgres:tokio-postgres", "::try_get", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] + - ["::get", "ReturnValue", "database", "manual"] + - ["::try_get", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml index 35dcd597c0d..d5e91afa663 100644 --- a/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml @@ -1,51 +1,51 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::stdin::stdin", "ReturnValue", "stdin", "manual"] + - ["tokio::io::stdin::stdin", "ReturnValue", "stdin", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: - - ["repo:https://github.com/tokio-rs/tokio:tokio", "::new", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_buf_read_ext::AsyncBufReadExt::fill_buf", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_buf_read_ext::AsyncBufReadExt::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_buf_read_ext::AsyncBufReadExt::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_buf_read_ext::AsyncBufReadExt::split", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "::next_segment", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_buf_read_ext::AsyncBufReadExt::lines", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "::next_line", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_buf", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u8", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u8_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u16", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u16_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u128", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_u128_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i8", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i8_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i16", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i16_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i128", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_i128_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_f32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_f32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_f64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::read_f64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::chain", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::chain", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/tokio-rs/tokio:tokio", "crate::io::util::async_read_ext::AsyncReadExt::take", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::new", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::fill_buf", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_exact ", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::split", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::next_segment", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::lines", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::next_line", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_buf", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u8", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u8_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u16", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u16_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u128", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u128_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i8", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i8_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i16", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i16_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i128", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_i128_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_f32", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>:::read_f32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_f64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_f64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::chain", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::chain", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::take", "Argument[self]", "ReturnValue", "taint", "manual"] From 3027f75617bdc966f6653858171e102cbecd0f7e Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 19 Jun 2025 19:39:38 +0100 Subject: [PATCH 04/96] Rust: Translate more legacy models -> new models (from data). --- .../lib/codeql/rust/frameworks/http.model.yml | 18 +-- .../codeql/rust/frameworks/reqwest.model.yml | 34 ++--- .../codeql/rust/frameworks/rusqlite.model.yml | 25 ++-- .../codeql/rust/frameworks/rustls.model.yml | 14 +- .../frameworks/stdlib/lang-alloc.model.yml | 63 ++++----- .../frameworks/stdlib/lang-core.model.yml | 121 +++++++++--------- .../rust/frameworks/stdlib/net.model.yml | 18 +-- 7 files changed, 150 insertions(+), 143 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/http.model.yml b/rust/ql/lib/codeql/rust/frameworks/http.model.yml index 5ad34ef53fe..6a497f34647 100644 --- a/rust/ql/lib/codeql/rust/frameworks/http.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/http.model.yml @@ -1,13 +1,13 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/hyperium/hyper:hyper", "::send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper:hyper", "::send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper:hyper", "::try_send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper:hyper", "::try_send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper:hyper", "::get", "ReturnValue.Future", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper:hyper", "::request", "ReturnValue.Future", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper-util:hyper-util", "::get", "ReturnValue.Future", "remote", "manual"] - - ["repo:https://github.com/hyperium/hyper-util:hyper-util", "::request", "ReturnValue.Future", "remote", "manual"] + - ["::send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::try_send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::try_send_request", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::get", "ReturnValue.Future", "remote", "manual"] + - ["::request", "ReturnValue.Future", "remote", "manual"] + - ["::get", "ReturnValue.Future", "remote", "manual"] + - ["::request", "ReturnValue.Future", "remote", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/reqwest.model.yml b/rust/ql/lib/codeql/rust/frameworks/reqwest.model.yml index 3974d5b0817..8c24bbf148d 100644 --- a/rust/ql/lib/codeql/rust/frameworks/reqwest.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/reqwest.model.yml @@ -1,27 +1,27 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "crate::get", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "crate::blocking::get", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["reqwest::get", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["reqwest::blocking::get", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::request", "Argument[1]", "transmission", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::request", "Argument[1]", "transmission", "manual"] + - ["::request", "Argument[1]", "transmission", "manual"] + - ["::request", "Argument[1]", "transmission", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::text", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::text_with_charset", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::bytes", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::chunk", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::text", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::text_with_charset", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::bytes", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::text", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::bytes", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/seanmonstar/reqwest:reqwest", "::chunk", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] + - ["::text", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::text_with_charset", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::bytes", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::chunk", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] + - ["::text", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::text_with_charset", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::bytes", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::text", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::bytes", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::chunk", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml b/rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml index 3da7e2a1bc6..43030de02d5 100644 --- a/rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml @@ -1,20 +1,19 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::execute", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::execute_batch", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::prepare", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::prepare_with_flags", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::query_row", "Argument[0]", "sql-injection", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::query_row_and_then", "Argument[0]", "sql-injection", "manual"] - + - ["::execute", "Argument[0]", "sql-injection", "manual"] + - ["::execute_batch", "Argument[0]", "sql-injection", "manual"] + - ["::prepare", "Argument[0]", "sql-injection", "manual"] + - [::prepare_with_flags", "Argument[0]", "sql-injection", "manual"] + - ["::query_row", "Argument[0]", "sql-injection", "manual"] + - ["::query_row_and_then", "Argument[0]", "sql-injection", "manual"] - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::get", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::get_unwrap", "ReturnValue", "database", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::get_ref", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] - - ["repo:https://github.com/rusqlite/rusqlite:rusqlite", "::get_ref_unwrap", "ReturnValue", "database", "manual"] + - ["::get", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] + - ["::get_unwrap", "ReturnValue", "database", "manual"] + - ["::get_ref", "ReturnValue.Field[core::result::Result::Ok(0)]", "database", "manual"] + - ["::get_ref_unwrap", "ReturnValue", "database", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/rustls.model.yml b/rust/ql/lib/codeql/rust/frameworks/rustls.model.yml index 1e21646f2ca..19f7ececcd2 100644 --- a/rust/ql/lib/codeql/rust/frameworks/rustls.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/rustls.model.yml @@ -1,14 +1,14 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["repo:https://github.com/rustls/rustls:rustls", "::new", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::new", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: - - ["repo:https://github.com/quininer/futures-rustls:futures-rustls", "::connect", "Argument[1]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["repo:https://github.com/quininer/futures-rustls:futures-rustls", "::poll_read", "Argument[self].Reference", "Argument[1].Reference", "taint", "manual"] - - ["repo:https://github.com/rustls/rustls:rustls", "::reader", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["repo:https://github.com/rustls/rustls:rustls", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::connect", "Argument[1]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::poll_read", "Argument[self].Reference", "Argument[1].Reference", "taint", "manual"] + - ["::reader", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index eea2f6726db..08fd458576d 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -1,44 +1,49 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: # Alloc - - ["lang:alloc", "crate::alloc::dealloc", "Argument[0]", "pointer-invalidate", "manual"] + - ["alloc::alloc::dealloc", "Argument[0]", "pointer-invalidate", "manual"] - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: # Alloc - - ["lang:alloc", "crate::alloc::alloc", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "crate::alloc::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "crate::alloc::realloc", "Argument[2]", "alloc-size", "manual"] - - ["lang:std", "::alloc", "Argument[0]", "alloc-layout", "manual"] - - ["lang:std", "::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] - - ["lang:std", "::allocate", "Argument[0]", "alloc-layout", "manual"] - - ["lang:std", "::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] - - ["lang:std", "::grow", "Argument[2]", "alloc-layout", "manual"] - - ["lang:std", "::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] - - ["lang:alloc", "::alloc", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "::allocate", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] - - ["lang:alloc", "::grow", "Argument[2]", "alloc-layout", "manual"] - - ["lang:alloc", "::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] + - ["alloc::alloc::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["alloc::alloc::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["alloc::alloc::realloc", "Argument[2]", "alloc-size", "manual"] + - ["<_ as core::alloc::global::GlobalAlloc>::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["<_ as core::alloc::global::GlobalAlloc>::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["::allocate", "Argument[0]", "alloc-layout", "manual"] + - ["::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["::grow", "Argument[2]", "alloc-layout", "manual"] + - ["::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] + - ["::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["::allocate", "Argument[0]", "alloc-layout", "manual"] + - ["::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["::grow", "Argument[2]", "alloc-layout", "manual"] + - ["::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: # Box - - ["lang:alloc", "::pin", "Argument[0]", "ReturnValue.Reference", "value", "manual"] - - ["lang:alloc", "::new", "Argument[0]", "ReturnValue.Reference", "value", "manual"] - - ["lang:alloc", "::into_pin", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::pin", "Argument[0]", "ReturnValue.Reference", "value", "manual"] + - ["::new", "Argument[0]", "ReturnValue.Reference", "value", "manual"] + - ["::into_pin", "Argument[0]", "ReturnValue", "value", "manual"] # Fmt - - ["lang:alloc", "crate::fmt::format", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["alloc::fmt::format", "Argument[0]", "ReturnValue", "taint", "manual"] # String - - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "value", "manual"] - - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] - - ["lang:alloc", "<_ as crate::string::ToString>::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:alloc", "::parse", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:alloc", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - - ["lang:alloc", "::from", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::as_str", "Argument[self]", "ReturnValue", "value", "manual"] + - ["::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] + - ["::as_str", "Argument[self]", "ReturnValue", "value", "manual"] + - ["::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] + - ["::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::parse", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] + - ["::from", "Argument[0]", "ReturnValue", "value", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index 00d78a7d8cb..44319a942bf 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -1,76 +1,79 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: # Iterator - - ["lang:core", "<[_]>::iter", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - - ["lang:core", "<[_]>::iter_mut", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - - ["lang:core", "<[_]>::into_iter", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - - ["lang:core", "crate::iter::traits::iterator::Iterator::nth", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] - - ["lang:core", "crate::iter::traits::iterator::Iterator::next", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] - - ["lang:core", "crate::iter::traits::iterator::Iterator::collect", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - - ["lang:core", "crate::iter::traits::iterator::Iterator::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] - - ["lang:core", "crate::iter::traits::iterator::Iterator::for_each", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] - - ["lang:core", "::nth", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] - - ["lang:core", "::next", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] - - ["lang:core", "::collect", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - - ["lang:core", "::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] - - ["lang:core", "::for_each", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] + - ["::iter", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["::iter", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["::iter_mut", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["::into_iter", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::nth", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::next", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::collect", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::for_each", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] + - ["::nth", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] + - ["::next", "Argument[self].Element", "ReturnValue.Field[core::option::Option::Some(0)]", "value", "manual"] + - ["::collect", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] + - ["::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] + - ["<_ as core::iter::traits::iterator::Iterator>::for_each", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] # Layout - - ["lang:core", "::from_size_align", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::from_size_align_unchecked", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["lang:core", "::array", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::repeat", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] - - ["lang:core", "::repeat", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] - - ["lang:core", "::repeat_packed", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::repeat_packed", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::extend", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] - - ["lang:core", "::extend", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] - - ["lang:core", "::extend_packed", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::extend_packed", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::align_to", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::pad_to_align", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:core", "::size", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::from_size_align", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::from_size_align_unchecked", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["::array", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::repeat", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["::repeat", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["::repeat_packed", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::repeat_packed", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::extend", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["::extend", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["::extend_packed", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::extend_packed", "Argument[0]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::align_to", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::pad_to_align", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::size", "Argument[self]", "ReturnValue", "taint", "manual"] # Pin - - ["lang:core", "crate::pin::Pin", "Argument[0]", "ReturnValue", "value", "manual"] - - ["lang:core", "::new", "Argument[0]", "ReturnValue", "value", "manual"] - - ["lang:core", "::new_unchecked", "Argument[0].Reference", "ReturnValue", "value", "manual"] - - ["lang:core", "::into_inner", "Argument[0]", "ReturnValue", "value", "manual"] - - ["lang:core", "::into_inner_unchecked", "Argument[0]", "ReturnValue", "value", "manual"] - - ["lang:core", "::set", "Argument[0]", "Argument[self]", "value", "manual"] - - ["lang:core", "::into_inner", "Argument[0]", "ReturnValue", "value", "manual"] + - ["core::pin::Pin", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::new", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::new_unchecked", "Argument[0].Reference", "ReturnValue", "value", "manual"] + - ["::into_inner", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::into_inner_unchecked", "Argument[0]", "ReturnValue", "value", "manual"] + - ["::set", "Argument[0]", "Argument[self]", "value", "manual"] # Ptr - - ["lang:core", "crate::ptr::read", "Argument[0].Reference", "ReturnValue", "value", "manual"] - - ["lang:core", "crate::ptr::read_unaligned", "Argument[0].Reference", "ReturnValue", "value", "manual"] - - ["lang:core", "crate::ptr::read_volatile", "Argument[0].Reference", "ReturnValue", "value", "manual"] - - ["lang:core", "crate::ptr::write", "Argument[1]", "Argument[0].Reference", "value", "manual"] - - ["lang:core", "crate::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] - - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] + - ["core::ptr::read", "Argument[0].Reference", "ReturnValue", "value", "manual"] + - ["core::ptr::read_unaligned", "Argument[0].Reference", "ReturnValue", "value", "manual"] + - ["core::ptr::read_volatile", "Argument[0].Reference", "ReturnValue", "value", "manual"] + - ["core::ptr::write", "Argument[1]", "Argument[0].Reference", "value", "manual"] + - ["core::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] + - ["core::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str - - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "value"] - - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "value"] - - ["lang:core", "::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] + - ["::as_str", "Argument[self]", "ReturnValue", "taint", "value"] + - ["::as_str", "Argument[self]", "ReturnValue", "taint", "value"] + - ["::as_bytes", "Argument[self]", "ReturnValue", "taint", "value"] + - ["::as_bytes", "Argument[self]", "ReturnValue", "taint", "value"] + - ["::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::parse", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: # Ptr - - ["lang:core", "crate::ptr::drop_in_place", "Argument[0]", "pointer-invalidate", "manual"] - - ["lang:core", "crate::ptr::dangling", "ReturnValue", "pointer-invalidate", "manual"] - - ["lang:core", "crate::ptr::dangling_mut", "ReturnValue", "pointer-invalidate", "manual"] - - ["lang:core", "crate::ptr::null", "ReturnValue", "pointer-invalidate", "manual"] + - ["core::ptr::drop_in_place", "Argument[0]", "pointer-invalidate", "manual"] + - ["core::ptr::dangling", "ReturnValue", "pointer-invalidate", "manual"] + - ["core::ptr::dangling_mut", "ReturnValue", "pointer-invalidate", "manual"] + - ["core::ptr::null", "ReturnValue", "pointer-invalidate", "manual"] + - ["v8::primitives::null", "ReturnValue", "pointer-invalidate", "manual"] - addsTo: pack: codeql/rust-all - extensible: sinkModelDeprecated + extensible: sinkModel data: # Ptr - - ["lang:core", "crate::ptr::read", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::read_unaligned", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::read_volatile", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::write", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::write_bytes", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::write_unaligned", "Argument[0]", "pointer-access", "manual"] - - ["lang:core", "crate::ptr::write_volatile", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::read", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::read_unaligned", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::read_volatile", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::write", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::write_bytes", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::write_unaligned", "Argument[0]", "pointer-access", "manual"] + - ["core::ptr::write_volatile", "Argument[0]", "pointer-access", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/net.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/net.model.yml index 307b20b5b88..bf158cbae2d 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/net.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/net.model.yml @@ -1,16 +1,16 @@ extensions: - addsTo: pack: codeql/rust-all - extensible: sourceModelDeprecated + extensible: sourceModel data: - - ["lang:std", "::connect", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] - - ["lang:std", "::connect_timeout", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::connect", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] + - ["::connect_timeout", "ReturnValue.Field[core::result::Result::Ok(0)]", "remote", "manual"] - addsTo: pack: codeql/rust-all - extensible: summaryModelDeprecated + extensible: summaryModel data: - - ["lang:std", "::try_clone", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::try_clone", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] From e56b9debf876fec8b755e0efc10b613faabeee08 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 1 Jul 2025 16:55:00 +0100 Subject: [PATCH 05/96] Rust: Fix mistake. --- rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index b05ee510586..41f1348879f 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -15,7 +15,7 @@ extensions: - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as std::io::Read>::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["::read_to_string", "", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as std::io::Read>::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] From 3e11dbded0f2e5f983ee2340d3af0d57ed7b7fe3 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:31:15 +0100 Subject: [PATCH 06/96] Rust: Accept test changes. --- .../library-tests/dataflow/sources/test.rs | 2 +- .../library-tests/frameworks/postgres/main.rs | 10 +-- .../CWE-328/WeakSensitiveDataHashing.expected | 66 +------------------ .../test/query-tests/security/CWE-328/test.rs | 26 ++++---- 4 files changed, 22 insertions(+), 82 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index 845050c2fc9..a3dc78f9c52 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -214,7 +214,7 @@ fn test_io_stdin() -> std::io::Result<()> { { let mut buffer = Vec::::new(); let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { diff --git a/rust/ql/test/library-tests/frameworks/postgres/main.rs b/rust/ql/test/library-tests/frameworks/postgres/main.rs index 8a04f8d00e8..1ca39fb9427 100644 --- a/rust/ql/test/library-tests/frameworks/postgres/main.rs +++ b/rust/ql/test/library-tests/frameworks/postgres/main.rs @@ -16,7 +16,7 @@ fn main() -> Result<(), Box> { )", &[], )?; - + let query = format!("INSERT INTO person (name, age) VALUES ('{}', '{}')", name, age); conn.execute(query.as_str(), &[])?; // $ sql-sink @@ -33,11 +33,11 @@ fn main() -> Result<(), Box> { // conn.query_typed_raw(query.as_str(), &[])?; for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink - let id: i32 = row.get("id"); // $ database-read - let name: &str = row.try_get("name")?; // $ database-read - let age: i32 = row.try_get("age").unwrap(); // $ database-read + let id: i32 = row.get("id"); // $ MISSING: database-read + let name: &str = row.try_get("name")?; // $ MISSING: database-read + let age: i32 = row.try_get("age").unwrap(); // $ MISSING: database-read println!("found person: {} {} {}", id, name, age); } Ok(()) -} \ No newline at end of file +} diff --git a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected index 062e3a63cc3..2d4e7cd6e72 100644 --- a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected +++ b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected @@ -1,74 +1,14 @@ #select -| test.rs:14:9:14:24 | ...::digest | test.rs:14:26:14:39 | credit_card_no | test.rs:14:9:14:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure. | test.rs:14:26:14:39 | credit_card_no | Sensitive data (private) | -| test.rs:15:9:15:24 | ...::digest | test.rs:15:26:15:33 | password | test.rs:15:9:15:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:15:26:15:33 | password | Sensitive data (password) | | test.rs:20:9:20:24 | ...::compute | test.rs:20:26:20:39 | credit_card_no | test.rs:20:9:20:24 | ...::compute | $@ is used in a hashing algorithm (MD5) that is insecure. | test.rs:20:26:20:39 | credit_card_no | Sensitive data (private) | | test.rs:21:9:21:24 | ...::compute | test.rs:21:26:21:33 | password | test.rs:21:9:21:24 | ...::compute | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:21:26:21:33 | password | Sensitive data (password) | -| test.rs:26:9:26:26 | ...::digest | test.rs:26:28:26:41 | credit_card_no | test.rs:26:9:26:26 | ...::digest | $@ is used in a hashing algorithm (SHA1) that is insecure. | test.rs:26:28:26:41 | credit_card_no | Sensitive data (private) | -| test.rs:27:9:27:26 | ...::digest | test.rs:27:28:27:35 | password | test.rs:27:9:27:26 | ...::digest | $@ is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:27:28:27:35 | password | Sensitive data (password) | -| test.rs:32:9:32:34 | ...::digest | test.rs:32:36:32:49 | credit_card_no | test.rs:32:9:32:34 | ...::digest | $@ is used in a hashing algorithm (SHA1) that is insecure. | test.rs:32:36:32:49 | credit_card_no | Sensitive data (private) | -| test.rs:33:9:33:34 | ...::digest | test.rs:33:36:33:43 | password | test.rs:33:9:33:34 | ...::digest | $@ is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:33:36:33:43 | password | Sensitive data (password) | -| test.rs:39:9:39:30 | ...::digest | test.rs:39:32:39:39 | password | test.rs:39:9:39:30 | ...::digest | $@ is used in a hashing algorithm (SHA3256) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:39:32:39:39 | password | Sensitive data (password) | -| test.rs:60:9:60:24 | ...::digest | test.rs:60:26:60:37 | password_str | test.rs:60:9:60:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:60:26:60:37 | password_str | Sensitive data (password) | -| test.rs:62:9:62:24 | ...::digest | test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:62:26:62:37 | password_arr | Sensitive data (password) | -| test.rs:64:9:64:24 | ...::digest | test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:64:26:64:37 | password_vec | Sensitive data (password) | -| test.rs:77:9:77:33 | ...::new_with_prefix | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:77:35:77:42 | password | Sensitive data (password) | -| test.rs:81:9:81:24 | ...::digest | test.rs:81:26:81:33 | password | test.rs:81:9:81:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:81:26:81:33 | password | Sensitive data (password) | -| test.rs:83:9:83:24 | ...::digest | test.rs:83:26:83:33 | password | test.rs:83:9:83:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:83:26:83:33 | password | Sensitive data (password) | edges -| test.rs:14:26:14:39 | credit_card_no | test.rs:14:9:14:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:15:26:15:33 | password | test.rs:15:9:15:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:20:26:20:39 | credit_card_no | test.rs:20:9:20:24 | ...::compute | provenance | MaD:3 Sink:MaD:3 | -| test.rs:21:26:21:33 | password | test.rs:21:9:21:24 | ...::compute | provenance | MaD:3 Sink:MaD:3 | -| test.rs:26:28:26:41 | credit_card_no | test.rs:26:9:26:26 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:27:28:27:35 | password | test.rs:27:9:27:26 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:32:36:32:49 | credit_card_no | test.rs:32:9:32:34 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:33:36:33:43 | password | test.rs:33:9:33:34 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:39:32:39:39 | password | test.rs:39:9:39:30 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:60:26:60:37 | password_str | test.rs:60:9:60:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | provenance | MaD:2 Sink:MaD:2 | -| test.rs:81:26:81:33 | password | test.rs:81:26:81:40 | password.trim() [&ref] | provenance | MaD:5 | -| test.rs:81:26:81:40 | password.trim() [&ref] | test.rs:81:9:81:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() | provenance | MaD:4 | -| test.rs:83:26:83:44 | password.as_bytes() | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | +| test.rs:20:26:20:39 | credit_card_no | test.rs:20:9:20:24 | ...::compute | provenance | MaD:1 Sink:MaD:1 | +| test.rs:21:26:21:33 | password | test.rs:21:9:21:24 | ...::compute | provenance | MaD:1 Sink:MaD:1 | models -| 1 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::digest; Argument[0]; hasher-input | -| 2 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::new_with_prefix; Argument[0]; hasher-input | -| 3 | Sink: repo:https://github.com/stainless-steel/md5:md5; crate::compute; Argument[0]; hasher-input | -| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue; taint | -| 5 | Summary: lang:core; ::trim; Argument[self]; ReturnValue.Reference; taint | +| 1 | Sink: md5::compute; Argument[0]; hasher-input | nodes -| test.rs:14:9:14:24 | ...::digest | semmle.label | ...::digest | -| test.rs:14:26:14:39 | credit_card_no | semmle.label | credit_card_no | -| test.rs:15:9:15:24 | ...::digest | semmle.label | ...::digest | -| test.rs:15:26:15:33 | password | semmle.label | password | | test.rs:20:9:20:24 | ...::compute | semmle.label | ...::compute | | test.rs:20:26:20:39 | credit_card_no | semmle.label | credit_card_no | | test.rs:21:9:21:24 | ...::compute | semmle.label | ...::compute | | test.rs:21:26:21:33 | password | semmle.label | password | -| test.rs:26:9:26:26 | ...::digest | semmle.label | ...::digest | -| test.rs:26:28:26:41 | credit_card_no | semmle.label | credit_card_no | -| test.rs:27:9:27:26 | ...::digest | semmle.label | ...::digest | -| test.rs:27:28:27:35 | password | semmle.label | password | -| test.rs:32:9:32:34 | ...::digest | semmle.label | ...::digest | -| test.rs:32:36:32:49 | credit_card_no | semmle.label | credit_card_no | -| test.rs:33:9:33:34 | ...::digest | semmle.label | ...::digest | -| test.rs:33:36:33:43 | password | semmle.label | password | -| test.rs:39:9:39:30 | ...::digest | semmle.label | ...::digest | -| test.rs:39:32:39:39 | password | semmle.label | password | -| test.rs:60:9:60:24 | ...::digest | semmle.label | ...::digest | -| test.rs:60:26:60:37 | password_str | semmle.label | password_str | -| test.rs:62:9:62:24 | ...::digest | semmle.label | ...::digest | -| test.rs:62:26:62:37 | password_arr | semmle.label | password_arr | -| test.rs:64:9:64:24 | ...::digest | semmle.label | ...::digest | -| test.rs:64:26:64:37 | password_vec | semmle.label | password_vec | -| test.rs:77:9:77:33 | ...::new_with_prefix | semmle.label | ...::new_with_prefix | -| test.rs:77:35:77:42 | password | semmle.label | password | -| test.rs:81:9:81:24 | ...::digest | semmle.label | ...::digest | -| test.rs:81:26:81:33 | password | semmle.label | password | -| test.rs:81:26:81:40 | password.trim() [&ref] | semmle.label | password.trim() [&ref] | -| test.rs:83:9:83:24 | ...::digest | semmle.label | ...::digest | -| test.rs:83:26:83:33 | password | semmle.label | password | -| test.rs:83:26:83:44 | password.as_bytes() | semmle.label | password.as_bytes() | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-328/test.rs b/rust/ql/test/query-tests/security/CWE-328/test.rs index 56b6fe7821d..a7e17404df1 100644 --- a/rust/ql/test/query-tests/security/CWE-328/test.rs +++ b/rust/ql/test/query-tests/security/CWE-328/test.rs @@ -11,8 +11,8 @@ fn test_hash_algorithms( // MD5 _ = md5::Md5::digest(harmless); - _ = md5::Md5::digest(credit_card_no); // $ Alert[rust/weak-sensitive-data-hashing] - _ = md5::Md5::digest(password); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(credit_card_no); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(encrypted_password); // MD5 (alternative / older library) @@ -23,20 +23,20 @@ fn test_hash_algorithms( // SHA-1 _ = sha1::Sha1::digest(harmless); - _ = sha1::Sha1::digest(credit_card_no); // $ Alert[rust/weak-sensitive-data-hashing] - _ = sha1::Sha1::digest(password); // $ Alert[rust/weak-sensitive-data-hashing] + _ = sha1::Sha1::digest(credit_card_no); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = sha1::Sha1::digest(password); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = sha1::Sha1::digest(encrypted_password); // SHA-1 checked _ = sha1_checked::Sha1::digest(harmless); - _ = sha1_checked::Sha1::digest(credit_card_no); // $ Alert[rust/weak-sensitive-data-hashing] - _ = sha1_checked::Sha1::digest(password); // $ Alert[rust/weak-sensitive-data-hashing] + _ = sha1_checked::Sha1::digest(credit_card_no); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = sha1_checked::Sha1::digest(password); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = sha1_checked::Sha1::digest(encrypted_password); // SHA-256 (appropriate for sensitive data hashing) _ = sha3::Sha3_256::digest(harmless); _ = sha3::Sha3_256::digest(credit_card_no); - _ = sha3::Sha3_256::digest(password); // $ Alert[rust/weak-sensitive-data-hashing] + _ = sha3::Sha3_256::digest(password); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = sha3::Sha3_256::digest(encrypted_password); // Argon2 (appropriate for password hashing) @@ -57,11 +57,11 @@ fn test_hash_code_patterns( // hash different types of data _ = md5::Md5::digest(harmless_str); - _ = md5::Md5::digest(password_str); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password_str); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(harmless_arr); - _ = md5::Md5::digest(password_arr); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password_arr); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(harmless_vec); - _ = md5::Md5::digest(password_vec); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password_vec); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] // hash through a hasher object let mut md5_hasher = md5::Md5::new(); @@ -74,13 +74,13 @@ fn test_hash_code_patterns( _ = md5::Md5::new().chain_update(harmless).chain_update(password).chain_update(harmless).finalize(); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::new_with_prefix(harmless).finalize(); - _ = md5::Md5::new_with_prefix(password).finalize(); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::new_with_prefix(password).finalize(); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] // hash transformed data _ = md5::Md5::digest(harmless.trim()); - _ = md5::Md5::digest(password.trim()); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.trim()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(harmless.as_bytes()); - _ = md5::Md5::digest(password.as_bytes()); // $ Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.as_bytes()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(std::str::from_utf8(harmless_arr).unwrap()); _ = md5::Md5::digest(std::str::from_utf8(password_arr).unwrap()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] } From d1b4172486960613b91421183d5f7e32d9ae76c2 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 1 Jul 2025 14:08:48 +0200 Subject: [PATCH 07/96] Shared: Factor out some helper predicates in alert filtering --- shared/util/codeql/util/AlertFiltering.qll | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index 1bc366c0416..f264c20aeda 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -75,19 +75,30 @@ extensible predicate restrictAlertsToExactLocation( /** Module for applying alert location filtering. */ module AlertFilteringImpl { + pragma[nomagic] + private predicate restrictAlertsToEntireFile(string filePath) { restrictAlertsTo(filePath, 0, 0) } + + pragma[nomagic] + private predicate restrictAlertsToStartLine(string filePath, int line) { + exists(int startLineStart, int startLineEnd | + restrictAlertsTo(filePath, startLineStart, startLineEnd) and + line = [startLineStart .. startLineEnd] + ) + } + /** Applies alert filtering to the given location. */ bindingset[location] predicate filterByLocation(Location location) { not restrictAlertsTo(_, _, _) and not restrictAlertsToExactLocation(_, _, _, _, _) or - exists(string filePath, int startLineStart, int startLineEnd | - restrictAlertsTo(filePath, startLineStart, startLineEnd) - | - startLineStart = 0 and - startLineEnd = 0 and + exists(string filePath | + restrictAlertsToEntireFile(filePath) and location.hasLocationInfo(filePath, _, _, _, _) or - location.hasLocationInfo(filePath, [startLineStart .. startLineEnd], _, _, _) + exists(int line | + restrictAlertsToStartLine(filePath, line) and + location.hasLocationInfo(filePath, line, _, _, _) + ) ) or exists(string filePath, int startLine, int startColumn, int endLine, int endColumn | From 8b345518f4f2dc3cdcdcb9a9339a0b3ea2175536 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 1 Jul 2025 14:54:41 +0200 Subject: [PATCH 08/96] Shared: Add approximate version of getASelected{Source,Sink}Location --- shared/dataflow/codeql/dataflow/DataFlow.qll | 36 +++++++++++++++++++ .../codeql/dataflow/internal/DataFlowImpl.qll | 4 +++ .../dataflow/internal/DataFlowImplStage1.qll | 8 +++-- shared/util/codeql/util/AlertFiltering.qll | 36 +++++++++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 3483287e3b3..93803af552b 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -459,6 +459,15 @@ module Configs Lang> { */ default Location getASelectedSourceLocation(Node source) { result = source.getLocation() } + /** + * Like `getASelectedSourceLocation`, but only has to get a location _containing_ the + * actual location associated with `source`. + * + * This prunes fewer sources than `getASelectedSourceLocation` but leaves room for the possibility + * that a more precise location can be selected in the query. + */ + default Location getASelectedSourceLocationApprox(Node source) { none() } + /** * Gets a location that will be associated with the given `sink` in a * diff-informed query that uses this configuration (see @@ -469,6 +478,15 @@ module Configs Lang> { * report the sink at all, this predicate can be `none()`. */ default Location getASelectedSinkLocation(Node sink) { result = sink.getLocation() } + + /** + * Like `getASelectedSinkLocation`, but only has to get a location _containing_ the + * actual location associated with `sink`. + * + * This prunes fewer sinks than `getASelectedSinkLocation` but leaves room for the possibility + * that a more precise location can be selected in the query. + */ + default Location getASelectedSinkLocationApprox(Node sink) { none() } } /** An input configuration for data flow using flow state. */ @@ -608,6 +626,15 @@ module Configs Lang> { */ default Location getASelectedSourceLocation(Node source) { result = source.getLocation() } + /** + * Like `getASelectedSourceLocation`, but only has to get a location _containing_ the + * actual location associated with `source`. + * + * This prunes fewer sources than `getASelectedSourceLocation` but leaves room for the possibility + * that a more precise location can be selected in the query. + */ + default Location getASelectedSourceLocationApprox(Node source) { none() } + /** * Gets a location that will be associated with the given `sink` in a * diff-informed query that uses this configuration (see @@ -618,6 +645,15 @@ module Configs Lang> { * report the sink at all, this predicate can be `none()`. */ default Location getASelectedSinkLocation(Node sink) { result = sink.getLocation() } + + /** + * Like `getASelectedSinkLocation`, but only has to get a location _containing_ the + * actual location associated with `sink`. + * + * This prunes fewer sinks than `getASelectedSinkLocation` but leaves room for the possibility + * that a more precise location can be selected in the query. + */ + default Location getASelectedSinkLocationApprox(Node sink) { none() } } } diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index a7e0736432a..b90512bdb23 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -145,7 +145,11 @@ module MakeImpl Lang> { Location getASelectedSourceLocation(Node source); + Location getASelectedSourceLocationApprox(Node source); + Location getASelectedSinkLocation(Node sink); + + Location getASelectedSinkLocationApprox(Node sink); } /** diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll index c7883df0de1..5e85cab00d9 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll @@ -133,7 +133,9 @@ module MakeImplStage1 Lang> { private predicate isFilteredSource(Node source) { Config::isSource(source, _) and if Config::observeDiffInformedIncrementalMode() - then AlertFiltering::filterByLocation(Config::getASelectedSourceLocation(source)) + then + AlertFiltering::filterByLocation(Config::getASelectedSourceLocation(source)) or + AlertFiltering::filterByLocationApprox(Config::getASelectedSourceLocationApprox(source)) else any() } @@ -144,7 +146,9 @@ module MakeImplStage1 Lang> { Config::isSink(sink) ) and if Config::observeDiffInformedIncrementalMode() - then AlertFiltering::filterByLocation(Config::getASelectedSinkLocation(sink)) + then + AlertFiltering::filterByLocation(Config::getASelectedSinkLocation(sink)) or + AlertFiltering::filterByLocationApprox(Config::getASelectedSinkLocationApprox(sink)) else any() } diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index f264c20aeda..97e6198a16c 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -107,4 +107,40 @@ module AlertFilteringImpl { location.hasLocationInfo(filePath, startLine, startColumn, endLine, endColumn) ) } + + /** + * Holds if some subrange within `location` would be accepted by alert filtering. + * + * There does not need to exist a `Location` corresponding to that subrange. + */ + bindingset[location] + predicate filterByLocationApprox(Location location) { + not restrictAlertsTo(_, _, _) and not restrictAlertsToExactLocation(_, _, _, _, _) + or + exists(string filePath | + restrictAlertsToEntireFile(filePath) and + location.hasLocationInfo(filePath, _, _, _, _) + or + exists(int locStartLine, int locEndLine | + location.hasLocationInfo(filePath, locStartLine, _, locEndLine, _) + | + restrictAlertsToStartLine(filePath, [locStartLine .. locEndLine]) + ) + ) + or + // Check if an exact filter-location is fully contained in `location`. + // This is slow but only used for testing. + exists( + string filePath, int startLine, int startColumn, int endLine, int endColumn, + int filterStartLine, int filterStartColumn, int filterEndLine, int filterEndColumn + | + location.hasLocationInfo(filePath, startLine, startColumn, endLine, endColumn) and + restrictAlertsToExactLocation(filePath, filterStartLine, filterStartColumn, filterEndLine, + filterEndColumn) and + startLine <= filterStartLine and + (startLine != filterStartLine or startColumn <= filterStartColumn) and + endLine >= filterEndLine and + (endLine != filterEndLine or endColumn >= filterEndColumn) + ) + } } From d65da1f8a1bc92966c5ac1e6a67cc9a2d4f59233 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 1 Jul 2025 15:52:37 +0200 Subject: [PATCH 09/96] Ruby: enable for PolyReDos but document why it still doesnt work --- .../ruby/security/regexp/PolynomialReDoSQuery.qll | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll b/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll index 98a42fcf5e7..0d955d1eb24 100644 --- a/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll +++ b/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll @@ -18,6 +18,18 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node sink) { sink instanceof Sink } predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } + + // Diff-informedness is disabled because of RegExpTerms having incorrect locations when + // the regexp is parsed from a string arising from constant folding. + predicate observeDiffInformedIncrementalMode() { none() } + + Location getASelectedSinkLocation(DataFlow::Node sink) { + result = sink.(Sink).getHighlight().getLocation() + } + + Location getASelectedSinkLocationApprox(DataFlow::Node sink) { + result = sink.(Sink).getRegExp().getRootTerm().getLocation() + } } /** From a46b5f9529e7cffb7cd1ceacdbbc766c7630362c Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 1 Jul 2025 16:05:22 +0200 Subject: [PATCH 10/96] Python: enable diff-informedness for poly redos using approximate related locations --- .../security/dataflow/PolynomialReDoSQuery.qll | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll index 0e52764c195..a6602b30b16 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll @@ -18,21 +18,13 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer } - // Diff-informed incremental mode is currently disabled for this query due to - // API limitations. The query exposes sink.getABacktrackingTerm() as an alert - // location, but there is no way to express that information through - // getASelectedSinkLocation() because there is no @location in the CodeQL - // database that corresponds to a term inside a regular expression. As a - // result, this query could miss alerts in diff-informed incremental mode. - // - // To address this problem, we need to have a version of - // getASelectedSinkLocation() that uses hasLocationInfo() instead of - // returning Location objects. - predicate observeDiffInformedIncrementalMode() { none() } + predicate observeDiffInformedIncrementalMode() { any() } Location getASelectedSinkLocation(DataFlow::Node sink) { result = sink.(Sink).getHighlight().getLocation() - or + } + + Location getASelectedSinkLocationApprox(DataFlow::Node sink) { result = sink.(Sink).getABacktrackingTerm().getLocation() } } From 82d190f4bf298423b26bf9f2729e534d275638f4 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 1 Jul 2025 16:17:24 +0200 Subject: [PATCH 11/96] Java: use approximate related sink locations in polynomial redos --- .../security/regexp/PolynomialReDoSQuery.qll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll b/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll index ba65e13dd61..f5d0190068b 100644 --- a/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll +++ b/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll @@ -47,6 +47,24 @@ module PolynomialRedosConfig implements DataFlow::ConfigSig { node instanceof SimpleTypeSanitizer or node.asExpr().(MethodCall).getMethod() instanceof LengthRestrictedMethod } + + predicate observeDiffInformedIncrementalMode() { any() } + + Location getASelectedSinkLocation(DataFlow::Node sink) { + exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp | + regexp.getRootTerm() = sink.(PolynomialRedosSink).getRegExp() + | + result = sink.getLocation() + ) + } + + Location getASelectedSinkLocationApprox(DataFlow::Node sink) { + exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp | + regexp.getRootTerm() = sink.(PolynomialRedosSink).getRegExp() + | + result = regexp.getLocation() + ) + } } module PolynomialRedosFlow = TaintTracking::Global; From 4a2d7950760f783441057970f2b1f62b6c029336 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 2 Jul 2025 14:38:10 +0200 Subject: [PATCH 12/96] Shared: Make approximate location filtering the default behaviour --- .../security/regexp/PolynomialReDoSQuery.qll | 8 +---- .../dataflow/PolynomialReDoSQuery.qll | 4 +-- .../security/regexp/PolynomialReDoSQuery.qll | 4 +-- shared/dataflow/codeql/dataflow/DataFlow.qll | 36 ------------------- .../codeql/dataflow/internal/DataFlowImpl.qll | 4 --- .../dataflow/internal/DataFlowImplStage1.qll | 8 ++--- shared/util/codeql/util/AlertFiltering.qll | 26 -------------- 7 files changed, 5 insertions(+), 85 deletions(-) diff --git a/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll b/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll index f5d0190068b..767ebc97437 100644 --- a/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll +++ b/java/ql/lib/semmle/code/java/security/regexp/PolynomialReDoSQuery.qll @@ -55,13 +55,7 @@ module PolynomialRedosConfig implements DataFlow::ConfigSig { regexp.getRootTerm() = sink.(PolynomialRedosSink).getRegExp() | result = sink.getLocation() - ) - } - - Location getASelectedSinkLocationApprox(DataFlow::Node sink) { - exists(SuperlinearBackTracking::PolynomialBackTrackingTerm regexp | - regexp.getRootTerm() = sink.(PolynomialRedosSink).getRegExp() - | + or result = regexp.getLocation() ) } diff --git a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll index a6602b30b16..89aa4961e6e 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll @@ -22,9 +22,7 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { Location getASelectedSinkLocation(DataFlow::Node sink) { result = sink.(Sink).getHighlight().getLocation() - } - - Location getASelectedSinkLocationApprox(DataFlow::Node sink) { + or result = sink.(Sink).getABacktrackingTerm().getLocation() } } diff --git a/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll b/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll index 0d955d1eb24..81179717e01 100644 --- a/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll +++ b/ruby/ql/lib/codeql/ruby/security/regexp/PolynomialReDoSQuery.qll @@ -25,9 +25,7 @@ private module PolynomialReDoSConfig implements DataFlow::ConfigSig { Location getASelectedSinkLocation(DataFlow::Node sink) { result = sink.(Sink).getHighlight().getLocation() - } - - Location getASelectedSinkLocationApprox(DataFlow::Node sink) { + or result = sink.(Sink).getRegExp().getRootTerm().getLocation() } } diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 93803af552b..3483287e3b3 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -459,15 +459,6 @@ module Configs Lang> { */ default Location getASelectedSourceLocation(Node source) { result = source.getLocation() } - /** - * Like `getASelectedSourceLocation`, but only has to get a location _containing_ the - * actual location associated with `source`. - * - * This prunes fewer sources than `getASelectedSourceLocation` but leaves room for the possibility - * that a more precise location can be selected in the query. - */ - default Location getASelectedSourceLocationApprox(Node source) { none() } - /** * Gets a location that will be associated with the given `sink` in a * diff-informed query that uses this configuration (see @@ -478,15 +469,6 @@ module Configs Lang> { * report the sink at all, this predicate can be `none()`. */ default Location getASelectedSinkLocation(Node sink) { result = sink.getLocation() } - - /** - * Like `getASelectedSinkLocation`, but only has to get a location _containing_ the - * actual location associated with `sink`. - * - * This prunes fewer sinks than `getASelectedSinkLocation` but leaves room for the possibility - * that a more precise location can be selected in the query. - */ - default Location getASelectedSinkLocationApprox(Node sink) { none() } } /** An input configuration for data flow using flow state. */ @@ -626,15 +608,6 @@ module Configs Lang> { */ default Location getASelectedSourceLocation(Node source) { result = source.getLocation() } - /** - * Like `getASelectedSourceLocation`, but only has to get a location _containing_ the - * actual location associated with `source`. - * - * This prunes fewer sources than `getASelectedSourceLocation` but leaves room for the possibility - * that a more precise location can be selected in the query. - */ - default Location getASelectedSourceLocationApprox(Node source) { none() } - /** * Gets a location that will be associated with the given `sink` in a * diff-informed query that uses this configuration (see @@ -645,15 +618,6 @@ module Configs Lang> { * report the sink at all, this predicate can be `none()`. */ default Location getASelectedSinkLocation(Node sink) { result = sink.getLocation() } - - /** - * Like `getASelectedSinkLocation`, but only has to get a location _containing_ the - * actual location associated with `sink`. - * - * This prunes fewer sinks than `getASelectedSinkLocation` but leaves room for the possibility - * that a more precise location can be selected in the query. - */ - default Location getASelectedSinkLocationApprox(Node sink) { none() } } } diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index b90512bdb23..a7e0736432a 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -145,11 +145,7 @@ module MakeImpl Lang> { Location getASelectedSourceLocation(Node source); - Location getASelectedSourceLocationApprox(Node source); - Location getASelectedSinkLocation(Node sink); - - Location getASelectedSinkLocationApprox(Node sink); } /** diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll index 5e85cab00d9..c7883df0de1 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll @@ -133,9 +133,7 @@ module MakeImplStage1 Lang> { private predicate isFilteredSource(Node source) { Config::isSource(source, _) and if Config::observeDiffInformedIncrementalMode() - then - AlertFiltering::filterByLocation(Config::getASelectedSourceLocation(source)) or - AlertFiltering::filterByLocationApprox(Config::getASelectedSourceLocationApprox(source)) + then AlertFiltering::filterByLocation(Config::getASelectedSourceLocation(source)) else any() } @@ -146,9 +144,7 @@ module MakeImplStage1 Lang> { Config::isSink(sink) ) and if Config::observeDiffInformedIncrementalMode() - then - AlertFiltering::filterByLocation(Config::getASelectedSinkLocation(sink)) or - AlertFiltering::filterByLocationApprox(Config::getASelectedSinkLocationApprox(sink)) + then AlertFiltering::filterByLocation(Config::getASelectedSinkLocation(sink)) else any() } diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index 97e6198a16c..091c2a89d00 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -89,32 +89,6 @@ module AlertFilteringImpl { /** Applies alert filtering to the given location. */ bindingset[location] predicate filterByLocation(Location location) { - not restrictAlertsTo(_, _, _) and not restrictAlertsToExactLocation(_, _, _, _, _) - or - exists(string filePath | - restrictAlertsToEntireFile(filePath) and - location.hasLocationInfo(filePath, _, _, _, _) - or - exists(int line | - restrictAlertsToStartLine(filePath, line) and - location.hasLocationInfo(filePath, line, _, _, _) - ) - ) - or - exists(string filePath, int startLine, int startColumn, int endLine, int endColumn | - restrictAlertsToExactLocation(filePath, startLine, startColumn, endLine, endColumn) - | - location.hasLocationInfo(filePath, startLine, startColumn, endLine, endColumn) - ) - } - - /** - * Holds if some subrange within `location` would be accepted by alert filtering. - * - * There does not need to exist a `Location` corresponding to that subrange. - */ - bindingset[location] - predicate filterByLocationApprox(Location location) { not restrictAlertsTo(_, _, _) and not restrictAlertsToExactLocation(_, _, _, _, _) or exists(string filePath | From d10b9e665c845b302eedb8f7a38aac3842251726 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 4 Jul 2025 16:55:09 +0100 Subject: [PATCH 13/96] Fix linter warnings in Request Forgery tests --- .../Security/CWE-918/RequestForgery.expected | 12 ++++++------ .../test/query-tests/Security/CWE-918/websocket.go | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index 76097b7a5c0..914d4c3c084 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -14,8 +14,8 @@ | websocket.go:129:3:129:62 | call to DialContext | websocket.go:126:21:126:31 | call to Referer | websocket.go:129:38:129:51 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:129:38:129:51 | untrustedInput | WebSocket URL | websocket.go:126:21:126:31 | call to Referer | user-provided value | | websocket.go:155:3:155:45 | call to Dial | websocket.go:154:21:154:31 | call to Referer | websocket.go:155:31:155:44 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:155:31:155:44 | untrustedInput | WebSocket URL | websocket.go:154:21:154:31 | call to Referer | user-provided value | | websocket.go:162:3:162:45 | call to Dial | websocket.go:160:21:160:31 | call to Referer | websocket.go:162:31:162:44 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:162:31:162:44 | untrustedInput | WebSocket URL | websocket.go:160:21:160:31 | call to Referer | user-provided value | -| websocket.go:197:3:197:32 | call to BuildProxy | websocket.go:195:21:195:31 | call to Referer | websocket.go:197:18:197:31 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:197:18:197:31 | untrustedInput | WebSocket URL | websocket.go:195:21:195:31 | call to Referer | user-provided value | -| websocket.go:204:3:204:25 | call to New | websocket.go:202:21:202:31 | call to Referer | websocket.go:204:11:204:24 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:204:11:204:24 | untrustedInput | WebSocket URL | websocket.go:202:21:202:31 | call to Referer | user-provided value | +| websocket.go:197:7:197:36 | call to BuildProxy | websocket.go:195:21:195:31 | call to Referer | websocket.go:197:22:197:35 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:197:22:197:35 | untrustedInput | WebSocket URL | websocket.go:195:21:195:31 | call to Referer | user-provided value | +| websocket.go:204:7:204:29 | call to New | websocket.go:202:21:202:31 | call to Referer | websocket.go:204:15:204:28 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:204:15:204:28 | untrustedInput | WebSocket URL | websocket.go:202:21:202:31 | call to Referer | user-provided value | edges | RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | provenance | Src:MaD:1 | @@ -42,8 +42,8 @@ edges | websocket.go:126:21:126:31 | call to Referer | websocket.go:129:38:129:51 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:154:21:154:31 | call to Referer | websocket.go:155:31:155:44 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:160:21:160:31 | call to Referer | websocket.go:162:31:162:44 | untrustedInput | provenance | Src:MaD:2 | -| websocket.go:195:21:195:31 | call to Referer | websocket.go:197:18:197:31 | untrustedInput | provenance | Src:MaD:2 | -| websocket.go:202:21:202:31 | call to Referer | websocket.go:204:11:204:24 | untrustedInput | provenance | Src:MaD:2 | +| websocket.go:195:21:195:31 | call to Referer | websocket.go:197:22:197:35 | untrustedInput | provenance | Src:MaD:2 | +| websocket.go:202:21:202:31 | call to Referer | websocket.go:204:15:204:28 | untrustedInput | provenance | Src:MaD:2 | models | 1 | Source: net/http; Request; true; FormValue; ; ; ReturnValue; remote; manual | | 2 | Source: net/http; Request; true; Referer; ; ; ReturnValue; remote; manual | @@ -80,7 +80,7 @@ nodes | websocket.go:160:21:160:31 | call to Referer | semmle.label | call to Referer | | websocket.go:162:31:162:44 | untrustedInput | semmle.label | untrustedInput | | websocket.go:195:21:195:31 | call to Referer | semmle.label | call to Referer | -| websocket.go:197:18:197:31 | untrustedInput | semmle.label | untrustedInput | +| websocket.go:197:22:197:35 | untrustedInput | semmle.label | untrustedInput | | websocket.go:202:21:202:31 | call to Referer | semmle.label | call to Referer | -| websocket.go:204:11:204:24 | untrustedInput | semmle.label | untrustedInput | +| websocket.go:204:15:204:28 | untrustedInput | semmle.label | untrustedInput | subpaths diff --git a/go/ql/test/query-tests/Security/CWE-918/websocket.go b/go/ql/test/query-tests/Security/CWE-918/websocket.go index 328200770ae..fb3882000ff 100644 --- a/go/ql/test/query-tests/Security/CWE-918/websocket.go +++ b/go/ql/test/query-tests/Security/CWE-918/websocket.go @@ -166,7 +166,7 @@ func test() { http.HandleFunc("/ex12", func(w http.ResponseWriter, r *http.Request) { untrustedInput := r.Referer() - if "localhost" == untrustedInput { + if untrustedInput == "localhost" { dialer := gobwas.Dialer{} dialer.Dial(context.TODO(), untrustedInput) } @@ -176,8 +176,8 @@ func test() { http.HandleFunc("/ex13", func(w http.ResponseWriter, r *http.Request) { untrustedInput := r.Referer() - if "localhost" == untrustedInput { - sac.New(untrustedInput) + if untrustedInput == "localhost" { + _ = sac.New(untrustedInput) } }) @@ -185,8 +185,8 @@ func test() { http.HandleFunc("/ex14", func(w http.ResponseWriter, r *http.Request) { untrustedInput := r.Referer() - if "localhost" == untrustedInput { - sac.BuildProxy(untrustedInput) + if untrustedInput == "localhost" { + _ = sac.BuildProxy(untrustedInput) } }) @@ -194,14 +194,14 @@ func test() { http.HandleFunc("/ex15", func(w http.ResponseWriter, r *http.Request) { untrustedInput := r.Referer() - sac.BuildProxy(untrustedInput) + _ = sac.BuildProxy(untrustedInput) }) // sac007 websocket New bad http.HandleFunc("/ex16", func(w http.ResponseWriter, r *http.Request) { untrustedInput := r.Referer() - sac.New(untrustedInput) + _ = sac.New(untrustedInput) }) log.Println(http.ListenAndServe(":80", nil)) From 0788a90d886ca66d8e3817bd691962fa85ee7d96 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 4 Jul 2025 16:56:05 +0100 Subject: [PATCH 14/96] Convert RequestForgery test to inline expectations --- .../Security/CWE-918/RequestForgery.go | 4 +- .../Security/CWE-918/RequestForgery.qlref | 4 +- .../test/query-tests/Security/CWE-918/tst.go | 20 +++++----- .../query-tests/Security/CWE-918/websocket.go | 38 +++++++++---------- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.go b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.go index c88e9dc5f74..ab8f907c58b 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.go +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.go @@ -5,10 +5,10 @@ import ( ) func handler(w http.ResponseWriter, req *http.Request) { - target := req.FormValue("target") + target := req.FormValue("target") // $ Source // BAD: `target` is controlled by the attacker - resp, err := http.Get("https://" + target + ".example.com/data/") + resp, err := http.Get("https://" + target + ".example.com/data/") // $ Alert if err != nil { // error handling } diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.qlref b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.qlref index 061679da228..760862973f1 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.qlref +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.qlref @@ -1,2 +1,4 @@ query: Security/CWE-918/RequestForgery.ql -postprocess: utils/test/PrettyPrintModels.ql +postprocess: + - utils/test/PrettyPrintModels.ql + - utils/test/InlineExpectationsTestQuery.ql diff --git a/go/ql/test/query-tests/Security/CWE-918/tst.go b/go/ql/test/query-tests/Security/CWE-918/tst.go index 0e04429580c..00a09fef0f7 100644 --- a/go/ql/test/query-tests/Security/CWE-918/tst.go +++ b/go/ql/test/query-tests/Security/CWE-918/tst.go @@ -7,26 +7,26 @@ import ( ) func handler2(w http.ResponseWriter, req *http.Request) { - tainted := req.FormValue("target") + tainted := req.FormValue("target") // $ Source http.Get("example.com") // OK - http.Get(tainted) // Not OK + http.Get(tainted) // $ Alert http.Head(tainted) // OK - http.Post(tainted, "text/basic", nil) // Not OK + http.Post(tainted, "text/basic", nil) // $ Alert client := &http.Client{} - rq, _ := http.NewRequest("GET", tainted, nil) - client.Do(rq) // Not OK + rq, _ := http.NewRequest("GET", tainted, nil) // $ Sink + client.Do(rq) // $ Alert - rq, _ = http.NewRequestWithContext(context.Background(), "GET", tainted, nil) - client.Do(rq) // Not OK + rq, _ = http.NewRequestWithContext(context.Background(), "GET", tainted, nil) // $ Sink + client.Do(rq) // $ Alert - http.Get("http://" + tainted) // Not OK + http.Get("http://" + tainted) // $ Alert - http.Get("http://example.com" + tainted) // Not OK + http.Get("http://example.com" + tainted) // $ Alert http.Get("http://example.com/" + tainted) // OK @@ -34,7 +34,7 @@ func handler2(w http.ResponseWriter, req *http.Request) { u, _ := url.Parse("http://example.com/relative-path") u.Host = tainted - http.Get(u.String()) // Not OK + http.Get(u.String()) // $ Alert } func main() { diff --git a/go/ql/test/query-tests/Security/CWE-918/websocket.go b/go/ql/test/query-tests/Security/CWE-918/websocket.go index fb3882000ff..15edef6b6cc 100644 --- a/go/ql/test/query-tests/Security/CWE-918/websocket.go +++ b/go/ql/test/query-tests/Security/CWE-918/websocket.go @@ -57,12 +57,12 @@ func test() { // x net websocket dial bad http.HandleFunc("/ex2", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source origin := "http://localhost/" // bad as input is directly passed to dial function - ws, _ := websocket.Dial(untrustedInput, "", origin) + ws, _ := websocket.Dial(untrustedInput, "", origin) // $ Alert var msg = make([]byte, 512) var n int n, _ = ws.Read(msg) @@ -71,12 +71,12 @@ func test() { // x net websocket dialConfig bad http.HandleFunc("/ex3", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source origin := "http://localhost/" // bad as input is directly used - config, _ := websocket.NewConfig(untrustedInput, origin) // good - ws2, _ := websocket.DialConfig(config) + config, _ := websocket.NewConfig(untrustedInput, origin) // $ Sink + ws2, _ := websocket.DialConfig(config) // $ Alert var msg = make([]byte, 512) var n int n, _ = ws2.Read(msg) @@ -85,10 +85,10 @@ func test() { // nhooyr websocket dial bad http.HandleFunc("/ex4", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source // bad as input is used directly - nhooyr.Dial(context.TODO(), untrustedInput, nil) + nhooyr.Dial(context.TODO(), untrustedInput, nil) // $ Alert w.WriteHeader(500) }) @@ -104,10 +104,10 @@ func test() { // gorilla websocket Dialer.Dial bad http.HandleFunc("/ex6", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source dialer := gorilla.Dialer{} - dialer.Dial(untrustedInput, r.Header) + dialer.Dial(untrustedInput, r.Header) // $ Alert }) // gorilla websocket Dialer.Dial good @@ -123,10 +123,10 @@ func test() { // gorilla websocket Dialer.DialContext bad http.HandleFunc("/ex8", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source dialer := gorilla.Dialer{} - dialer.DialContext(context.TODO(), untrustedInput, r.Header) + dialer.DialContext(context.TODO(), untrustedInput, r.Header) // $ Alert }) // gorilla websocket Dialer.DialContext good @@ -151,15 +151,15 @@ func test() { // gobwas websocket Dial bad http.HandleFunc("/ex11", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() - gobwas.Dial(context.TODO(), untrustedInput) + untrustedInput := r.Referer() // $ Source + gobwas.Dial(context.TODO(), untrustedInput) // $ Alert }) // gobwas websocket Dialer.Dial bad http.HandleFunc("/ex12", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source dialer := gobwas.Dialer{} - dialer.Dial(context.TODO(), untrustedInput) + dialer.Dial(context.TODO(), untrustedInput) // $ Alert }) // gobwas websocket Dialer.Dial good @@ -192,16 +192,16 @@ func test() { // sac007 websocket BuildProxy bad http.HandleFunc("/ex15", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source - _ = sac.BuildProxy(untrustedInput) + _ = sac.BuildProxy(untrustedInput) // $ Alert }) // sac007 websocket New bad http.HandleFunc("/ex16", func(w http.ResponseWriter, r *http.Request) { - untrustedInput := r.Referer() + untrustedInput := r.Referer() // $ Source - _ = sac.New(untrustedInput) + _ = sac.New(untrustedInput) // $ Alert }) log.Println(http.ListenAndServe(":80", nil)) From a486549956ce75a7a1a1df56f14849820123c634 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 7 Jul 2025 14:01:00 +0100 Subject: [PATCH 15/96] Update rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml Co-authored-by: Arthur Baars --- rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml index d5e91afa663..ae58b2a077a 100644 --- a/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml @@ -14,7 +14,7 @@ extensions: - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_exact ", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] - ["<_ as tokio::io::util::async_buf_read_ext::AsyncBufReadExt>::split", "Argument[self]", "ReturnValue", "taint", "manual"] From a25330e6ed15ca68e14ab087e7d56a4d44cee535 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:10:59 +0100 Subject: [PATCH 16/96] Rust: Update rustcrypto models. --- .../rust/frameworks/rustcrypto/rustcrypto.model.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml index d1aefe5b983..f29973e377c 100644 --- a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml @@ -3,8 +3,8 @@ extensions: pack: codeql/rust-all extensible: sinkModel data: - - ["::new_with_prefix", "Argument[0]", "hasher-input", "manual"] - - ["::update", "Argument[0]", "hasher-input", "manual"] - - ["::chain_update", "Argument[0]", "hasher-input", "manual"] - - ["::digest", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::new_with_prefix::new_with_prefix", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::new_with_prefix::update", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::new_with_prefix::chain_update", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::new_with_prefix::digest", "Argument[0]", "hasher-input", "manual"] - ["md5::compute", "Argument[0]", "hasher-input", "manual"] From b51940d1e2b40c500bb82265a106c1154ead9e8d Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Wed, 18 Jun 2025 15:32:41 +0100 Subject: [PATCH 17/96] Ruby: add overlay[local] annotations to AST/CFG/SSA layers --- ql/ql/src/codeql/Locations.qll | 2 ++ ql/ql/src/codeql/files/FileSystem.qll | 2 ++ ql/ql/src/codeql_ql/StructuredLogs.qll | 5 +++++ ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll | 12 ++++-------- ql/ql/src/experimental/RA.qll | 5 ++--- ql/ql/src/queries/performance/LargeTupleSum.ql | 1 + ql/ql/test/experimental/raparser.ql | 1 + ruby/ql/lib/codeql/Locations.qll | 2 ++ ruby/ql/lib/codeql/files/FileSystem.qll | 2 ++ ruby/ql/lib/codeql/ruby/AST.qll | 3 +++ ruby/ql/lib/codeql/ruby/Diagnostics.qll | 2 ++ ruby/ql/lib/codeql/ruby/ast/Call.qll | 5 +++++ ruby/ql/lib/codeql/ruby/ast/Constant.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Control.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Erb.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Expr.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Literal.qll | 4 ++++ ruby/ql/lib/codeql/ruby/ast/Method.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Module.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Operation.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Parameter.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Pattern.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Scope.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Statement.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/Variable.qll | 2 ++ ruby/ql/lib/codeql/ruby/ast/internal/AST.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Call.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Control.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Method.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Module.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll | 3 +++ ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll | 2 ++ ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll | 6 ++---- ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll | 3 +++ ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll | 2 ++ ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll | 2 ++ .../lib/codeql/ruby/controlflow/ControlFlowGraph.qll | 2 ++ .../codeql/ruby/controlflow/internal/Completion.qll | 2 ++ .../controlflow/internal/ControlFlowGraphImpl.qll | 2 ++ .../lib/codeql/ruby/controlflow/internal/Guards.qll | 3 +++ .../ruby/controlflow/internal/NonReturning.qll | 2 ++ .../codeql/ruby/controlflow/internal/Splitting.qll | 2 ++ ruby/ql/lib/codeql/ruby/dataflow/SSA.qll | 2 ++ .../ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll | 4 ++++ shared/tree-sitter-extractor/src/generator/mod.rs | 1 + shared/tree-sitter-extractor/src/generator/ql.rs | 9 +++++++++ shared/tree-sitter-extractor/src/generator/ql_gen.rs | 4 ++-- 54 files changed, 151 insertions(+), 17 deletions(-) diff --git a/ql/ql/src/codeql/Locations.qll b/ql/ql/src/codeql/Locations.qll index ae8058c916d..e03c84f98fa 100644 --- a/ql/ql/src/codeql/Locations.qll +++ b/ql/ql/src/codeql/Locations.qll @@ -1,4 +1,6 @@ /** Provides classes for working with locations. */ +overlay[local] +module; import files.FileSystem diff --git a/ql/ql/src/codeql/files/FileSystem.qll b/ql/ql/src/codeql/files/FileSystem.qll index 5a219f3b7f0..52174250af0 100644 --- a/ql/ql/src/codeql/files/FileSystem.qll +++ b/ql/ql/src/codeql/files/FileSystem.qll @@ -1,4 +1,6 @@ /** Provides classes for working with files and folders. */ +overlay[local?] +module; private import codeql_ql.ast.internal.TreeSitter private import codeql.Locations diff --git a/ql/ql/src/codeql_ql/StructuredLogs.qll b/ql/ql/src/codeql_ql/StructuredLogs.qll index 4c0ef69fd55..87527eae1d2 100644 --- a/ql/ql/src/codeql_ql/StructuredLogs.qll +++ b/ql/ql/src/codeql_ql/StructuredLogs.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import ql private import codeql_ql.ast.internal.TreeSitter private import experimental.RA @@ -23,6 +26,7 @@ private float stringToTimestamp(string str) { } bindingset[s] +overlay[global] private Predicate getPredicateFromPosition(string s) { exists(string r, string filepath, int startline | r = "(.*):(\\d+),(\\d+)-(\\d+),(\\d+)" | filepath = s.regexpCapture(r, 1) and @@ -397,6 +401,7 @@ module KindPredicatesLog { string getPosition() { result = this.getString("position") } + overlay[global] Predicate getPredicate() { result = getPredicateFromPosition(this.getPosition()) } /** diff --git a/ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll b/ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll index 2d4a9d65465..c81830e1d59 100644 --- a/ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll +++ b/ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll @@ -23,6 +23,7 @@ private predicate discardLocation(@location_default loc) { ) } +overlay[local] module QL { /** The base class for all AST nodes */ class AstNode extends @ql_ast_node { @@ -67,7 +68,6 @@ module QL { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@ql_ast_node node) { exists(@location_default loc | ql_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -75,7 +75,6 @@ module QL { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @ql_ast_node node) { not isOverlay() and file = getNodeFile(node) } @@ -1315,6 +1314,7 @@ module QL { } } +overlay[local] module Dbscheme { /** The base class for all AST nodes */ class AstNode extends @dbscheme_ast_node { @@ -1359,7 +1359,6 @@ module Dbscheme { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@dbscheme_ast_node node) { exists(@location_default loc | dbscheme_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -1367,7 +1366,6 @@ module Dbscheme { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @dbscheme_ast_node node) { not isOverlay() and file = getNodeFile(node) } @@ -1673,6 +1671,7 @@ module Dbscheme { } } +overlay[local] module Blame { /** The base class for all AST nodes */ class AstNode extends @blame_ast_node { @@ -1717,7 +1716,6 @@ module Blame { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@blame_ast_node node) { exists(@location_default loc | blame_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -1725,7 +1723,6 @@ module Blame { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @blame_ast_node node) { not isOverlay() and file = getNodeFile(node) } @@ -1808,6 +1805,7 @@ module Blame { } } +overlay[local] module JSON { /** The base class for all AST nodes */ class AstNode extends @json_ast_node { @@ -1852,7 +1850,6 @@ module JSON { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@json_ast_node node) { exists(@location_default loc | json_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -1860,7 +1857,6 @@ module JSON { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @json_ast_node node) { not isOverlay() and file = getNodeFile(node) } diff --git a/ql/ql/src/experimental/RA.qll b/ql/ql/src/experimental/RA.qll index 7187ebfc8c7..5eb80455562 100644 --- a/ql/ql/src/experimental/RA.qll +++ b/ql/ql/src/experimental/RA.qll @@ -1,6 +1,5 @@ -/** - * Parses RA expressions. - */ +overlay[local] +module; /** * A predicate that contains RA. diff --git a/ql/ql/src/queries/performance/LargeTupleSum.ql b/ql/ql/src/queries/performance/LargeTupleSum.ql index e5bbed79bbd..4e5ca6622e8 100644 --- a/ql/ql/src/queries/performance/LargeTupleSum.ql +++ b/ql/ql/src/queries/performance/LargeTupleSum.ql @@ -6,6 +6,7 @@ import ql import codeql_ql.StructuredLogs import KindPredicatesLog +overlay[local] module SumCounts implements Fold { int base(PipeLineRun run) { result = sum(int i | | run.getCount(i)) } diff --git a/ql/ql/test/experimental/raparser.ql b/ql/ql/test/experimental/raparser.ql index 29489e2a968..5704b0facdb 100644 --- a/ql/ql/test/experimental/raparser.ql +++ b/ql/ql/test/experimental/raparser.ql @@ -1,5 +1,6 @@ import experimental.RA +overlay[local] class TestPredicate extends string { TestPredicate() { this = "p1" } diff --git a/ruby/ql/lib/codeql/Locations.qll b/ruby/ql/lib/codeql/Locations.qll index 148c6b01f2d..df52d6822a2 100644 --- a/ruby/ql/lib/codeql/Locations.qll +++ b/ruby/ql/lib/codeql/Locations.qll @@ -1,4 +1,6 @@ /** Provides classes for working with locations. */ +overlay[local] +module; import files.FileSystem diff --git a/ruby/ql/lib/codeql/files/FileSystem.qll b/ruby/ql/lib/codeql/files/FileSystem.qll index 528dde52fd9..6cc771fad9d 100644 --- a/ruby/ql/lib/codeql/files/FileSystem.qll +++ b/ruby/ql/lib/codeql/files/FileSystem.qll @@ -1,4 +1,6 @@ /** Provides classes for working with files and folders. */ +overlay[local] +module; private import codeql.Locations private import codeql.util.FileSystem diff --git a/ruby/ql/lib/codeql/ruby/AST.qll b/ruby/ql/lib/codeql/ruby/AST.qll index bd42696a8db..2c2dbdfa532 100644 --- a/ruby/ql/lib/codeql/ruby/AST.qll +++ b/ruby/ql/lib/codeql/ruby/AST.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations import ast.Call import ast.Control diff --git a/ruby/ql/lib/codeql/ruby/Diagnostics.qll b/ruby/ql/lib/codeql/ruby/Diagnostics.qll index 58de14b8fcf..5b55eec3809 100644 --- a/ruby/ql/lib/codeql/ruby/Diagnostics.qll +++ b/ruby/ql/lib/codeql/ruby/Diagnostics.qll @@ -1,4 +1,6 @@ /** Provides classes relating to extraction diagnostics. */ +overlay[local] +module; private import codeql.Locations diff --git a/ruby/ql/lib/codeql/ruby/ast/Call.qll b/ruby/ql/lib/codeql/ruby/ast/Call.qll index 8a69ebd36fb..3a82d0d39b3 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Call.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Call.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Call @@ -52,6 +55,7 @@ class Call extends Expr instanceof CallImpl { final int getNumberOfArguments() { result = super.getNumberOfArgumentsImpl() } /** Gets a potential target of this call, if any. */ + overlay[global] final Callable getATarget() { exists(DataFlowCall c | this = c.asCall().getExpr() and @@ -153,6 +157,7 @@ class MethodCall extends Call instanceof MethodCallImpl { * TODO: When API Graphs is able to resolve calls to methods like `Kernel.send` * this class is no longer necessary and should be removed. */ +overlay[global] class UnknownMethodCall extends MethodCall { UnknownMethodCall() { not exists(this.(Call).getATarget()) } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/Constant.qll index fef057bc88e..9c7ac62e542 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Constant.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Constant diff --git a/ruby/ql/lib/codeql/ruby/ast/Control.qll b/ruby/ql/lib/codeql/ruby/ast/Control.qll index 18182d8268a..5d83e7a62fd 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Control.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Control.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Control diff --git a/ruby/ql/lib/codeql/ruby/ast/Erb.qll b/ruby/ql/lib/codeql/ruby/ast/Erb.qll index 4dbcca73425..4def19f7ceb 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Erb.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Erb.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.Erb private import internal.TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/Expr.qll b/ruby/ql/lib/codeql/ruby/ast/Expr.qll index 5f916fbec5c..8ab203aed87 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Expr.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Expr.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Literal.qll b/ruby/ql/lib/codeql/ruby/ast/Literal.qll index cdeae9e64a6..a32ca16e24c 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Literal.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Literal.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.Regexp as RE private import internal.AST @@ -387,6 +390,7 @@ class RegExpLiteral extends StringlikeLiteral instanceof RegExpLiteralImpl { final predicate hasFreeSpacingFlag() { this.getFlagString().charAt(_) = "x" } /** Returns the root node of the parse tree of this regular expression. */ + overlay[global] final RE::RegExpTerm getParsed() { result = RE::getParsedRegExp(this) } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Method.qll b/ruby/ql/lib/codeql/ruby/ast/Method.qll index 61ee58019d1..60c0c705b31 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Method.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Method.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.controlflow.ControlFlowGraph private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Module.qll b/ruby/ql/lib/codeql/ruby/ast/Module.qll index 9e2ca31ee61..671910bfaef 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Module.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Operation.qll b/ruby/ql/lib/codeql/ruby/ast/Operation.qll index 2e005a207e3..b9046a930b3 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Operation.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Operation.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/Parameter.qll b/ruby/ql/lib/codeql/ruby/ast/Parameter.qll index c4b233b62b6..5b3994378c1 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Parameter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Parameter.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Variable diff --git a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll index ef778664031..f705bf28301 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Pattern diff --git a/ruby/ql/lib/codeql/ruby/ast/Scope.qll b/ruby/ql/lib/codeql/ruby/ast/Scope.qll index 3e8437f79b3..334b36b583f 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Scope.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Scope.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import internal.AST private import internal.Scope diff --git a/ruby/ql/lib/codeql/ruby/ast/Statement.qll b/ruby/ql/lib/codeql/ruby/ast/Statement.qll index 24e18fe4c36..dcd51dbb327 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Statement.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Statement.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/Variable.qll b/ruby/ql/lib/codeql/ruby/ast/Variable.qll index fa00cfb4cc7..f5fb4b60604 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Variable.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Variable.qll @@ -1,4 +1,6 @@ /** Provides classes for modeling program variables. */ +overlay[local] +module; private import codeql.ruby.AST private import internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll b/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll index badcf1d6c6f..ee46fbe8b66 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/AST.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations private import TreeSitter private import codeql.ruby.ast.internal.Call diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll index 5bb34989a90..4f3c236f102 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Call.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import Variable private import codeql.ruby.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll index a04efc1ec94..133cea315c3 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST private import codeql.ruby.ast.internal.Literal diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll index 7b95d67efc4..dd57a0d197d 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Control.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll index 7a69bf5b783..29960486907 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Erb.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + import codeql.Locations private import TreeSitter private import codeql.ruby.ast.Erb diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll index ba4f9e51f4e..fdeec446a93 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.CFG private import AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll index 8af4673d916..6a2df06b349 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import Constant diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll index 075ac5fb8fa..c4dd1abbee0 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Method.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll index 6905dd5ff2d..d222316bf26 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import Scope as Scope diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll index 54c763e24d3..eeec2198b62 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Operation.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll index dc7fb8c7695..8f07554fb0c 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Parameter.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll index c59898d88ee..a30cce32c7c 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Pattern.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.AST private import codeql.ruby.ast.internal.Expr private import codeql.ruby.ast.internal.Parameter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll index 8f5bde5aeec..9ec237012bc 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll index 5d1ee81c013..f2be91a63e5 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll @@ -1,4 +1,6 @@ /** Provides predicates for synthesizing AST nodes. */ +overlay[local] +module; private import AST private import TreeSitter diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll index 4d9cd901f23..dbc7b38b84e 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll @@ -23,6 +23,7 @@ private predicate discardLocation(@location_default loc) { ) } +overlay[local] module Ruby { /** The base class for all AST nodes */ class AstNode extends @ruby_ast_node { @@ -67,7 +68,6 @@ module Ruby { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@ruby_ast_node node) { exists(@location_default loc | ruby_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -75,7 +75,6 @@ module Ruby { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @ruby_ast_node node) { not isOverlay() and file = getNodeFile(node) } @@ -1967,6 +1966,7 @@ module Ruby { } } +overlay[local] module Erb { /** The base class for all AST nodes */ class AstNode extends @erb_ast_node { @@ -2011,7 +2011,6 @@ module Erb { } /** Gets the file containing the given `node`. */ - overlay[local] private @file getNodeFile(@erb_ast_node node) { exists(@location_default loc | erb_ast_node_location(node, loc) | locations_default(loc, result, _, _, _, _) @@ -2019,7 +2018,6 @@ module Erb { } /** Holds if `node` is in the `file` and is part of the overlay base database. */ - overlay[local] private predicate discardableAstNode(@file file, @erb_ast_node node) { not isOverlay() and file = getNodeFile(node) } diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll index bea1ddadbfb..7c130220a86 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import TreeSitter private import codeql.ruby.AST private import codeql.ruby.CFG diff --git a/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll b/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll index f70062ad24f..93253371198 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/BasicBlocks.qll @@ -1,4 +1,6 @@ /** Provides classes representing basic blocks. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll index c822450bf89..16d0a69fcc3 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll @@ -1,4 +1,6 @@ /** Provides classes representing nodes in a control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.controlflow.BasicBlocks diff --git a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll index dee31d8e901..f3c5dcd08f3 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll @@ -1,4 +1,6 @@ /** Provides classes representing the control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.controlflow.BasicBlocks diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll index 83ea11e9d23..b8edf83c20d 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll @@ -3,6 +3,8 @@ * * A completion represents how a statement or expression terminates. */ +overlay[local] +module; private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll index dd672ba982d..d0d418a839f 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -2,6 +2,8 @@ * Provides an implementation for constructing control-flow graphs (CFGs) from * abstract syntax trees (ASTs), using the shared library from `codeql.controlflow.Cfg`. */ +overlay[local] +module; private import codeql.controlflow.Cfg as CfgShared private import codeql.ruby.AST diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll index 1161a061581..a60102e017c 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Guards.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ruby.CFG /** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */ diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll index e1927a0b1c9..45b299a5d2b 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/NonReturning.qll @@ -1,4 +1,6 @@ /** Provides a simple analysis for identifying calls that will not return. */ +overlay[local] +module; private import codeql.ruby.AST private import Completion diff --git a/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll b/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll index 5331a3d26b6..146d5927479 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/internal/Splitting.qll @@ -1,6 +1,8 @@ /** * Provides classes and predicates relevant for splitting the control flow graph. */ +overlay[local] +module; private import codeql.ruby.AST as Ast private import Completion as Comp diff --git a/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll b/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll index 07721d33334..1478d9ed9d6 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/SSA.qll @@ -1,6 +1,8 @@ /** * Provides the module `Ssa` for working with static single assignment (SSA) form. */ +overlay[local] +module; /** * Provides classes for working with static single assignment (SSA) form. diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll index adbec18be64..3e1d27a17ba 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll @@ -1,3 +1,6 @@ +overlay[local] +module; + private import codeql.ssa.Ssa as SsaImplCommon private import codeql.ruby.AST private import codeql.ruby.CFG as Cfg @@ -393,6 +396,7 @@ private module Cached { signature predicate guardChecksSig(Cfg::CfgNodes::AstCfgNode g, Cfg::CfgNode e, boolean branch); + overlay[global] cached // nothing is actually cached module BarrierGuard { private predicate guardChecksAdjTypes( diff --git a/shared/tree-sitter-extractor/src/generator/mod.rs b/shared/tree-sitter-extractor/src/generator/mod.rs index d9e6e00a121..5e58611092b 100644 --- a/shared/tree-sitter-extractor/src/generator/mod.rs +++ b/shared/tree-sitter-extractor/src/generator/mod.rs @@ -120,6 +120,7 @@ pub fn generate( qldoc: None, name: &language.name, body, + overlay: Some(ql::OverlayAnnotation::Local), })], )?; } diff --git a/shared/tree-sitter-extractor/src/generator/ql.rs b/shared/tree-sitter-extractor/src/generator/ql.rs index e4c87b61bdb..b1e319afb1e 100644 --- a/shared/tree-sitter-extractor/src/generator/ql.rs +++ b/shared/tree-sitter-extractor/src/generator/ql.rs @@ -95,6 +95,7 @@ pub struct Module<'a> { pub qldoc: Option, pub name: &'a str, pub body: Vec>, + pub overlay: Option, } impl fmt::Display for Module<'_> { @@ -102,6 +103,14 @@ impl fmt::Display for Module<'_> { if let Some(qldoc) = &self.qldoc { write!(f, "/** {} */", qldoc)?; } + if let Some(overlay_annotation) = &self.overlay { + write!(f, "overlay[")?; + match overlay_annotation { + OverlayAnnotation::Local => write!(f, "local")?, + OverlayAnnotation::DiscardEntity => write!(f, "discard_entity")?, + } + write!(f, "] ")?; + } writeln!(f, "module {} {{ ", self.name)?; for decl in &self.body { writeln!(f, " {}", decl)?; diff --git a/shared/tree-sitter-extractor/src/generator/ql_gen.rs b/shared/tree-sitter-extractor/src/generator/ql_gen.rs index 8b6c9c18c6f..2cfaf5715ca 100644 --- a/shared/tree-sitter-extractor/src/generator/ql_gen.rs +++ b/shared/tree-sitter-extractor/src/generator/ql_gen.rs @@ -286,7 +286,7 @@ pub fn create_get_node_file_predicate<'a>( overridden: false, is_private: true, is_final: false, - overlay: Some(ql::OverlayAnnotation::Local), + overlay: None, return_type: Some(ql::Type::At("file")), formal_parameters: vec![ql::FormalParameter { name: "node", @@ -327,7 +327,7 @@ pub fn create_discardable_ast_node_predicate(ast_node_name: &str) -> ql::Predica overridden: false, is_private: true, is_final: false, - overlay: Some(ql::OverlayAnnotation::Local), + overlay: None, return_type: None, formal_parameters: vec![ ql::FormalParameter { From d437a096f1063dd86f913cb4af08fe4cf02d9980 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 8 Jul 2025 13:20:04 +0100 Subject: [PATCH 18/96] Test more client request URL sinks --- .../Security/CWE-918/RequestForgery.expected | 74 +++++++++++-------- .../test/query-tests/Security/CWE-918/tst.go | 16 ++-- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index 914d4c3c084..53b348c479f 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -2,11 +2,15 @@ | RequestForgery.go:11:15:11:66 | call to Get | RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | The $@ of this request depends on a $@. | RequestForgery.go:11:24:11:65 | ...+... | URL | RequestForgery.go:8:12:8:34 | call to FormValue | user-provided value | | tst.go:14:2:14:18 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | The $@ of this request depends on a $@. | tst.go:14:11:14:17 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:18:2:18:38 | call to Post | tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | The $@ of this request depends on a $@. | tst.go:18:12:18:18 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:22:2:22:14 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:21:34:21:40 | tainted | The $@ of this request depends on a $@. | tst.go:21:34:21:40 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:25:2:25:14 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:24:66:24:72 | tainted | The $@ of this request depends on a $@. | tst.go:24:66:24:72 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:27:2:27:30 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:27:11:27:29 | ...+... | The $@ of this request depends on a $@. | tst.go:27:11:27:29 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:29:2:29:41 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:29:11:29:40 | ...+... | The $@ of this request depends on a $@. | tst.go:29:11:29:40 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:37:2:37:21 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:37:11:37:20 | call to String | The $@ of this request depends on a $@. | tst.go:37:11:37:20 | call to String | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:20:2:20:28 | call to PostForm | tst.go:10:13:10:35 | call to FormValue | tst.go:20:16:20:22 | tainted | The $@ of this request depends on a $@. | tst.go:20:16:20:22 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:24:2:24:15 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:23:35:23:41 | tainted | The $@ of this request depends on a $@. | tst.go:23:35:23:41 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:27:2:27:15 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:26:68:26:74 | tainted | The $@ of this request depends on a $@. | tst.go:26:68:26:74 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:29:2:29:20 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:29:13:29:19 | tainted | The $@ of this request depends on a $@. | tst.go:29:13:29:19 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:30:2:30:40 | call to Post | tst.go:10:13:10:35 | call to FormValue | tst.go:30:14:30:20 | tainted | The $@ of this request depends on a $@. | tst.go:30:14:30:20 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:31:2:31:30 | call to PostForm | tst.go:10:13:10:35 | call to FormValue | tst.go:31:18:31:24 | tainted | The $@ of this request depends on a $@. | tst.go:31:18:31:24 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:33:2:33:30 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:33:11:33:29 | ...+... | The $@ of this request depends on a $@. | tst.go:33:11:33:29 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:35:2:35:41 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:35:11:35:40 | ...+... | The $@ of this request depends on a $@. | tst.go:35:11:35:40 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:43:2:43:21 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:43:11:43:20 | call to String | The $@ of this request depends on a $@. | tst.go:43:11:43:20 | call to String | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | websocket.go:65:12:65:53 | call to Dial | websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:65:27:65:40 | untrustedInput | WebSocket URL | websocket.go:60:21:60:31 | call to Referer | user-provided value | | websocket.go:79:13:79:40 | call to DialConfig | websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:78:36:78:49 | untrustedInput | WebSocket URL | websocket.go:74:21:74:31 | call to Referer | user-provided value | | websocket.go:91:3:91:50 | call to Dial | websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:91:31:91:44 | untrustedInput | WebSocket URL | websocket.go:88:21:88:31 | call to Referer | user-provided value | @@ -20,21 +24,25 @@ edges | RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:21:34:21:40 | tainted | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:24:66:24:72 | tainted | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:27:11:27:29 | ...+... | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:29:11:29:40 | ...+... | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:36:11:36:17 | tainted | provenance | Src:MaD:1 | -| tst.go:35:2:35:2 | definition of u [pointer] | tst.go:36:2:36:2 | u [pointer] | provenance | | -| tst.go:36:2:36:2 | implicit dereference | tst.go:35:2:35:2 | definition of u [pointer] | provenance | | -| tst.go:36:2:36:2 | implicit dereference | tst.go:36:2:36:2 | u | provenance | | -| tst.go:36:2:36:2 | implicit dereference | tst.go:37:11:37:11 | u | provenance | | -| tst.go:36:2:36:2 | u | tst.go:36:2:36:2 | implicit dereference | provenance | | -| tst.go:36:2:36:2 | u | tst.go:37:11:37:11 | u | provenance | | -| tst.go:36:2:36:2 | u [pointer] | tst.go:36:2:36:2 | implicit dereference | provenance | | -| tst.go:36:11:36:17 | tainted | tst.go:36:2:36:2 | u | provenance | Config | -| tst.go:36:11:36:17 | tainted | tst.go:37:11:37:11 | u | provenance | Config | -| tst.go:37:11:37:11 | u | tst.go:37:11:37:20 | call to String | provenance | MaD:3 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:20:16:20:22 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:23:35:23:41 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:26:68:26:74 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:29:13:29:19 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:30:14:30:20 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:31:18:31:24 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:33:11:33:29 | ...+... | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:35:11:35:40 | ...+... | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:42:11:42:17 | tainted | provenance | Src:MaD:1 | +| tst.go:41:2:41:2 | definition of u [pointer] | tst.go:42:2:42:2 | u [pointer] | provenance | | +| tst.go:42:2:42:2 | implicit dereference | tst.go:41:2:41:2 | definition of u [pointer] | provenance | | +| tst.go:42:2:42:2 | implicit dereference | tst.go:42:2:42:2 | u | provenance | | +| tst.go:42:2:42:2 | implicit dereference | tst.go:43:11:43:11 | u | provenance | | +| tst.go:42:2:42:2 | u | tst.go:42:2:42:2 | implicit dereference | provenance | | +| tst.go:42:2:42:2 | u | tst.go:43:11:43:11 | u | provenance | | +| tst.go:42:2:42:2 | u [pointer] | tst.go:42:2:42:2 | implicit dereference | provenance | | +| tst.go:42:11:42:17 | tainted | tst.go:42:2:42:2 | u | provenance | Config | +| tst.go:42:11:42:17 | tainted | tst.go:43:11:43:11 | u | provenance | Config | +| tst.go:43:11:43:11 | u | tst.go:43:11:43:20 | call to String | provenance | MaD:3 | | websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | provenance | Src:MaD:2 | @@ -54,17 +62,21 @@ nodes | tst.go:10:13:10:35 | call to FormValue | semmle.label | call to FormValue | | tst.go:14:11:14:17 | tainted | semmle.label | tainted | | tst.go:18:12:18:18 | tainted | semmle.label | tainted | -| tst.go:21:34:21:40 | tainted | semmle.label | tainted | -| tst.go:24:66:24:72 | tainted | semmle.label | tainted | -| tst.go:27:11:27:29 | ...+... | semmle.label | ...+... | -| tst.go:29:11:29:40 | ...+... | semmle.label | ...+... | -| tst.go:35:2:35:2 | definition of u [pointer] | semmle.label | definition of u [pointer] | -| tst.go:36:2:36:2 | implicit dereference | semmle.label | implicit dereference | -| tst.go:36:2:36:2 | u | semmle.label | u | -| tst.go:36:2:36:2 | u [pointer] | semmle.label | u [pointer] | -| tst.go:36:11:36:17 | tainted | semmle.label | tainted | -| tst.go:37:11:37:11 | u | semmle.label | u | -| tst.go:37:11:37:20 | call to String | semmle.label | call to String | +| tst.go:20:16:20:22 | tainted | semmle.label | tainted | +| tst.go:23:35:23:41 | tainted | semmle.label | tainted | +| tst.go:26:68:26:74 | tainted | semmle.label | tainted | +| tst.go:29:13:29:19 | tainted | semmle.label | tainted | +| tst.go:30:14:30:20 | tainted | semmle.label | tainted | +| tst.go:31:18:31:24 | tainted | semmle.label | tainted | +| tst.go:33:11:33:29 | ...+... | semmle.label | ...+... | +| tst.go:35:11:35:40 | ...+... | semmle.label | ...+... | +| tst.go:41:2:41:2 | definition of u [pointer] | semmle.label | definition of u [pointer] | +| tst.go:42:2:42:2 | implicit dereference | semmle.label | implicit dereference | +| tst.go:42:2:42:2 | u | semmle.label | u | +| tst.go:42:2:42:2 | u [pointer] | semmle.label | u [pointer] | +| tst.go:42:11:42:17 | tainted | semmle.label | tainted | +| tst.go:43:11:43:11 | u | semmle.label | u | +| tst.go:43:11:43:20 | call to String | semmle.label | call to String | | websocket.go:60:21:60:31 | call to Referer | semmle.label | call to Referer | | websocket.go:65:27:65:40 | untrustedInput | semmle.label | untrustedInput | | websocket.go:74:21:74:31 | call to Referer | semmle.label | call to Referer | diff --git a/go/ql/test/query-tests/Security/CWE-918/tst.go b/go/ql/test/query-tests/Security/CWE-918/tst.go index 00a09fef0f7..5ca6641fb06 100644 --- a/go/ql/test/query-tests/Security/CWE-918/tst.go +++ b/go/ql/test/query-tests/Security/CWE-918/tst.go @@ -17,12 +17,18 @@ func handler2(w http.ResponseWriter, req *http.Request) { http.Post(tainted, "text/basic", nil) // $ Alert - client := &http.Client{} - rq, _ := http.NewRequest("GET", tainted, nil) // $ Sink - client.Do(rq) // $ Alert + http.PostForm(tainted, nil) // $ Alert - rq, _ = http.NewRequestWithContext(context.Background(), "GET", tainted, nil) // $ Sink - client.Do(rq) // $ Alert + client := &http.Client{} + rq1, _ := http.NewRequest("GET", tainted, nil) // $ Sink + client.Do(rq1) // $ Alert + + rq2, _ := http.NewRequestWithContext(context.Background(), "GET", tainted, nil) // $ Sink + client.Do(rq2) // $ Alert + + client.Get(tainted) // $ Alert + client.Post(tainted, "text/basic", nil) // $ Alert + client.PostForm(tainted, nil) // $ Alert http.Get("http://" + tainted) // $ Alert From 71703aa497fecf4d0208050954c67df2eabc6636 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 8 Jul 2025 14:29:11 +0100 Subject: [PATCH 19/96] Improve formatting of some QL --- go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll b/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll index dded5092bcc..97692186dcc 100644 --- a/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll +++ b/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll @@ -179,12 +179,11 @@ module NetHttp { private class RequestCall extends Http::ClientRequest::Range, DataFlow::CallNode { RequestCall() { exists(string functionName | - ( - this.getTarget().hasQualifiedName("net/http", functionName) - or - this.getTarget().(Method).hasQualifiedName("net/http", "Client", functionName) - ) and - (functionName = "Get" or functionName = "Post" or functionName = "PostForm") + this.getTarget().hasQualifiedName("net/http", functionName) + or + this.getTarget().(Method).hasQualifiedName("net/http", "Client", functionName) + | + functionName = ["Get", "Post", "PostForm"] ) } From 990043ce8686cc88ecf7a5c52a556ee76b03a771 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 8 Jul 2025 14:31:48 +0100 Subject: [PATCH 20/96] Add net/http.Head and net/http.Client.Head as client requests They were previously deliberately excluded. --- .../semmle/go/frameworks/stdlib/NetHttp.qll | 2 +- .../Security/CWE-918/RequestForgery.expected | 64 ++++++++++--------- .../test/query-tests/Security/CWE-918/tst.go | 3 +- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll b/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll index 97692186dcc..9a917f05ff5 100644 --- a/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll +++ b/go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll @@ -183,7 +183,7 @@ module NetHttp { or this.getTarget().(Method).hasQualifiedName("net/http", "Client", functionName) | - functionName = ["Get", "Post", "PostForm"] + functionName = ["Get", "Head", "Post", "PostForm"] ) } diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index 53b348c479f..696d8dd700b 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -1,16 +1,18 @@ #select | RequestForgery.go:11:15:11:66 | call to Get | RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | The $@ of this request depends on a $@. | RequestForgery.go:11:24:11:65 | ...+... | URL | RequestForgery.go:8:12:8:34 | call to FormValue | user-provided value | | tst.go:14:2:14:18 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | The $@ of this request depends on a $@. | tst.go:14:11:14:17 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:16:2:16:19 | call to Head | tst.go:10:13:10:35 | call to FormValue | tst.go:16:12:16:18 | tainted | The $@ of this request depends on a $@. | tst.go:16:12:16:18 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:18:2:18:38 | call to Post | tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | The $@ of this request depends on a $@. | tst.go:18:12:18:18 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:20:2:20:28 | call to PostForm | tst.go:10:13:10:35 | call to FormValue | tst.go:20:16:20:22 | tainted | The $@ of this request depends on a $@. | tst.go:20:16:20:22 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:24:2:24:15 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:23:35:23:41 | tainted | The $@ of this request depends on a $@. | tst.go:23:35:23:41 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:27:2:27:15 | call to Do | tst.go:10:13:10:35 | call to FormValue | tst.go:26:68:26:74 | tainted | The $@ of this request depends on a $@. | tst.go:26:68:26:74 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | tst.go:29:2:29:20 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:29:13:29:19 | tainted | The $@ of this request depends on a $@. | tst.go:29:13:29:19 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:30:2:30:40 | call to Post | tst.go:10:13:10:35 | call to FormValue | tst.go:30:14:30:20 | tainted | The $@ of this request depends on a $@. | tst.go:30:14:30:20 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:31:2:31:30 | call to PostForm | tst.go:10:13:10:35 | call to FormValue | tst.go:31:18:31:24 | tainted | The $@ of this request depends on a $@. | tst.go:31:18:31:24 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:33:2:33:30 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:33:11:33:29 | ...+... | The $@ of this request depends on a $@. | tst.go:33:11:33:29 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:35:2:35:41 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:35:11:35:40 | ...+... | The $@ of this request depends on a $@. | tst.go:35:11:35:40 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | -| tst.go:43:2:43:21 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:43:11:43:20 | call to String | The $@ of this request depends on a $@. | tst.go:43:11:43:20 | call to String | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:30:2:30:21 | call to Head | tst.go:10:13:10:35 | call to FormValue | tst.go:30:14:30:20 | tainted | The $@ of this request depends on a $@. | tst.go:30:14:30:20 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:31:2:31:40 | call to Post | tst.go:10:13:10:35 | call to FormValue | tst.go:31:14:31:20 | tainted | The $@ of this request depends on a $@. | tst.go:31:14:31:20 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:32:2:32:30 | call to PostForm | tst.go:10:13:10:35 | call to FormValue | tst.go:32:18:32:24 | tainted | The $@ of this request depends on a $@. | tst.go:32:18:32:24 | tainted | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:34:2:34:30 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:34:11:34:29 | ...+... | The $@ of this request depends on a $@. | tst.go:34:11:34:29 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:36:2:36:41 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:36:11:36:40 | ...+... | The $@ of this request depends on a $@. | tst.go:36:11:36:40 | ...+... | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | +| tst.go:44:2:44:21 | call to Get | tst.go:10:13:10:35 | call to FormValue | tst.go:44:11:44:20 | call to String | The $@ of this request depends on a $@. | tst.go:44:11:44:20 | call to String | URL | tst.go:10:13:10:35 | call to FormValue | user-provided value | | websocket.go:65:12:65:53 | call to Dial | websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:65:27:65:40 | untrustedInput | WebSocket URL | websocket.go:60:21:60:31 | call to Referer | user-provided value | | websocket.go:79:13:79:40 | call to DialConfig | websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:78:36:78:49 | untrustedInput | WebSocket URL | websocket.go:74:21:74:31 | call to Referer | user-provided value | | websocket.go:91:3:91:50 | call to Dial | websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | The $@ of this request depends on a $@. | websocket.go:91:31:91:44 | untrustedInput | WebSocket URL | websocket.go:88:21:88:31 | call to Referer | user-provided value | @@ -23,26 +25,28 @@ edges | RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:16:12:16:18 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:20:16:20:22 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:23:35:23:41 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:26:68:26:74 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:29:13:29:19 | tainted | provenance | Src:MaD:1 | | tst.go:10:13:10:35 | call to FormValue | tst.go:30:14:30:20 | tainted | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:31:18:31:24 | tainted | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:33:11:33:29 | ...+... | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:35:11:35:40 | ...+... | provenance | Src:MaD:1 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:42:11:42:17 | tainted | provenance | Src:MaD:1 | -| tst.go:41:2:41:2 | definition of u [pointer] | tst.go:42:2:42:2 | u [pointer] | provenance | | -| tst.go:42:2:42:2 | implicit dereference | tst.go:41:2:41:2 | definition of u [pointer] | provenance | | -| tst.go:42:2:42:2 | implicit dereference | tst.go:42:2:42:2 | u | provenance | | -| tst.go:42:2:42:2 | implicit dereference | tst.go:43:11:43:11 | u | provenance | | -| tst.go:42:2:42:2 | u | tst.go:42:2:42:2 | implicit dereference | provenance | | -| tst.go:42:2:42:2 | u | tst.go:43:11:43:11 | u | provenance | | -| tst.go:42:2:42:2 | u [pointer] | tst.go:42:2:42:2 | implicit dereference | provenance | | -| tst.go:42:11:42:17 | tainted | tst.go:42:2:42:2 | u | provenance | Config | -| tst.go:42:11:42:17 | tainted | tst.go:43:11:43:11 | u | provenance | Config | -| tst.go:43:11:43:11 | u | tst.go:43:11:43:20 | call to String | provenance | MaD:3 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:31:14:31:20 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:32:18:32:24 | tainted | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:34:11:34:29 | ...+... | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:36:11:36:40 | ...+... | provenance | Src:MaD:1 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:43:11:43:17 | tainted | provenance | Src:MaD:1 | +| tst.go:42:2:42:2 | definition of u [pointer] | tst.go:43:2:43:2 | u [pointer] | provenance | | +| tst.go:43:2:43:2 | implicit dereference | tst.go:42:2:42:2 | definition of u [pointer] | provenance | | +| tst.go:43:2:43:2 | implicit dereference | tst.go:43:2:43:2 | u | provenance | | +| tst.go:43:2:43:2 | implicit dereference | tst.go:44:11:44:11 | u | provenance | | +| tst.go:43:2:43:2 | u | tst.go:43:2:43:2 | implicit dereference | provenance | | +| tst.go:43:2:43:2 | u | tst.go:44:11:44:11 | u | provenance | | +| tst.go:43:2:43:2 | u [pointer] | tst.go:43:2:43:2 | implicit dereference | provenance | | +| tst.go:43:11:43:17 | tainted | tst.go:43:2:43:2 | u | provenance | Config | +| tst.go:43:11:43:17 | tainted | tst.go:44:11:44:11 | u | provenance | Config | +| tst.go:44:11:44:11 | u | tst.go:44:11:44:20 | call to String | provenance | MaD:3 | | websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | provenance | Src:MaD:2 | | websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | provenance | Src:MaD:2 | @@ -61,22 +65,24 @@ nodes | RequestForgery.go:11:24:11:65 | ...+... | semmle.label | ...+... | | tst.go:10:13:10:35 | call to FormValue | semmle.label | call to FormValue | | tst.go:14:11:14:17 | tainted | semmle.label | tainted | +| tst.go:16:12:16:18 | tainted | semmle.label | tainted | | tst.go:18:12:18:18 | tainted | semmle.label | tainted | | tst.go:20:16:20:22 | tainted | semmle.label | tainted | | tst.go:23:35:23:41 | tainted | semmle.label | tainted | | tst.go:26:68:26:74 | tainted | semmle.label | tainted | | tst.go:29:13:29:19 | tainted | semmle.label | tainted | | tst.go:30:14:30:20 | tainted | semmle.label | tainted | -| tst.go:31:18:31:24 | tainted | semmle.label | tainted | -| tst.go:33:11:33:29 | ...+... | semmle.label | ...+... | -| tst.go:35:11:35:40 | ...+... | semmle.label | ...+... | -| tst.go:41:2:41:2 | definition of u [pointer] | semmle.label | definition of u [pointer] | -| tst.go:42:2:42:2 | implicit dereference | semmle.label | implicit dereference | -| tst.go:42:2:42:2 | u | semmle.label | u | -| tst.go:42:2:42:2 | u [pointer] | semmle.label | u [pointer] | -| tst.go:42:11:42:17 | tainted | semmle.label | tainted | -| tst.go:43:11:43:11 | u | semmle.label | u | -| tst.go:43:11:43:20 | call to String | semmle.label | call to String | +| tst.go:31:14:31:20 | tainted | semmle.label | tainted | +| tst.go:32:18:32:24 | tainted | semmle.label | tainted | +| tst.go:34:11:34:29 | ...+... | semmle.label | ...+... | +| tst.go:36:11:36:40 | ...+... | semmle.label | ...+... | +| tst.go:42:2:42:2 | definition of u [pointer] | semmle.label | definition of u [pointer] | +| tst.go:43:2:43:2 | implicit dereference | semmle.label | implicit dereference | +| tst.go:43:2:43:2 | u | semmle.label | u | +| tst.go:43:2:43:2 | u [pointer] | semmle.label | u [pointer] | +| tst.go:43:11:43:17 | tainted | semmle.label | tainted | +| tst.go:44:11:44:11 | u | semmle.label | u | +| tst.go:44:11:44:20 | call to String | semmle.label | call to String | | websocket.go:60:21:60:31 | call to Referer | semmle.label | call to Referer | | websocket.go:65:27:65:40 | untrustedInput | semmle.label | untrustedInput | | websocket.go:74:21:74:31 | call to Referer | semmle.label | call to Referer | diff --git a/go/ql/test/query-tests/Security/CWE-918/tst.go b/go/ql/test/query-tests/Security/CWE-918/tst.go index 5ca6641fb06..44a172ddad0 100644 --- a/go/ql/test/query-tests/Security/CWE-918/tst.go +++ b/go/ql/test/query-tests/Security/CWE-918/tst.go @@ -13,7 +13,7 @@ func handler2(w http.ResponseWriter, req *http.Request) { http.Get(tainted) // $ Alert - http.Head(tainted) // OK + http.Head(tainted) // $ Alert http.Post(tainted, "text/basic", nil) // $ Alert @@ -27,6 +27,7 @@ func handler2(w http.ResponseWriter, req *http.Request) { client.Do(rq2) // $ Alert client.Get(tainted) // $ Alert + client.Head(tainted) // $ Alert client.Post(tainted, "text/basic", nil) // $ Alert client.PostForm(tainted, nil) // $ Alert From 7211f4ace37e13b28ff20eb2b16d7cd334e55f1e Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:01:43 +0100 Subject: [PATCH 21/96] Update rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml Co-authored-by: Arthur Baars --- .../rust/frameworks/rustcrypto/rustcrypto.model.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml index f29973e377c..84f3247d782 100644 --- a/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml @@ -3,8 +3,8 @@ extensions: pack: codeql/rust-all extensible: sinkModel data: - - ["<_ as digest::digest::Digest>::new_with_prefix::new_with_prefix", "Argument[0]", "hasher-input", "manual"] - - ["<_ as digest::digest::Digest>::new_with_prefix::update", "Argument[0]", "hasher-input", "manual"] - - ["<_ as digest::digest::Digest>::new_with_prefix::chain_update", "Argument[0]", "hasher-input", "manual"] - - ["<_ as digest::digest::Digest>::new_with_prefix::digest", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::new_with_prefix", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::update", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::chain_update", "Argument[0]", "hasher-input", "manual"] + - ["<_ as digest::digest::Digest>::digest", "Argument[0]", "hasher-input", "manual"] - ["md5::compute", "Argument[0]", "hasher-input", "manual"] From d19259e6bb64597d5fde7fd03efdb3fe8e441d3a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:03:44 +0100 Subject: [PATCH 22/96] Update rust/ql/test/library-tests/frameworks/postgres/main.rs Co-authored-by: Arthur Baars --- rust/ql/test/library-tests/frameworks/postgres/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/postgres/main.rs b/rust/ql/test/library-tests/frameworks/postgres/main.rs index 1ca39fb9427..6f0f730787f 100644 --- a/rust/ql/test/library-tests/frameworks/postgres/main.rs +++ b/rust/ql/test/library-tests/frameworks/postgres/main.rs @@ -33,9 +33,10 @@ fn main() -> Result<(), Box> { // conn.query_typed_raw(query.as_str(), &[])?; for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink - let id: i32 = row.get("id"); // $ MISSING: database-read - let name: &str = row.try_get("name")?; // $ MISSING: database-read - let age: i32 = row.try_get("age").unwrap(); // $ MISSING: database-read + let row: &postgres::Row = row; + let id: i32 = row.get("id"); // $ database-read + let name: &str = row.try_get("name")?; // $ database-read + let age: i32 = row.try_get("age").unwrap(); // $ database-read println!("found person: {} {} {}", id, name, age); } From b1d5b8175c578707f0c5ed8184cba85d8316bc0a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:10:55 +0100 Subject: [PATCH 23/96] Rust: Add the original test back as well. --- .../test/library-tests/frameworks/postgres/main.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/postgres/main.rs b/rust/ql/test/library-tests/frameworks/postgres/main.rs index 6f0f730787f..28f6abbc41b 100644 --- a/rust/ql/test/library-tests/frameworks/postgres/main.rs +++ b/rust/ql/test/library-tests/frameworks/postgres/main.rs @@ -34,9 +34,16 @@ fn main() -> Result<(), Box> { for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink let row: &postgres::Row = row; - let id: i32 = row.get("id"); // $ database-read - let name: &str = row.try_get("name")?; // $ database-read - let age: i32 = row.try_get("age").unwrap(); // $ database-read + let id: i32 = row.get("id"); // $ database-read + let name: &str = row.try_get("name")?; // $ database-read + let age: i32 = row.try_get("age").unwrap(); // $ database-read + println!("found person: {} {} {}", id, name, age); + } + + for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink + let id: i32 = row.get("id"); // $ MISSING: database-read + let name: &str = row.try_get("name")?; // $ MISSING: database-read + let age: i32 = row.try_get("age").unwrap(); // $ MISSING: database-read println!("found person: {} {} {}", id, name, age); } From f4f919635a7ee0eb9accf3c76138282cc758c23b Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Tue, 8 Jul 2025 10:17:29 -0400 Subject: [PATCH 24/96] Correctly specify regex. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jaroslav Lobačevski --- .../ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll index 8c6471b3c58..0db3b2f7f88 100644 --- a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll +++ b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll @@ -264,7 +264,7 @@ class ArtifactPoisoningSink extends DataFlow::Node { download.getAFollowingStep() = poisonable and // excluding artifacts downloaded to /tmp and runner.tmp not download.getPath().regexpMatch("^/tmp.*") and - not download.getPath().regexpMatch("^\\${{\\s?runner.temp\\s?}}.*") and + not download.getPath().regexpMatch("^\\$\\{\\{\\s?runner\\.temp\\s?}}.*") and ( poisonable.(Run).getScript() = this.asExpr() and ( From 5d6a5d5cbbe5f15852f4fa5778d7fb094edfdd7f Mon Sep 17 00:00:00 2001 From: AdnaneKhan Date: Tue, 8 Jul 2025 10:35:39 -0400 Subject: [PATCH 25/96] Add change notes and test workflow file. --- actions/ql/lib/change-notes/2025-07-08.md | 4 ++++ .../.github/workflows/artifactpoison93.yml | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 actions/ql/lib/change-notes/2025-07-08.md create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml diff --git a/actions/ql/lib/change-notes/2025-07-08.md b/actions/ql/lib/change-notes/2025-07-08.md new file mode 100644 index 00000000000..893a695a22c --- /dev/null +++ b/actions/ql/lib/change-notes/2025-07-08.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* The `actions/artifact-poisoning/critical` and `actions/artifact-poisoning/medium` queries now exclude artifacts downloaded to `$[{ runner.temp }}` in addition to `/tmp`. diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml new file mode 100644 index 00000000000..d463527f292 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml @@ -0,0 +1,22 @@ +name: Secure Workflow + +on: + workflow_run: + workflows: ["Prev"] + types: + - completed + +jobs: + Download: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: mkdir -p ${{ runner.temp }}/artifacts/ + - uses: dawidd6/action-download-artifact@v2 + with: + name: pr_number + path: ${{ runner.temp }}/artifacts/ + + - name: Run command + run: | + sh cmd.sh From a5333ae1a10c5a10663483b86f6d4aa0770a48ef Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 8 Jul 2025 16:51:22 +0100 Subject: [PATCH 26/96] Add change note --- go/ql/lib/change-notes/2025-07-08-request-forgery-sinks.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 go/ql/lib/change-notes/2025-07-08-request-forgery-sinks.md diff --git a/go/ql/lib/change-notes/2025-07-08-request-forgery-sinks.md b/go/ql/lib/change-notes/2025-07-08-request-forgery-sinks.md new file mode 100644 index 00000000000..6204749d9d6 --- /dev/null +++ b/go/ql/lib/change-notes/2025-07-08-request-forgery-sinks.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added models for the `Head` function and the `Client.Head` method, from the `net/http` package, to the `Http::ClientRequest` class. This means that they will be recognized as sinks for the query `go/request-forgery` and the experimental query `go/ssrf`. From 9393181c4e714fa4d950dbd86c4540e99a49798d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Loba=C4=8Devski?= Date: Tue, 8 Jul 2025 16:18:12 +0000 Subject: [PATCH 27/96] Add tests and path normalization fix to handle $ expansion --- actions/ql/lib/codeql/actions/Helper.qll | 2 +- .../security/ArtifactPoisoningQuery.qll | 3 ++- .../.github/workflows/artifactpoisoning93.yml | 19 +++++++++++++++++++ .../.github/workflows/artifactpoisoning94.yml | 19 +++++++++++++++++++ .../.github/workflows/artifactpoisoning95.yml | 19 +++++++++++++++++++ .../.github/workflows/artifactpoisoning96.yml | 18 ++++++++++++++++++ .../ArtifactPoisoningCritical.expected | 4 ++++ .../CWE-829/ArtifactPoisoningMedium.expected | 3 +++ .../UntrustedCheckoutCritical.expected | 8 ++++++++ 9 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning93.yml create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning94.yml create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning95.yml create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning96.yml diff --git a/actions/ql/lib/codeql/actions/Helper.qll b/actions/ql/lib/codeql/actions/Helper.qll index 48b70061ec0..348ec75a519 100644 --- a/actions/ql/lib/codeql/actions/Helper.qll +++ b/actions/ql/lib/codeql/actions/Helper.qll @@ -72,7 +72,7 @@ string normalizePath(string path) { then result = path else // foo -> GITHUB_WORKSPACE/foo - if path.regexpMatch("^[^/~].*") + if path.regexpMatch("^[^$/~].*") then result = "GITHUB_WORKSPACE/" + path.regexpReplaceAll("/$", "") else // ~/foo -> ~/foo diff --git a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll index 0db3b2f7f88..778263f2ef2 100644 --- a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll +++ b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll @@ -262,9 +262,10 @@ class ArtifactPoisoningSink extends DataFlow::Node { ArtifactPoisoningSink() { download.getAFollowingStep() = poisonable and - // excluding artifacts downloaded to /tmp and runner.tmp + // excluding artifacts downloaded to the temporary directory not download.getPath().regexpMatch("^/tmp.*") and not download.getPath().regexpMatch("^\\$\\{\\{\\s?runner\\.temp\\s?}}.*") and + not download.getPath().regexpMatch("^\\$RUNNER_TEMP.*") and ( poisonable.(Run).getScript() = this.asExpr() and ( diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning93.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning93.yml new file mode 100644 index 00000000000..5bebc3484e6 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning93.yml @@ -0,0 +1,19 @@ +on: + workflow_run: + workflows: + - Benchmark + types: + - completed + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download From PR + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: ${{ runner.temp }}/artifacts/ + - run: npm install \ No newline at end of file diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning94.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning94.yml new file mode 100644 index 00000000000..bee8abd4120 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning94.yml @@ -0,0 +1,19 @@ +on: + workflow_run: + workflows: + - Benchmark + types: + - completed + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download From PR + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: /tmp/artifacts/ + - run: npm install \ No newline at end of file diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning95.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning95.yml new file mode 100644 index 00000000000..7a1aca46760 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning95.yml @@ -0,0 +1,19 @@ +on: + workflow_run: + workflows: + - Benchmark + types: + - completed + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download From PR + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: $RUNNER_TEMP/artifacts/ + - run: npm install \ No newline at end of file diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning96.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning96.yml new file mode 100644 index 00000000000..f970a3fa197 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning96.yml @@ -0,0 +1,18 @@ +on: + workflow_run: + workflows: + - Benchmark + types: + - completed + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download From PR + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + - run: npm install \ No newline at end of file diff --git a/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningCritical.expected b/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningCritical.expected index aa0057d60a1..2d29cd9b79b 100644 --- a/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningCritical.expected +++ b/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningCritical.expected @@ -13,6 +13,7 @@ edges | .github/workflows/artifactpoisoning42.yml:13:9:21:6 | Run Step | .github/workflows/artifactpoisoning42.yml:22:14:22:18 | ./cmd | provenance | Config | | .github/workflows/artifactpoisoning71.yml:9:9:16:6 | Uses Step | .github/workflows/artifactpoisoning71.yml:17:14:18:40 | sed -f config foo.md > bar.md\n | provenance | Config | | .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | provenance | Config | +| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | provenance | Config | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | provenance | Config | | .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | provenance | Config | | .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | provenance | Config | @@ -44,6 +45,8 @@ nodes | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | semmle.label | python test.py | | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | semmle.label | Uses Step | | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | semmle.label | make snapshot | +| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | semmle.label | Uses Step | +| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | semmle.label | npm install | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | semmle.label | Uses Step | | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | semmle.label | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | | .github/workflows/test18.yml:12:15:33:12 | Uses Step | semmle.label | Uses Step | @@ -66,6 +69,7 @@ subpaths | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | python test.py | .github/workflows/artifactpoisoning81.yml:3:5:3:23 | pull_request_target | pull_request_target | | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | .github/actions/download-artifact-2/action.yaml:6:7:25:4 | Uses Step | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | Uses Step | .github/workflows/artifactpoisoning92.yml:3:3:3:14 | workflow_run | workflow_run | | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | .github/actions/download-artifact-2/action.yaml:6:7:25:4 | Uses Step | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | make snapshot | .github/workflows/artifactpoisoning92.yml:3:3:3:14 | workflow_run | workflow_run | +| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | npm install | .github/workflows/artifactpoisoning96.yml:2:3:2:14 | workflow_run | workflow_run | | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | .github/workflows/artifactpoisoning101.yml:4:3:4:21 | pull_request_target | pull_request_target | | .github/workflows/test18.yml:36:15:40:58 | Uses Step | .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/test18.yml:36:15:40:58 | Uses Step | Uses Step | .github/workflows/test18.yml:3:5:3:16 | workflow_run | workflow_run | | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | ./gradlew buildScanPublishPrevious\n | .github/workflows/test25.yml:2:3:2:14 | workflow_run | workflow_run | diff --git a/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningMedium.expected b/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningMedium.expected index 09aed9e34a1..c0c52e47f5b 100644 --- a/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningMedium.expected +++ b/actions/ql/test/query-tests/Security/CWE-829/ArtifactPoisoningMedium.expected @@ -13,6 +13,7 @@ edges | .github/workflows/artifactpoisoning42.yml:13:9:21:6 | Run Step | .github/workflows/artifactpoisoning42.yml:22:14:22:18 | ./cmd | provenance | Config | | .github/workflows/artifactpoisoning71.yml:9:9:16:6 | Uses Step | .github/workflows/artifactpoisoning71.yml:17:14:18:40 | sed -f config foo.md > bar.md\n | provenance | Config | | .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | provenance | Config | +| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | provenance | Config | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | provenance | Config | | .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | provenance | Config | | .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | provenance | Config | @@ -44,6 +45,8 @@ nodes | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | semmle.label | python test.py | | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | semmle.label | Uses Step | | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | semmle.label | make snapshot | +| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | semmle.label | Uses Step | +| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | semmle.label | npm install | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | semmle.label | Uses Step | | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | semmle.label | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | | .github/workflows/test18.yml:12:15:33:12 | Uses Step | semmle.label | Uses Step | diff --git a/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected b/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected index 5d7a94aead0..9e54eb48c9a 100644 --- a/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected +++ b/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected @@ -51,6 +51,14 @@ edges | .github/workflows/artifactpoisoning92.yml:19:9:25:6 | Run Step: metadata | .github/workflows/artifactpoisoning92.yml:25:9:28:6 | Uses Step | | .github/workflows/artifactpoisoning92.yml:25:9:28:6 | Uses Step | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | .github/workflows/artifactpoisoning92.yml:29:9:29:27 | Run Step | +| .github/workflows/artifactpoisoning93.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning93.yml:13:9:19:6 | Uses Step | +| .github/workflows/artifactpoisoning93.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning93.yml:19:9:19:24 | Run Step | +| .github/workflows/artifactpoisoning94.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning94.yml:13:9:19:6 | Uses Step | +| .github/workflows/artifactpoisoning94.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning94.yml:19:9:19:24 | Run Step | +| .github/workflows/artifactpoisoning95.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning95.yml:13:9:19:6 | Uses Step | +| .github/workflows/artifactpoisoning95.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning95.yml:19:9:19:24 | Run Step | +| .github/workflows/artifactpoisoning96.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | +| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:9:18:24 | Run Step | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:16:9:19:59 | Run Step: pr_number | | .github/workflows/auto_ci.yml:20:9:27:6 | Uses Step | .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step | | .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step | .github/workflows/auto_ci.yml:32:9:37:6 | Run Step | From f1e9f0e323cf070dd20e3457ec6dc5d2d5bcdc3c Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Wed, 9 Jul 2025 09:24:26 +0200 Subject: [PATCH 28/96] Shared: improve join order in filterByLocation It's better to join with the range expression first since that will only multiply tuple counts by the number of lines in an average source/sink. Joining with `restrictAlertsToStartLine` first would multiply tuple counts by the number of sources/sinks in a given file. --- shared/util/codeql/util/AlertFiltering.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index 091c2a89d00..4064e4f31a8 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -98,7 +98,7 @@ module AlertFilteringImpl { exists(int locStartLine, int locEndLine | location.hasLocationInfo(filePath, locStartLine, _, locEndLine, _) | - restrictAlertsToStartLine(filePath, [locStartLine .. locEndLine]) + restrictAlertsToStartLine(pragma[only_bind_into](filePath), [locStartLine .. locEndLine]) ) ) or From 0d7a842e2feb92462cb53de185e51e64e5bf1aa7 Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Wed, 9 Jul 2025 09:43:49 +0200 Subject: [PATCH 29/96] Shared: improve documentation in AlertFiltering --- shared/util/codeql/util/AlertFiltering.qll | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index 4064e4f31a8..a956693f9c7 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -79,14 +79,27 @@ module AlertFilteringImpl { private predicate restrictAlertsToEntireFile(string filePath) { restrictAlertsTo(filePath, 0, 0) } pragma[nomagic] - private predicate restrictAlertsToStartLine(string filePath, int line) { + private predicate restrictAlertsToLine(string filePath, int line) { exists(int startLineStart, int startLineEnd | restrictAlertsTo(filePath, startLineStart, startLineEnd) and line = [startLineStart .. startLineEnd] ) } - /** Applies alert filtering to the given location. */ + /** + * Holds if the given location intersects the diff range. Testing for full + * intersection rather than only matching the start line means that this + * predicate is more broadly useful than just checking whether a specific + * element is considered to be in the diff range of GitHub Code Scanning: + * - If it's inconvenient to pass the exact `Location` of the element of + * interest, it's valid to use a `Location` of an enclosing element. + * - This predicate could be useful for other systems of alert presentation + * where the rules don't exactly match GitHub Code Scanning. + * + * If there is no diff range, this predicate holds for all locations. Note + * that this predicate has a bindingset and will therefore be inlined; + * callers should include enough context to ensure efficient evaluation. + */ bindingset[location] predicate filterByLocation(Location location) { not restrictAlertsTo(_, _, _) and not restrictAlertsToExactLocation(_, _, _, _, _) @@ -98,7 +111,7 @@ module AlertFilteringImpl { exists(int locStartLine, int locEndLine | location.hasLocationInfo(filePath, locStartLine, _, locEndLine, _) | - restrictAlertsToStartLine(pragma[only_bind_into](filePath), [locStartLine .. locEndLine]) + restrictAlertsToLine(pragma[only_bind_into](filePath), [locStartLine .. locEndLine]) ) ) or From e1f2433dbf9dab7cd36e4d941e32457472d13278 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Tue, 1 Jul 2025 15:37:34 +0100 Subject: [PATCH 30/96] Ruby: make resolveConstant overlay[global] --- ruby/ql/lib/codeql/ruby/ast/Call.qll | 3 ++- ruby/ql/lib/codeql/ruby/ast/Constant.qll | 6 ++++++ ruby/ql/lib/codeql/ruby/ast/Expr.qll | 2 ++ ruby/ql/lib/codeql/ruby/ast/Literal.qll | 14 ++++++++++++++ ruby/ql/lib/codeql/ruby/ast/Method.qll | 10 ++++++++++ ruby/ql/lib/codeql/ruby/ast/Module.qll | 4 ++++ ruby/ql/lib/codeql/ruby/ast/Pattern.qll | 1 + ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll | 14 +++++++++++--- ruby/ql/lib/codeql/ruby/ast/internal/Module.qll | 7 +++++++ ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll | 12 +++++++++++- .../codeql/ruby/controlflow/ControlFlowGraph.qll | 1 + 11 files changed, 69 insertions(+), 5 deletions(-) diff --git a/ruby/ql/lib/codeql/ruby/ast/Call.qll b/ruby/ql/lib/codeql/ruby/ast/Call.qll index 3a82d0d39b3..10b23b22d55 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Call.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Call.qll @@ -4,6 +4,7 @@ module; private import codeql.ruby.AST private import internal.AST private import internal.Call +private import internal.Literal private import internal.TreeSitter private import codeql.ruby.dataflow.internal.DataFlowDispatch private import codeql.ruby.dataflow.internal.DataFlowImplCommon @@ -44,7 +45,7 @@ class Call extends Expr instanceof CallImpl { final Expr getKeywordArgument(string keyword) { exists(Pair p | p = this.getAnArgument() and - p.getKey().getConstantValue().isSymbol(keyword) and + keyword = p.getKey().(SymbolLiteral).(StringlikeLiteralImpl).getStringValue() and result = p.getValue() ) } diff --git a/ruby/ql/lib/codeql/ruby/ast/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/Constant.qll index 9c7ac62e542..125aef4980f 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Constant.qll @@ -9,6 +9,7 @@ private import internal.Variable private import internal.TreeSitter /** A constant value. */ +overlay[global] class ConstantValue extends TConstantValue { /** Gets a textual representation of this constant value. */ final string toString() { this.hasValueWithType(result, _) } @@ -137,6 +138,7 @@ class ConstantValue extends TConstantValue { } /** Provides different sub classes of `ConstantValue`. */ +overlay[global] module ConstantValue { /** A constant integer value. */ class ConstantIntegerValue extends ConstantValue, TInt { } @@ -271,15 +273,18 @@ class ConstantReadAccess extends ConstantAccess { * * the value being read at `M::CONST` is `"const"`. */ + overlay[global] Expr getValue() { result = getConstantReadAccessValue(this) } /** * Gets a fully qualified name for this constant read, based on the context in * which it occurs. */ + overlay[global] string getAQualifiedName() { result = resolveConstant(this) } /** Gets the module that this read access resolves to, if any. */ + overlay[global] Module getModule() { result = resolveConstantReadAccess(this) } final override string getAPrimaryQlClass() { result = "ConstantReadAccess" } @@ -345,6 +350,7 @@ class ConstantWriteAccess extends ConstantAccess { * constants up the namespace chain, the fully qualified name of a nested * constant can be ambiguous from just statically looking at the AST. */ + overlay[global] string getAQualifiedName() { result = resolveConstantWrite(this) } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Expr.qll b/ruby/ql/lib/codeql/ruby/ast/Expr.qll index 8ab203aed87..e932202e53f 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Expr.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Expr.qll @@ -15,6 +15,7 @@ private import internal.TreeSitter */ class Expr extends Stmt, TExpr { /** Gets the constant value of this expression, if any. */ + overlay[global] ConstantValue getConstantValue() { result = getConstantValueExpr(this) } } @@ -428,6 +429,7 @@ class StringConcatenation extends Expr, TStringConcatenation { * "foo" "bar#{ n }" * ``` */ + overlay[global] final string getConcatenatedValueText() { forall(StringLiteral c | c = this.getString(_) | exists(c.getConstantValue().getStringlikeValue()) diff --git a/ruby/ql/lib/codeql/ruby/ast/Literal.qll b/ruby/ql/lib/codeql/ruby/ast/Literal.qll index a32ca16e24c..308b2a9667c 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Literal.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Literal.qll @@ -44,6 +44,7 @@ class IntegerLiteral extends NumericLiteral instanceof IntegerLiteralImpl { /** Gets the numerical value of this integer literal. */ final int getValue() { result = super.getValue() } + overlay[global] final override ConstantValue::ConstantIntegerValue getConstantValue() { result = NumericLiteral.super.getConstantValue() } @@ -60,6 +61,7 @@ class IntegerLiteral extends NumericLiteral instanceof IntegerLiteralImpl { * ``` */ class FloatLiteral extends NumericLiteral instanceof FloatLiteralImpl { + overlay[global] final override ConstantValue::ConstantFloatValue getConstantValue() { result = NumericLiteral.super.getConstantValue() } @@ -75,6 +77,7 @@ class FloatLiteral extends NumericLiteral instanceof FloatLiteralImpl { * ``` */ class RationalLiteral extends NumericLiteral instanceof RationalLiteralImpl { + overlay[global] final override ConstantValue::ConstantRationalValue getConstantValue() { result = NumericLiteral.super.getConstantValue() } @@ -90,6 +93,7 @@ class RationalLiteral extends NumericLiteral instanceof RationalLiteralImpl { * ``` */ class ComplexLiteral extends NumericLiteral instanceof ComplexLiteralImpl { + overlay[global] final override ConstantValue::ConstantComplexValue getConstantValue() { result = NumericLiteral.super.getConstantValue() } @@ -99,6 +103,7 @@ class ComplexLiteral extends NumericLiteral instanceof ComplexLiteralImpl { /** A `nil` literal. */ class NilLiteral extends Literal instanceof NilLiteralImpl { + overlay[global] final override ConstantValue::ConstantNilValue getConstantValue() { result = TNil() } final override string getAPrimaryQlClass() { result = "NilLiteral" } @@ -125,6 +130,7 @@ class BooleanLiteral extends Literal instanceof BooleanLiteralImpl { /** Gets the value of this Boolean literal. */ boolean getValue() { result = super.getValue() } + overlay[global] final override ConstantValue::ConstantBooleanValue getConstantValue() { result = Literal.super.getConstantValue() } @@ -136,6 +142,7 @@ class BooleanLiteral extends Literal instanceof BooleanLiteralImpl { class EncodingLiteral extends Literal instanceof EncodingLiteralImpl { final override string getAPrimaryQlClass() { result = "EncodingLiteral" } + overlay[global] final override ConstantValue::ConstantStringValue getConstantValue() { result = Literal.super.getConstantValue() } @@ -147,6 +154,7 @@ class EncodingLiteral extends Literal instanceof EncodingLiteralImpl { class LineLiteral extends Literal instanceof LineLiteralImpl { final override string getAPrimaryQlClass() { result = "LineLiteral" } + overlay[global] final override ConstantValue::ConstantIntegerValue getConstantValue() { result = Literal.super.getConstantValue() } @@ -158,6 +166,7 @@ class LineLiteral extends Literal instanceof LineLiteralImpl { class FileLiteral extends Literal instanceof FileLiteralImpl { final override string getAPrimaryQlClass() { result = "FileLiteral" } + overlay[global] final override ConstantValue::ConstantStringValue getConstantValue() { result = Literal.super.getConstantValue() } @@ -169,6 +178,7 @@ class FileLiteral extends Literal instanceof FileLiteralImpl { */ class StringComponent extends AstNode instanceof StringComponentImpl { /** Gets the constant value of this string component, if any. */ + overlay[global] ConstantValue::ConstantStringValue getConstantValue() { result = TString(super.getValue()) } } @@ -213,6 +223,7 @@ class StringInterpolationComponent extends StringComponent, StmtSequence instanc final override Stmt getStmt(int n) { toGenerated(result) = g.getChild(n) } + overlay[global] final override ConstantValue::ConstantStringValue getConstantValue() { result = StmtSequence.super.getConstantValue() } @@ -260,6 +271,7 @@ class RegExpInterpolationComponent extends RegExpComponent, StmtSequence instanc final override Stmt getStmt(int n) { toGenerated(result) = g.getChild(n) } + overlay[global] final override ConstantValue::ConstantStringValue getConstantValue() { result = StmtSequence.super.getConstantValue() } @@ -408,6 +420,7 @@ class SymbolLiteral extends StringlikeLiteral instanceof SymbolLiteralImpl { not this instanceof MethodName and result = "SymbolLiteral" } + overlay[global] final override ConstantValue::ConstantSymbolValue getConstantValue() { result = StringlikeLiteral.super.getConstantValue() } @@ -440,6 +453,7 @@ class SubshellLiteral extends StringlikeLiteral instanceof SubshellLiteralImpl { class CharacterLiteral extends Literal instanceof CharacterLiteralImpl { final override string getAPrimaryQlClass() { result = "CharacterLiteral" } + overlay[global] final override ConstantValue::ConstantStringValue getConstantValue() { result = Literal.super.getConstantValue() } diff --git a/ruby/ql/lib/codeql/ruby/ast/Method.qll b/ruby/ql/lib/codeql/ruby/ast/Method.qll index 60c0c705b31..147782e3d08 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Method.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Method.qll @@ -43,18 +43,22 @@ class MethodBase extends Callable, BodyStmt, Scope, TMethodBase { * Holds if this method is public. * Methods are public by default. */ + overlay[global] predicate isPublic() { this.getVisibility() = "public" } /** Holds if this method is private. */ + overlay[global] predicate isPrivate() { this.getVisibility() = "private" } /** Holds if this method is protected. */ + overlay[global] predicate isProtected() { this.getVisibility() = "protected" } /** * Gets a string describing the visibility of this method. * This is either 'public', 'private' or 'protected'. */ + overlay[global] string getVisibility() { result = getVisibilityModifier(this).getVisibility() or @@ -76,6 +80,7 @@ class MethodBase extends Callable, BodyStmt, Scope, TMethodBase { * end * ``` */ +overlay[global] private VisibilityModifier getExplicitVisibilityModifier(Method m) { result.getMethodArgument() = m or @@ -89,6 +94,7 @@ private VisibilityModifier getExplicitVisibilityModifier(Method m) { * Gets the visibility modifier that defines the visibility of method `m`, if * any. */ +overlay[global] private VisibilityModifier getVisibilityModifier(MethodBase mb) { mb = any(Method m | @@ -205,6 +211,7 @@ class Method extends MethodBase, TMethod { * end * ``` */ + overlay[global] override predicate isPrivate() { super.isPrivate() } final override Parameter getParameter(int n) { @@ -213,6 +220,7 @@ class Method extends MethodBase, TMethod { final override string toString() { result = this.getName() } + overlay[global] override string getVisibility() { result = getVisibilityModifier(this).getVisibility() or @@ -226,6 +234,7 @@ class Method extends MethodBase, TMethod { } } +overlay[global] pragma[nomagic] private predicate modifiesIn(VisibilityModifier vm, ModuleBase n, string name) { n = vm.getEnclosingModule() and @@ -302,6 +311,7 @@ class SingletonMethod extends MethodBase, TSingletonMethod { * end * ``` */ + overlay[global] override predicate isPrivate() { super.isPrivate() } } diff --git a/ruby/ql/lib/codeql/ruby/ast/Module.qll b/ruby/ql/lib/codeql/ruby/ast/Module.qll index 671910bfaef..90ee8275f39 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Module.qll @@ -11,6 +11,7 @@ private import internal.Scope /** * A representation of a run-time `module` or `class` value. */ +overlay[global] class Module extends TModule { /** Gets a declaration of this module, if any. */ ModuleBase getADeclaration() { result.getModule() = this } @@ -258,6 +259,7 @@ class ModuleBase extends BodyStmt, Scope, TModuleBase { } /** Gets the representation of the run-time value of this module or class. */ + overlay[global] Module getModule() { none() } /** @@ -336,6 +338,7 @@ class Toplevel extends ModuleBase, TToplevel { pred = "getBeginBlock" and result = this.getBeginBlock(_) } + overlay[global] final override Module getModule() { result = TResolved("Object") } final override string toString() { result = g.getLocation().getFile().getBaseName() } @@ -408,6 +411,7 @@ class Namespace extends ModuleBase, ConstantWriteAccess, TNamespace { */ override predicate hasGlobalScope() { none() } + overlay[global] final override Module getModule() { result = any(string qName | qName = namespaceDeclaration(this) | TResolved(qName)) or diff --git a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll index f705bf28301..ac6bcc712cf 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Pattern.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Pattern.qll @@ -206,6 +206,7 @@ class HashPattern extends CasePattern, THashPattern { } /** Gets the value for a given key name. */ + overlay[global] CasePattern getValueByKey(string key) { exists(int i | this.getKey(i).getConstantValue().isStringlikeValue(key) and result = this.getValue(i) diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll index 133cea315c3..6fdcdc89418 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Constant.qll @@ -1,6 +1,3 @@ -overlay[local] -module; - private import codeql.ruby.AST private import codeql.ruby.ast.internal.AST private import codeql.ruby.ast.internal.Literal @@ -41,6 +38,7 @@ private import ExprNodes * constant value in some cases. */ private module Propagation { + overlay[local] ExprCfgNode getSource(VariableReadAccessCfgNode read) { exists(Ssa::WriteDefinition def | def.assigns(result) and @@ -202,6 +200,7 @@ private module Propagation { forex(ExprCfgNode n | n = e.getAControlFlowNode() | isComplex(n, real, imaginary)) } + overlay[local] private class StringlikeLiteralWithInterpolationCfgNode extends StringlikeLiteralCfgNode { StringlikeLiteralWithInterpolationCfgNode() { this.getAComponent() = @@ -211,6 +210,7 @@ private module Propagation { ) } + overlay[global] pragma[nomagic] private string getComponentValue(int i) { this.getComponent(i) = @@ -222,17 +222,20 @@ private module Propagation { } language[monotonicAggregates] + overlay[global] private string getValue() { result = strictconcat(int i | exists(this.getComponent(i)) | this.getComponentValue(i) order by i) } + overlay[global] pragma[nomagic] string getSymbolValue() { result = this.getValue() and this.getExpr() instanceof SymbolLiteral } + overlay[global] pragma[nomagic] string getStringValue() { result = this.getValue() and @@ -240,6 +243,7 @@ private module Propagation { not this.getExpr() instanceof RegExpLiteral } + overlay[global] pragma[nomagic] string getRegExpValue(string flags) { result = this.getValue() and @@ -569,6 +573,7 @@ private predicate isArrayExpr(Expr e, ArrayLiteralCfgNode arr) { isArrayExpr(e.(MethodCall).getReceiver(), arr) } +overlay[local] private class TokenConstantAccess extends ConstantAccess, TTokenConstantAccess { private Ruby::Constant g; @@ -580,6 +585,7 @@ private class TokenConstantAccess extends ConstantAccess, TTokenConstantAccess { /** * A constant access that has a scope resolution qualifier. */ +overlay[local] class ScopeResolutionConstantAccess extends ConstantAccess, TScopeResolutionConstantAccess { private Ruby::ScopeResolution g; private Ruby::Constant constant; @@ -598,6 +604,7 @@ class ScopeResolutionConstantAccess extends ConstantAccess, TScopeResolutionCons final override predicate hasGlobalScope() { not exists(g.getScope()) } } +overlay[local] private class ConstantReadAccessSynth extends ConstantAccess, TConstantReadAccessSynth { private string value; @@ -612,6 +619,7 @@ private class ConstantReadAccessSynth extends ConstantAccess, TConstantReadAcces final override predicate hasGlobalScope() { value.matches("::%") } } +overlay[local] private class ConstantWriteAccessSynth extends ConstantAccess, TConstantWriteAccessSynth { private string value; diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll index d222316bf26..3670cc5eb98 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Module.qll @@ -14,6 +14,7 @@ private string builtin() { ] } +overlay[global] cached private module Cached { cached @@ -218,6 +219,7 @@ private string scopeAppend(string qualifier, string name) { * both as a performance optimization (minimize non-linear recursion), and as a way * to prevent infinite recursion. */ +overlay[global] private module ResolveImpl { private ModuleBase enclosing(ModuleBase m, int level) { result = m and level = 0 @@ -586,6 +588,7 @@ private ModuleBase enclosingModuleNoBlock(Stmt node) { result = enclosingScopesNoBlock(Scope::scopeOfInclSynth(node)) } +overlay[global] private Module getAncestors(Module m) { result = m or result = getAncestors(m.getAnIncludedModule()) or @@ -596,6 +599,7 @@ private newtype TMethodOrExpr = TMethod(Method m) or TExpr(Expr e) +overlay[global] private TMethodOrExpr getMethodOrConst(TModule owner, string name) { exists(ModuleBase m | m.getModule() = owner | result = TMethod(m.getMethod(name)) @@ -604,12 +608,14 @@ private TMethodOrExpr getMethodOrConst(TModule owner, string name) { ) } +overlay[global] module ExposedForTestingOnly { Method getMethod(TModule owner, string name) { TMethod(result) = getMethodOrConst(owner, name) } Expr getConst(TModule owner, string name) { TExpr(result) = getMethodOrConst(owner, name) } } +overlay[global] private TMethodOrExpr lookupMethodOrConst0(Module m, string name) { result = lookupMethodOrConst0(m.getAPrependedModule(), name) or @@ -624,6 +630,7 @@ private TMethodOrExpr lookupMethodOrConst0(Module m, string name) { private AstNode getNode(TMethodOrExpr e) { e = TMethod(result) or e = TExpr(result) } +overlay[global] private TMethodOrExpr lookupMethodOrConst(Module m, string name) { result = lookupMethodOrConst0(m, name) or diff --git a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll index 16d0a69fcc3..0da31370ff0 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll @@ -6,7 +6,6 @@ private import codeql.ruby.AST private import codeql.ruby.controlflow.BasicBlocks private import codeql.ruby.dataflow.SSA private import codeql.ruby.ast.internal.Constant -private import codeql.ruby.ast.internal.Literal private import ControlFlowGraph private import internal.ControlFlowGraphImpl as CfgImpl @@ -38,11 +37,13 @@ class ExitNode extends CfgNode, CfgImpl::ExitNode { */ class AstCfgNode extends CfgNode, CfgImpl::AstCfgNode { /** Gets the name of the primary QL class for this node. */ + overlay[global] override string getAPrimaryQlClass() { result = "AstCfgNode" } } /** A control-flow node that wraps an AST expression. */ class ExprCfgNode extends AstCfgNode { + overlay[global] override string getAPrimaryQlClass() { result = "ExprCfgNode" } Expr e; @@ -53,6 +54,7 @@ class ExprCfgNode extends AstCfgNode { Expr getExpr() { result = e } /** Gets the constant value of this expression, if any. */ + overlay[global] ConstantValue getConstantValue() { result = getConstantValue(this) } } @@ -78,6 +80,7 @@ class StringComponentCfgNode extends AstCfgNode { StringComponentCfgNode() { this.getAstNode() instanceof StringComponent } /** Gets the constant value of this string component. */ + overlay[global] ConstantValue getConstantValue() { result = this.getAstNode().(StringComponent).getConstantValue() } @@ -299,6 +302,7 @@ module ExprNodes { /** A control-flow node that wraps a `Call` AST expression. */ class CallCfgNode extends ExprCfgNode { + overlay[global] override string getAPrimaryQlClass() { result = "CallCfgNode" } override CallExprChildMapping e; @@ -312,6 +316,7 @@ module ExprNodes { final ExprCfgNode getAnArgument() { result = this.getArgument(_) } /** Gets the keyword argument whose key is `keyword` of this call. */ + overlay[global] final ExprCfgNode getKeywordArgument(string keyword) { exists(PairCfgNode n | e.hasCfgChild(e.getAnArgument(), this, n) and @@ -340,6 +345,7 @@ module ExprNodes { /** A control-flow node that wraps a `MethodCall` AST expression. */ class MethodCallCfgNode extends CallCfgNode { + overlay[global] override string getAPrimaryQlClass() { result = "MethodCallCfgNode" } MethodCallCfgNode() { super.getExpr() instanceof MethodCall } @@ -844,6 +850,7 @@ module ExprNodes { this.getAstNode() instanceof StringInterpolationComponent } + overlay[global] final override ConstantValue getConstantValue() { result = StmtSequenceCfgNode.super.getConstantValue() } @@ -857,6 +864,7 @@ module ExprNodes { this.getAstNode() instanceof RegExpInterpolationComponent } + overlay[global] final override ConstantValue getConstantValue() { result = StmtSequenceCfgNode.super.getConstantValue() } @@ -948,6 +956,7 @@ module ExprNodes { * into calls to `Array.[]`, so this includes both desugared calls as well as * explicit calls. */ + overlay[global] class ArrayLiteralCfgNode extends MethodCallCfgNode { override string getAPrimaryQlClass() { result = "ArrayLiteralCfgNode" } @@ -965,6 +974,7 @@ module ExprNodes { * into calls to `Hash.[]`, so this includes both desugared calls as well as * explicit calls. */ + overlay[global] class HashLiteralCfgNode extends MethodCallCfgNode { override string getAPrimaryQlClass() { result = "HashLiteralCfgNode" } diff --git a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll index f3c5dcd08f3..1d3632ba1c0 100644 --- a/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll +++ b/ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll @@ -37,6 +37,7 @@ class CfgScope extends Scope instanceof CfgImpl::CfgScopeImpl { */ class CfgNode extends CfgImpl::Node { /** Gets the name of the primary QL class for this node. */ + overlay[global] string getAPrimaryQlClass() { none() } /** Gets the file of this control flow node. */ From 3ffda2f341bdcc8e7337a076701473a3cd870568 Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Wed, 9 Jul 2025 14:32:18 +0200 Subject: [PATCH 31/96] Shared: Overhaul the AlertFiltering QLDoc The documentation is now up-to-date with the new and more relaxed rules that allow overapproximating the results. I have also attempted to make a clearer distinction between the requirements of the specification and the behaviour of the implementation. --- shared/util/codeql/util/AlertFiltering.qll | 57 +++++++++++----------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll index a956693f9c7..bfc9d901b2f 100644 --- a/shared/util/codeql/util/AlertFiltering.qll +++ b/shared/util/codeql/util/AlertFiltering.qll @@ -8,15 +8,14 @@ module; private import codeql.util.Location /** - * Holds if the query should produce alerts that match the given line ranges. + * Holds if the query may restrict its computation to only produce alerts that match the given line + * ranges. This predicate is used for implementing _diff-informed queries_ for pull requests in + * GitHub Code Scanning. * * This predicate is active if and only if it is nonempty. If this predicate is inactive, it has no - * effect. If it is active, it accepts any alert that has at least one matching location. - * - * Note that an alert that is not accepted by this filtering predicate may still be included in the - * query results if it is accepted by another active filtering predicate in this module. An alert is - * excluded from the query results if only if (1) there is at least one active filtering predicate, - * and (2) it is not accepted by any active filtering predicate. + * effect. If it is active, queries may omit alerts that don't have a _primary_ or _related_ + * location (in SARIF terminology) whose start line is within a specified range. Queries are allowed + * to produce alerts outside this range. * * An alert location is a match if it matches a row in this predicate. If `startLineStart` and * `startLineEnd` are both 0, the row specifies a whole-file match, and a location is a match if @@ -29,26 +28,24 @@ private import codeql.util.Location * - startLineStart: inclusive start of the range for alert location start line number (1-based). * - startLineEnd: inclusive end of the range for alert location start line number (1-based). * - * A query should either perform no alert filtering, or adhere to all the filtering rules in this - * module and return all and only the accepted alerts. - * - * This predicate is suitable for situations where we want to filter alerts at line granularity, - * such as based on the pull request diff. + * Note that an alert that is not accepted by this filtering predicate may still be included in the + * query results if it is accepted by another active filtering predicate in this module. An alert is + * excluded from the query results if only if (1) there is at least one active filtering predicate, + * and (2) it is not accepted by any active filtering predicate. * * See also: `restrictAlertsToExactLocation`. */ extensible predicate restrictAlertsTo(string filePath, int startLineStart, int startLineEnd); /** - * Holds if the query should produce alerts that match the given locations. + * Holds if the query may restrict its computation to only produce alerts that match the given + * character ranges. This predicate is suitable for testing, where we want to filter by the exact + * alert location, distinguishing between alerts on the same line. * * This predicate is active if and only if it is nonempty. If this predicate is inactive, it has no - * effect. If it is active, it accepts any alert that has at least one matching location. - * - * Note that an alert that is not accepted by this filtering predicate may still be included in the - * query results if it is accepted by another active filtering predicate in this module. An alert is - * excluded from the query results if only if (1) there is at least one active filtering predicate, - * and (2) it is not accepted by any active filtering predicate. + * effect. If it is active, queries may omit alerts that don't have a _primary_ or _related_ + * location (in SARIF terminology) whose location equals a tuple from this predicate. Queries are + * allowed to produce alerts outside this range. * * An alert location is a match if it matches a row in this predicate. Each row specifies an exact * location: an alert location is a match if its file path matches `filePath`, its start line and @@ -61,11 +58,10 @@ extensible predicate restrictAlertsTo(string filePath, int startLineStart, int s * - endLine: alert location end line number (1-based). * - endColumn: alert location end column number (1-based). * - * A query should either perform no alert filtering, or adhere to all the filtering rules in this - * module and return all and only the accepted alerts. - * - * This predicate is suitable for situations where we want to filter by the exact alert location, - * distinguishing between alerts on the same line. + * Note that an alert that is not accepted by this filtering predicate may still be included in the + * query results if it is accepted by another active filtering predicate in this module. An alert is + * excluded from the query results if only if (1) there is at least one active filtering predicate, + * and (2) it is not accepted by any active filtering predicate. * * See also: `restrictAlertsTo`. */ @@ -87,10 +83,15 @@ module AlertFilteringImpl { } /** - * Holds if the given location intersects the diff range. Testing for full - * intersection rather than only matching the start line means that this - * predicate is more broadly useful than just checking whether a specific - * element is considered to be in the diff range of GitHub Code Scanning: + * Holds if the given location intersects the diff range. When that is the + * case, ensuring that alerts mentioning this location are included in the + * query results is a valid overapproximation of the requirements for + * _diff-informed queries_ as documented under `restrictAlertsTo`. + * + * Testing for full intersection rather than only matching the start line + * means that this predicate is more broadly useful than just checking whether + * a specific element is considered to be in the diff range of GitHub Code + * Scanning: * - If it's inconvenient to pass the exact `Location` of the element of * interest, it's valid to use a `Location` of an enclosing element. * - This predicate could be useful for other systems of alert presentation From c4157955954c8d5b6ae5e78de242d667c1b78d5e Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Wed, 9 Jul 2025 13:32:49 +0100 Subject: [PATCH 32/96] Ruby: add changenote for overlay[local] annotations --- ruby/ql/lib/change-notes/2025-07-09-overlay-local.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ruby/ql/lib/change-notes/2025-07-09-overlay-local.md diff --git a/ruby/ql/lib/change-notes/2025-07-09-overlay-local.md b/ruby/ql/lib/change-notes/2025-07-09-overlay-local.md new file mode 100644 index 00000000000..f1c7fe83a26 --- /dev/null +++ b/ruby/ql/lib/change-notes/2025-07-09-overlay-local.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* Most classes and predicates in the AST, SSA, and control-flow-graph libraries are now annotated with `overlay[local]`, in preparation for incremental analysis. This could result in compiler errors for custom queries if they extend these classes. To mitigate such errors, look for ways to restructure custom QL code so it doesn't depend on changing the behavior of standard-library classes. From 4397863586eb20be83ab522b1c53b2decbfef0fd Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:17:31 +0100 Subject: [PATCH 33/96] Rust: Update after merge with main. --- rust/ql/test/library-tests/frameworks/postgres/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/postgres/main.rs b/rust/ql/test/library-tests/frameworks/postgres/main.rs index 28f6abbc41b..98ddadabfaa 100644 --- a/rust/ql/test/library-tests/frameworks/postgres/main.rs +++ b/rust/ql/test/library-tests/frameworks/postgres/main.rs @@ -41,9 +41,9 @@ fn main() -> Result<(), Box> { } for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink - let id: i32 = row.get("id"); // $ MISSING: database-read - let name: &str = row.try_get("name")?; // $ MISSING: database-read - let age: i32 = row.try_get("age").unwrap(); // $ MISSING: database-read + let id: i32 = row.get("id"); // $ database-read + let name: &str = row.try_get("name")?; // $ database-read + let age: i32 = row.try_get("age").unwrap(); // $ database-read println!("found person: {} {} {}", id, name, age); } From 4281fe74bdf85e0def37b5c18171caa3e5fd970e Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:22:04 +0100 Subject: [PATCH 34/96] Rust: We don't really need the split into two test cases any more. --- rust/ql/test/library-tests/frameworks/postgres/main.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/postgres/main.rs b/rust/ql/test/library-tests/frameworks/postgres/main.rs index 98ddadabfaa..dd1084b6ee5 100644 --- a/rust/ql/test/library-tests/frameworks/postgres/main.rs +++ b/rust/ql/test/library-tests/frameworks/postgres/main.rs @@ -32,14 +32,6 @@ fn main() -> Result<(), Box> { // conn.query_typed(query.as_str(), &[])?; // conn.query_typed_raw(query.as_str(), &[])?; - for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink - let row: &postgres::Row = row; - let id: i32 = row.get("id"); // $ database-read - let name: &str = row.try_get("name")?; // $ database-read - let age: i32 = row.try_get("age").unwrap(); // $ database-read - println!("found person: {} {} {}", id, name, age); - } - for row in &conn.query("SELECT id, name, age FROM person", &[])? { // $ sql-sink let id: i32 = row.get("id"); // $ database-read let name: &str = row.try_get("name")?; // $ database-read From 097ac69207ff872f3db77b66668ec43ef0886419 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:43:48 +0100 Subject: [PATCH 35/96] Rust: Current sources test regressions. --- .../test/library-tests/dataflow/sources/InlineFlow.expected | 4 ++++ .../library-tests/dataflow/sources/TaintSources.expected | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected index e69de29bb2d..5feb53c9a46 100644 --- a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected @@ -0,0 +1,4 @@ +| test.rs:114:26:114:50 | //... | Missing result: hasTaintFlow=request | +| test.rs:115:25:115:49 | //... | Missing result: hasTaintFlow=request | +| test.rs:121:22:121:46 | //... | Missing result: hasTaintFlow=request | +| test.rs:217:24:217:89 | //... | Missing result: hasTaintFlow | diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index b5028f38f76..5be1a08e0df 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -1,3 +1,4 @@ +#select | test.rs:8:10:8:22 | ...::var | Flow source 'EnvironmentSource' of type environment (DEFAULT). | | test.rs:9:10:9:25 | ...::var_os | Flow source 'EnvironmentSource' of type environment (DEFAULT). | | test.rs:11:16:11:28 | ...::var | Flow source 'EnvironmentSource' of type environment (DEFAULT). | @@ -21,8 +22,6 @@ | test.rs:77:26:77:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:99:18:99:47 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:113:31:113:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:120:31:120:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:210:22:210:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:216:22:216:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:222:22:222:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | @@ -92,3 +91,6 @@ | web_frameworks.rs:58:14:58:15 | ms | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | +testFailures +| test.rs:113:61:113:98 | //... | Missing result: Alert[rust/summary/taint-sources] | +| test.rs:120:61:120:98 | //... | Missing result: Alert[rust/summary/taint-sources] | From a034e29040a2dade5b46bf505b24037a15477327 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:32:18 +0100 Subject: [PATCH 36/96] Rust: Simplify the test a little. --- .../dataflow/sources/InlineFlow.expected | 5 +- .../dataflow/sources/TaintSources.expected | 118 +++++++++--------- .../library-tests/dataflow/sources/test.rs | 3 +- 3 files changed, 61 insertions(+), 65 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected index 5feb53c9a46..de25fe10111 100644 --- a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected @@ -1,4 +1 @@ -| test.rs:114:26:114:50 | //... | Missing result: hasTaintFlow=request | -| test.rs:115:25:115:49 | //... | Missing result: hasTaintFlow=request | -| test.rs:121:22:121:46 | //... | Missing result: hasTaintFlow=request | -| test.rs:217:24:217:89 | //... | Missing result: hasTaintFlow | +| test.rs:218:24:218:89 | //... | Missing result: hasTaintFlow | diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 5be1a08e0df..66d909f2e1b 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -1,4 +1,3 @@ -#select | test.rs:8:10:8:22 | ...::var | Flow source 'EnvironmentSource' of type environment (DEFAULT). | | test.rs:9:10:9:25 | ...::var_os | Flow source 'EnvironmentSource' of type environment (DEFAULT). | | test.rs:11:16:11:28 | ...::var | Flow source 'EnvironmentSource' of type environment (DEFAULT). | @@ -22,64 +21,66 @@ | test.rs:77:26:77:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:99:18:99:47 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:210:22:210:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:216:22:216:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:222:22:222:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:228:22:228:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:234:9:234:22 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:238:17:238:30 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:245:50:245:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:251:46:251:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:258:50:258:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:265:50:265:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:272:56:272:69 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:280:46:280:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:287:46:287:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:293:46:293:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:308:25:308:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:315:25:315:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:322:25:322:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:329:25:329:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:336:25:336:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:348:25:348:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:357:52:357:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:363:48:363:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:370:52:370:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:377:52:377:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:384:58:384:73 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:392:48:392:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | -| test.rs:407:31:407:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:407:31:407:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:412:31:412:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:412:31:412:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:417:22:417:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:417:22:417:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:423:22:423:25 | path | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:424:27:424:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:430:22:430:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:439:31:439:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:444:31:444:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:449:22:449:46 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:455:26:455:29 | path | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:455:26:455:29 | path | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:456:31:456:39 | file_name | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:456:31:456:39 | file_name | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:462:22:462:41 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:472:20:472:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:506:21:506:39 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:114:31:114:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:121:31:121:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:211:22:211:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:217:22:217:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:223:22:223:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:229:22:229:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:235:9:235:22 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:239:17:239:30 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:246:50:246:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:252:46:252:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:259:50:259:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:266:50:266:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:273:56:273:69 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:281:46:281:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:288:46:288:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:294:46:294:59 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:309:25:309:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:316:25:316:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:323:25:323:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:330:25:330:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:337:25:337:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:349:25:349:40 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:358:52:358:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:364:48:364:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:371:52:371:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:378:52:378:67 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:385:58:385:73 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:393:48:393:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:408:31:408:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:408:31:408:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:413:31:413:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:413:31:413:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:418:22:418:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:418:22:418:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:424:22:424:25 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:425:27:425:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:431:22:431:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:440:31:440:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:445:31:445:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:450:22:450:46 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:456:26:456:29 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:456:26:456:29 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:457:31:457:39 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:457:31:457:39 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:463:22:463:41 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:473:20:473:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:507:21:507:39 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:515:21:515:39 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:527:20:527:40 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:574:21:574:41 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:508:21:508:39 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:516:21:516:39 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:528:20:528:40 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:575:21:575:41 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:583:21:583:41 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | -| test.rs:600:26:600:53 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:619:26:619:61 | ...::connect_timeout | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:671:28:671:57 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:753:22:753:49 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:779:22:779:50 | ...::new | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | -| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:576:21:576:41 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:584:21:584:41 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:601:26:601:53 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:620:26:620:61 | ...::connect_timeout | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:672:28:672:57 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:754:22:754:49 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:780:22:780:50 | ...::new | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:807:16:807:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:807:16:807:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | | test_futures_io.rs:19:15:19:32 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | @@ -91,6 +92,3 @@ | web_frameworks.rs:58:14:58:15 | ms | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | | web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). | -testFailures -| test.rs:113:61:113:98 | //... | Missing result: Alert[rust/summary/taint-sources] | -| test.rs:120:61:120:98 | //... | Missing result: Alert[rust/summary/taint-sources] | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index 914350b68ce..adceb112dab 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -98,7 +98,8 @@ async fn test_hyper_http(case: i64) -> Result<(), Box> { println!("connecting to {}...", address); let stream = tokio::net::TcpStream::connect(address).await?; // $ Alert[rust/summary/taint-sources] let io = hyper_util::rt::TokioIo::new(stream); - let (mut sender, conn) = hyper::client::conn::http1::handshake(io).await?; + let (sender, conn) = hyper::client::conn::http1::handshake(io).await?; + let mut sender: hyper::client::conn::http1::SendRequest = sender; // drive the HTTP connection tokio::task::spawn(async move { From 47a4ba33a453b8c136c53a7c0317d2576116eb8f Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 16:00:35 +0100 Subject: [PATCH 37/96] Rust: Fix typo in models (also fixed in another open PR). --- rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml | 4 ++-- .../test/library-tests/dataflow/sources/InlineFlow.expected | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index fc86d2fb908..7aca1a852d9 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -19,8 +19,8 @@ extensions: - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["lang:std", "crate::io::Read::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["lang:std", "crate::io::Read::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected index de25fe10111..e69de29bb2d 100644 --- a/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/InlineFlow.expected @@ -1 +0,0 @@ -| test.rs:218:24:218:89 | //... | Missing result: hasTaintFlow | From e40e4c3856a9afd349e5b65c0efe367d3eb4d6b0 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Wed, 9 Jul 2025 23:06:18 -0400 Subject: [PATCH 38/96] Remove unneeded test file. --- .../.github/workflows/artifactpoison93.yml | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml deleted file mode 100644 index d463527f292..00000000000 --- a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Secure Workflow - -on: - workflow_run: - workflows: ["Prev"] - types: - - completed - -jobs: - Download: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: mkdir -p ${{ runner.temp }}/artifacts/ - - uses: dawidd6/action-download-artifact@v2 - with: - name: pr_number - path: ${{ runner.temp }}/artifacts/ - - - name: Run command - run: | - sh cmd.sh From acc06fab208176ea068226fa35e1b739d62231e1 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 10:29:16 +0200 Subject: [PATCH 39/96] C++: Convert `cpp/incorrect-string-type-conversion` test to inline expectations --- .../CWE/CWE-704/WcharCharConversion.cpp | 26 +++++++++---------- .../CWE/CWE-704/WcharCharConversion.qlref | 3 ++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp index dc2b9f4a9c1..bb90aefff21 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp @@ -18,13 +18,13 @@ void Test() wchar_t *lpWchar = NULL; LPCSTR lpcstr = "b"; - lpWchar = (LPWSTR)"a"; // BUG - lpWchar = (LPWSTR)lpcstr; // BUG + lpWchar = (LPWSTR)"a"; // $ Alert + lpWchar = (LPWSTR)lpcstr; // $ Alert - lpWchar = (wchar_t*)lpChar; // BUG + lpWchar = (wchar_t*)lpChar; // $ Alert - fconstWChar((LPCWSTR)lpChar); // BUG - fWChar((LPWSTR)lpChar); // BUG + fconstWChar((LPCWSTR)lpChar); // $ Alert + fWChar((LPWSTR)lpChar); // $ Alert lpChar = (LPSTR)"a"; // Valid lpWchar = (LPWSTR)L"a"; // Valid @@ -79,33 +79,33 @@ void CheckedConversionFalsePositiveTest3(unsigned short flags, LPTSTR buffer) if(flags & UNICODE) lpWchar = (LPWSTR)buffer; // GOOD else - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert if((flags & UNICODE) == 0x8) lpWchar = (LPWSTR)buffer; // GOOD else - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert if((flags & UNICODE) != 0x8) - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert else lpWchar = (LPWSTR)buffer; // GOOD // Bad operator precedence if(flags & UNICODE == 0x8) - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert else - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert if((flags & UNICODE) != 0) lpWchar = (LPWSTR)buffer; // GOOD else - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert if((flags & UNICODE) == 0) - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert else lpWchar = (LPWSTR)buffer; // GOOD - lpWchar = (LPWSTR)buffer; // BUG + lpWchar = (LPWSTR)buffer; // $ Alert } diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.qlref b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.qlref index 4e3b6775188..5aa0107d1f9 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.qlref +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.qlref @@ -1 +1,2 @@ -Security/CWE/CWE-704/WcharCharConversion.ql \ No newline at end of file +query: Security/CWE/CWE-704/WcharCharConversion.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From 29078610751c117af6b4d8b44056fc846e635f34 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 10:54:44 +0200 Subject: [PATCH 40/96] C++: Add `cpp/incorrect-string-type-conversion` test with unreachable code --- .../CWE/CWE-704/WcharCharConversion.cpp | 31 +++++++++++++++++++ .../CWE/CWE-704/WcharCharConversion.expected | 2 ++ 2 files changed, 33 insertions(+) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp index bb90aefff21..9f415731f6a 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp @@ -109,3 +109,34 @@ void CheckedConversionFalsePositiveTest3(unsigned short flags, LPTSTR buffer) lpWchar = (LPWSTR)buffer; // $ Alert } + +typedef unsigned long long size_t; + +size_t wcslen(const wchar_t *str); +size_t strlen(const char* str); + +template +size_t str_len(const C *str) { + if (sizeof(C) != 1) { + return wcslen((const wchar_t *)str); // $ SPURIOUS: Alert + } + + return strlen((const char *)str); +} + +template +size_t wrong_str_len(const C *str) { + if (sizeof(C) == 1) { + return wcslen((const wchar_t *)str); // $ Alert + } + + return strlen((const char *)str); +} + +void test_str_len(const wchar_t *wstr, const char *str) { + size_t len = + str_len(wstr) + + str_len(str) + + wrong_str_len(wstr) + + wrong_str_len(str); +} diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected index 9b34966aa87..73629b66829 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected @@ -11,3 +11,5 @@ | WcharCharConversion.cpp:103:21:103:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | | WcharCharConversion.cpp:106:21:106:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | | WcharCharConversion.cpp:110:20:110:25 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | +| WcharCharConversion.cpp:121:34:121:36 | str | Conversion from const char * to const wchar_t *. Use of invalid string can lead to undefined behavior. | +| WcharCharConversion.cpp:130:34:130:36 | str | Conversion from const char * to const wchar_t *. Use of invalid string can lead to undefined behavior. | From 399967b507da6c33b391e5855dfec641ccb6afcd Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 11:47:00 +0200 Subject: [PATCH 41/96] C++: Do not alert on unreachable code in `cpp/incorrect-string-type-conversion` --- cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql | 5 ++++- .../query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp | 2 +- .../Security/CWE/CWE-704/WcharCharConversion.expected | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql b/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql index e3f15bd12b5..6fc91c1d669 100644 --- a/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql +++ b/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql @@ -14,6 +14,7 @@ import cpp import semmle.code.cpp.controlflow.Guards +import semmle.code.cpp.ir.IR class WideCharPointerType extends PointerType { WideCharPointerType() { this.getBaseType() instanceof WideCharType } @@ -108,7 +109,9 @@ where // Avoid cases where the cast is guarded by a check to determine if // unicode encoding is enabled in such a way to disallow the dangerous cast // at runtime. - not isLikelyDynamicallyChecked(e1) + not isLikelyDynamicallyChecked(e1) and + // Avoid cases in unreachable blocks. + any(EnterFunctionInstruction e).getASuccessor+().getAst() = e1 select e1, "Conversion from " + e1.getType().toString() + " to " + e2.getType().toString() + ". Use of invalid string can lead to undefined behavior." diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp index 9f415731f6a..22e5ccd958d 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.cpp @@ -118,7 +118,7 @@ size_t strlen(const char* str); template size_t str_len(const C *str) { if (sizeof(C) != 1) { - return wcslen((const wchar_t *)str); // $ SPURIOUS: Alert + return wcslen((const wchar_t *)str); // GOOD -- unreachable code } return strlen((const char *)str); diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected index 73629b66829..bb56396c08c 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-704/WcharCharConversion.expected @@ -11,5 +11,4 @@ | WcharCharConversion.cpp:103:21:103:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | | WcharCharConversion.cpp:106:21:106:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | | WcharCharConversion.cpp:110:20:110:25 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. | -| WcharCharConversion.cpp:121:34:121:36 | str | Conversion from const char * to const wchar_t *. Use of invalid string can lead to undefined behavior. | | WcharCharConversion.cpp:130:34:130:36 | str | Conversion from const char * to const wchar_t *. Use of invalid string can lead to undefined behavior. | From 675a072639213f51019e0e8d985c0e8a148eb28c Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 12:16:23 +0100 Subject: [PATCH 42/96] C++: Add 'pthread_create' test with missing flow. --- .../dataflow/external-models/sinks.expected | 1 + .../dataflow/external-models/sources.expected | 1 + .../dataflow/external-models/test.cpp | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected index 2c2338a7dcc..bf84f93fa04 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected @@ -8,3 +8,4 @@ | test.cpp:29:10:29:11 | y3 | test-sink | | test.cpp:33:10:33:11 | z2 | test-sink | | test.cpp:36:10:36:11 | z3 | test-sink | +| test.cpp:48:14:48:14 | x | test-sink | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected index 8730083d016..b0f52caf00c 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected @@ -1,5 +1,6 @@ | asio_streams.cpp:87:34:87:44 | read_until output argument | remote | | test.cpp:10:10:10:18 | call to ymlSource | local | +| test.cpp:56:8:56:16 | call to ymlSource | local | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | local | | windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | local | | windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index a0b12004074..0123877acb4 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -35,3 +35,26 @@ void test() { int z3 = ymlStepGenerated_with_body(x, 0); ymlSink(z3); // clean } + +struct S { + int x; +}; + +using pthread_t = unsigned long; +using pthread_attr_t = void*; + +void *myThreadFunction(void *arg) { + S* s = (S *)arg; + ymlSink(s->x); // $ MISSING: ir + return nullptr; +} + +int pthread_create(pthread_t *thread, const pthread_attr_t * attr, void *(*start_routine)(void*), void *arg); + +int test_pthread_create() { + S s; + s.x = ymlSource(); + + pthread_t threadId; + pthread_create(&threadId, nullptr, myThreadFunction, (void *)&s); +} From d198a964e060dc8388cbba08b3e10c0e1a805a94 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 12:20:24 +0100 Subject: [PATCH 43/96] C++: Add a model for 'pthread_create' and accept test changes. --- cpp/ql/lib/ext/pthread.model.yml | 6 +++ .../dataflow/external-models/flow.expected | 44 ++++++++++++++----- .../dataflow/external-models/test.cpp | 2 +- 3 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 cpp/ql/lib/ext/pthread.model.yml diff --git a/cpp/ql/lib/ext/pthread.model.yml b/cpp/ql/lib/ext/pthread.model.yml new file mode 100644 index 00000000000..fcdb0c45d00 --- /dev/null +++ b/cpp/ql/lib/ext/pthread.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance + - ["", "", False, "pthread_create", "", "", "Argument[@3]", "Argument[2].Parameter[@0]", "value", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index 68d6aeeb6f4..2db5d6bf1d2 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -21,12 +21,13 @@ models | 20 | Summary: ; ; false; CreateRemoteThreadEx; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual | | 21 | Summary: ; ; false; CreateThread; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual | | 22 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual | -| 23 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated | -| 24 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual | -| 25 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual | -| 26 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual | +| 23 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual | +| 24 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated | +| 25 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual | +| 26 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual | +| 27 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual | edges -| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:26 | +| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:27 | | asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:91:7:91:17 | recv_buffer | provenance | Src:MaD:17 | | asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:93:29:93:39 | *recv_buffer | provenance | Src:MaD:17 Sink:MaD:2 | | asio_streams.cpp:97:37:97:44 | call to source | asio_streams.cpp:98:7:98:14 | send_str | provenance | TaintFunction | @@ -35,10 +36,10 @@ edges | asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:101:7:101:17 | send_buffer | provenance | | | asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:103:29:103:39 | *send_buffer | provenance | Sink:MaD:2 | | asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | provenance | | -| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:26 | -| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:24 | -| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:23 | -| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:25 | +| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:27 | +| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:25 | +| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:24 | +| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:26 | | test.cpp:7:47:7:52 | value2 | test.cpp:7:64:7:69 | value2 | provenance | | | test.cpp:7:64:7:69 | value2 | test.cpp:7:5:7:30 | *ymlStepGenerated_with_body | provenance | | | test.cpp:10:10:10:18 | call to ymlSource | test.cpp:10:10:10:18 | call to ymlSource | provenance | Src:MaD:16 | @@ -50,19 +51,28 @@ edges | test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | | | test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:18:10:18:10 | y | provenance | Sink:MaD:1 | | test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | provenance | | -| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:24 | +| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:25 | | test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | | | test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:22:10:22:10 | z | provenance | Sink:MaD:1 | | test.cpp:21:27:21:27 | x | test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | provenance | | -| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:23 | +| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:24 | | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | | | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:26:10:26:11 | y2 | provenance | Sink:MaD:1 | | test.cpp:25:35:25:35 | x | test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | provenance | | -| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:25 | +| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:26 | | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | | | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:33:10:33:11 | z2 | provenance | Sink:MaD:1 | | test.cpp:32:41:32:41 | x | test.cpp:7:47:7:52 | value2 | provenance | | | test.cpp:32:41:32:41 | x | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | | +| test.cpp:46:30:46:32 | *arg [x] | test.cpp:47:12:47:19 | *arg [x] | provenance | | +| test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:11:48:11 | *s [x] | provenance | | +| test.cpp:48:11:48:11 | *s [x] | test.cpp:48:14:48:14 | x | provenance | Sink:MaD:1 | +| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:23 | +| test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | test.cpp:46:30:46:32 | *arg [x] | provenance | | +| test.cpp:56:2:56:2 | *s [post update] [x] | test.cpp:59:55:59:64 | *& ... [x] | provenance | | +| test.cpp:56:2:56:18 | ... = ... | test.cpp:56:2:56:2 | *s [post update] [x] | provenance | | +| test.cpp:56:8:56:16 | call to ymlSource | test.cpp:56:2:56:18 | ... = ... | provenance | Src:MaD:16 | +| test.cpp:59:55:59:64 | *& ... [x] | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | provenance | | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | | @@ -189,6 +199,16 @@ nodes | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | semmle.label | call to ymlStepGenerated_with_body | | test.cpp:32:41:32:41 | x | semmle.label | x | | test.cpp:33:10:33:11 | z2 | semmle.label | z2 | +| test.cpp:46:30:46:32 | *arg [x] | semmle.label | *arg [x] | +| test.cpp:47:12:47:19 | *arg [x] | semmle.label | *arg [x] | +| test.cpp:48:11:48:11 | *s [x] | semmle.label | *s [x] | +| test.cpp:48:14:48:14 | x | semmle.label | x | +| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | semmle.label | [summary param] *3 in pthread_create [x] | +| test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | semmle.label | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | +| test.cpp:56:2:56:2 | *s [post update] [x] | semmle.label | *s [post update] [x] | +| test.cpp:56:2:56:18 | ... = ... | semmle.label | ... = ... | +| test.cpp:56:8:56:16 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:59:55:59:64 | *& ... [x] | semmle.label | *& ... [x] | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | semmle.label | [summary param] *0 in CommandLineToArgvA | | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | semmle.label | [summary] to write: ReturnValue[**] in CommandLineToArgvA | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | semmle.label | *call to GetCommandLineA | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index 0123877acb4..2e2c9ab41f5 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -45,7 +45,7 @@ using pthread_attr_t = void*; void *myThreadFunction(void *arg) { S* s = (S *)arg; - ymlSink(s->x); // $ MISSING: ir + ymlSink(s->x); // $ ir return nullptr; } From 2062a774fc3a699ae6a90fcdbf44e777e08b93e4 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 12:32:42 +0100 Subject: [PATCH 44/96] C++: Add 'std::thread' test with missing flow. --- .../dataflow/taint-tests/localTaint.expected | 21 + .../library-tests/dataflow/taint-tests/stl.h | 13 + .../taint-tests/test_mad-signatures.expected | 455 ++++++++++++++++++ .../dataflow/taint-tests/thread.cpp | 29 ++ 4 files changed, 518 insertions(+) create mode 100644 cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected index 1eab706df43..1bf719e630e 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected @@ -7767,6 +7767,27 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future | taint.cpp:830:20:830:34 | call to indirect_source | taint.cpp:832:23:832:24 | in | | | taint.cpp:831:15:831:17 | out | taint.cpp:832:18:832:20 | out | | | taint.cpp:831:15:831:17 | out | taint.cpp:833:8:833:10 | out | | +| thread.cpp:10:27:10:27 | s | thread.cpp:10:27:10:27 | s | | +| thread.cpp:10:27:10:27 | s | thread.cpp:11:8:11:8 | s | | +| thread.cpp:14:26:14:26 | s | thread.cpp:15:8:15:8 | s | | +| thread.cpp:18:27:18:27 | s | thread.cpp:18:27:18:27 | s | | +| thread.cpp:18:27:18:27 | s | thread.cpp:19:8:19:8 | s | | +| thread.cpp:18:34:18:34 | y | thread.cpp:20:8:20:8 | y | | +| thread.cpp:24:5:24:5 | s | thread.cpp:25:3:25:3 | s | | +| thread.cpp:24:5:24:5 | s | thread.cpp:26:38:26:38 | s | | +| thread.cpp:24:5:24:5 | s | thread.cpp:27:37:27:37 | s | | +| thread.cpp:24:5:24:5 | s | thread.cpp:28:38:28:38 | s | | +| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:26:38:26:38 | s | | +| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:27:37:27:37 | s | | +| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:28:38:28:38 | s | | +| thread.cpp:25:3:25:16 | ... = ... | thread.cpp:25:5:25:5 | x [post update] | | +| thread.cpp:25:9:25:14 | call to source | thread.cpp:25:3:25:16 | ... = ... | | +| thread.cpp:26:18:26:39 | call to thread | thread.cpp:29:1:29:1 | t1 | | +| thread.cpp:26:38:26:38 | s | thread.cpp:26:37:26:38 | & ... | | +| thread.cpp:27:18:27:38 | call to thread | thread.cpp:29:1:29:1 | t2 | | +| thread.cpp:27:37:27:37 | ref arg s | thread.cpp:28:38:28:38 | s | | +| thread.cpp:28:18:28:43 | call to thread | thread.cpp:29:1:29:1 | t3 | | +| thread.cpp:28:38:28:38 | s | thread.cpp:28:37:28:38 | & ... | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | | | vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/stl.h b/cpp/ql/test/library-tests/dataflow/taint-tests/stl.h index 01e5f3b929b..57be2e9769a 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/stl.h +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/stl.h @@ -681,4 +681,17 @@ namespace std { // the model for `format`. template int same_signature_as_format_but_different_name(format_string, Args &&...args); +} + +namespace std { + class thread { + public: + template + explicit thread(F&&, Args&&...); + + ~thread(); + + void join(); + void detach(); + }; } \ No newline at end of file diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected index 3d4dd65d112..9a128a36035 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected @@ -17670,6 +17670,446 @@ signatureMatches | taint.cpp:822:6:822:19 | take_const_ptr | (unsigned long *,const char *) | | set_cert_ex | 1 | | taint.cpp:822:6:822:19 | take_const_ptr | (unsigned long *,const char *) | | set_name_ex | 1 | | taint.cpp:822:6:822:19 | take_const_ptr | (uv_pipe_t *,const char *) | | uv_pipe_bind | 1 | +| thread.cpp:4:6:4:9 | sink | (int) | | ASN1_STRING_type_new | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ASN1_tag2bit | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ASN1_tag2str | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | EVP_PKEY_asn1_get0 | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | Jim_ReturnCode | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | Jim_SignalId | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | OBJ_nid2ln | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | OBJ_nid2obj | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | OBJ_nid2sn | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | OSSL_STORE_INFO_type_string | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | OSSL_trace_get_category_name | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | PKCS12_init | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | Symbol_Nth | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | X509_PURPOSE_get0 | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | X509_PURPOSE_get_by_id | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | X509_TRUST_get0 | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | X509_TRUST_get_by_id | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | X509_VERIFY_PARAM_get0 | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __btowc | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __current_locale_name | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __fdopendir | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __get_errlist | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __get_errname | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __math_invalid_i | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __math_invalidf_i | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __p_class | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __p_rcode | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __p_type | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __pkey_get | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __sigdescr_np | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | __strerrordesc_np | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | _tolower | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | _toupper | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | btowc | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | c_tolower | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | c_toupper | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | curlx_sitouz | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | evp_pkey_type2name | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | inet6_option_space | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isalnum | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isalpha | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isblank | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | iscntrl | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isdigit | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isgraph | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | islower | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isprint | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ispunct | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isspace | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isupper | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | isxdigit | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ossl_cmp_bodytype_to_string | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ossl_tolower | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | ossl_toupper | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | sigabbrev_np | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | sqlite3_compileoption_get | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | sqlite3_errstr | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | strerrorname_np | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | support_report_failure | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | svcudp_create | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | tls13_alert_code | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | toascii | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | tolower | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | toupper | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uabs | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uv__accept | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uv_err_name | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uv_get_osfhandle | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uv_strerror | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | uv_translate_sys_error | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | | zError | 0 | +| thread.cpp:4:6:4:9 | sink | (int) | __pthread_cleanup_class | __setdoit | 0 | +| thread.cpp:18:6:18:22 | thread_function_3 | (ASN1_STRING *,int) | | ASN1_STRING_length_set | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (ASYNC_WAIT_CTX *,int) | | ASYNC_WAIT_CTX_set_status | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | BN_clear_bit | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | BN_mask_bits | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | BN_set_bit | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | BN_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | bn_expand2 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | bn_wexpand | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIGNUM *,int) | | ossl_bn_mask_bits_fixed_top | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_find_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_set_init | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_set_retry_reason | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | BIO_set_shutdown | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (BIO *,int) | | TXT_DB_read | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (CMS_SignerInfo *,int) | | CMS_signed_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (CMS_SignerInfo *,int) | | CMS_unsigned_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (CURL *,int) | | curl_easy_pause | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (Curl_easy *,int) | | Curl_conn_get_socket | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DH *,int) | | DH_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DH *,int) | | DH_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DH_METHOD *,int) | | DH_meth_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DSA *,int) | | DSA_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DSA *,int) | | DSA_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (DSA_METHOD *,int) | | DSA_meth_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EC_GROUP *,int) | | EC_GROUP_set_asn1_flag | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EC_GROUP *,int) | | EC_GROUP_set_curve_name | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EC_KEY *,int) | | EC_KEY_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EC_KEY *,int) | | EC_KEY_set_asn1_flag | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EC_KEY *,int) | | EC_KEY_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (ENGINE *,int) | | ENGINE_cmd_is_executable | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (ENGINE *,int) | | ENGINE_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER *,int) | | EVP_CIPHER_meth_set_impl_ctx_size | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER *,int) | | EVP_CIPHER_meth_set_iv_length | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER_CTX *,int) | | EVP_CIPHER_CTX_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER_CTX *,int) | | EVP_CIPHER_CTX_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER_CTX *,int) | | EVP_CIPHER_CTX_set_key_length | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_CIPHER_CTX *,int) | | EVP_CIPHER_CTX_set_num | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_KEYMGMT *,int) | | evp_keymgmt_util_query_operation_name | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_MD *,int) | | EVP_MD_meth_set_app_datasize | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_MD *,int) | | EVP_MD_meth_set_input_blocksize | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_MD *,int) | | EVP_MD_meth_set_result_size | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_MD_CTX *,int) | | EVP_MD_CTX_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_MD_CTX *,int) | | EVP_MD_CTX_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY *,int) | | EVP_PKEY_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY *,int) | | EVP_PKEY_save_parameters | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY *,int) | | EVP_PKEY_set_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_get_keygen_info | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_dh_kdf_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_dh_nid | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_dh_paramgen_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_dh_rfc5114 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_dhx_rfc5114 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_ec_param_enc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_ec_paramgen_curve_nid | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_ecdh_kdf_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_hkdf_mode | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_rsa_padding | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (EVP_PKEY_CTX *,int) | | EVP_PKEY_CTX_set_rsa_pss_saltlen | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FFC_PARAMS *,int) | | ossl_ffc_params_set_gindex | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FFC_PARAMS *,int) | | ossl_ffc_params_set_h | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FFC_PARAMS *,int) | | ossl_ffc_params_set_pcounter | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_default_pbackfail | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_fwide | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_init | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_init_internal | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_new_file_attach | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_new_file_overflow | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_old_init | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_sputbackc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_str_overflow | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | _IO_str_pbackfail | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | __printf_buffer_as_file_overflow | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FILE *,int) | | __wprintf_buffer_as_file_overflow | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (FTS *,int) | | fts_children | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | _libssh2_channel_extended_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | _libssh2_channel_flush | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | libssh2_channel_flush_ex | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | libssh2_channel_handle_extended_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | libssh2_channel_handle_extended_data2 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_CHANNEL *,int) | | libssh2_channel_set_blocking | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_SESSION *,int) | | _libssh2_session_set_blocking | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_SESSION *,int) | | libssh2_hostkey_hash | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_SESSION *,int) | | libssh2_session_methods | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_SESSION *,int) | | libssh2_session_set_blocking | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LIBSSH2_SESSION *,int) | | libssh2_session_startup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (LPCOLESTR,int) | CComBSTR | Append | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_BASICRESP *,int) | | OCSP_BASICRESP_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_BASICRESP *,int) | | OCSP_BASICRESP_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_BASICRESP *,int) | | OCSP_resp_get0 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_ONEREQ *,int) | | OCSP_ONEREQ_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_ONEREQ *,int) | | OCSP_ONEREQ_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_REQUEST *,int) | | OCSP_REQUEST_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_REQUEST *,int) | | OCSP_REQUEST_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_REQUEST *,int) | | OCSP_request_onereq_get0 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_SINGLERESP *,int) | | OCSP_SINGLERESP_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OCSP_SINGLERESP *,int) | | OCSP_SINGLERESP_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OPENSSL_STACK *,int) | | OPENSSL_sk_delete | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OPENSSL_STACK *,int) | | OPENSSL_sk_reserve | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OPENSSL_sk_compfunc,int) | | OPENSSL_sk_new_reserve | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_ACKM *,int) | | ossl_ackm_get_ack_deadline | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_ACKM *,int) | | ossl_ackm_get_ack_frame | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_ACKM *,int) | | ossl_ackm_get_largest_acked | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_ACKM *,int) | | ossl_ackm_on_pkt_space_discarded | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_CTX *,int) | | OSSL_CMP_CTX_set_serverPort | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_CTX *,int) | | ossl_cmp_ctx_set_failInfoCode | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_CTX *,int) | | ossl_cmp_ctx_set_status | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_CTX *,int) | | ossl_cmp_msg_create | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_CTX *,int) | | ossl_cmp_pollReq_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_MSG *,int) | | ossl_cmp_msg_set_bodytype | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_PKIHEADER *,int) | | ossl_cmp_hdr_set_pvno | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_REVREPCONTENT *,int) | | ossl_cmp_revrepcontent_get_CertId | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_REVREPCONTENT *,int) | | ossl_cmp_revrepcontent_get_pkisi | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_SRV_CTX *,int) | | OSSL_CMP_SRV_CTX_set_accept_raverified | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_SRV_CTX *,int) | | OSSL_CMP_SRV_CTX_set_accept_unprotected | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_SRV_CTX *,int) | | OSSL_CMP_SRV_CTX_set_grant_implicit_confirm | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CMP_SRV_CTX *,int) | | OSSL_CMP_SRV_CTX_set_send_unprotected_errors | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_CRMF_PKIPUBLICATIONINFO *,int) | | OSSL_CRMF_MSG_set_PKIPublicationInfo_action | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_DECODER_CTX *,int) | | OSSL_DECODER_CTX_set_selection | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_ENCODER_CTX *,int) | | OSSL_ENCODER_CTX_set_selection | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | OSSL_LIB_CTX_get_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | OSSL_LIB_CTX_set_conf_diagnostics | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | ossl_ctx_global_properties | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | ossl_dh_new_by_nid_ex | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | ossl_lib_ctx_get_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_LIB_CTX *,int) | | ossl_mac_key_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_PARAM *,int) | | OSSL_PARAM_set_int | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_QRX *,int) | | ossl_qrx_get_bytes_received | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_RECORD_LAYER *,int) | | tls_set_first_handshake | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_RECORD_LAYER *,int) | | tls_set_plain_alerts | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (OSSL_STORE_CTX *,int) | | OSSL_STORE_expect | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (PKCS7 *,int) | | PKCS7_set_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_CHANNEL *,int) | | ossl_quic_channel_new_stream_local | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_ENGINE *,int) | | ossl_quic_engine_set_inhibit_tick | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_PORT *,int) | | ossl_quic_port_set_allow_incoming | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_RCIDM *,int) | | ossl_quic_rcidm_get_preferred_tx_dcid_changed | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_RSTREAM *,int) | | ossl_quic_rstream_set_cleanse | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_RXFC *,int) | | ossl_quic_rxfc_get_error | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_RXFC *,int) | | ossl_quic_rxfc_has_cwm_changed | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_SSTREAM *,int) | | ossl_quic_sstream_set_cleanse | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_STREAM_MAP *,int) | | ossl_quic_stream_map_get_accept_queue_len | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (QUIC_TXFC *,int) | | ossl_quic_txfc_has_become_blocked | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA *,int) | | RSA_clear_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA *,int) | | RSA_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA_METHOD *,int) | | RSA_meth_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA_PSS_PARAMS_30 *,int) | | ossl_rsa_pss_params_30_set_hashalg | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA_PSS_PARAMS_30 *,int) | | ossl_rsa_pss_params_30_set_maskgenhashalg | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA_PSS_PARAMS_30 *,int) | | ossl_rsa_pss_params_30_set_saltlen | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (RSA_PSS_PARAMS_30 *,int) | | ossl_rsa_pss_params_30_set_trailerfield | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_key_update | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_post_handshake_auth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_purpose | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_quic_tls_early_data_enabled | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_quiet_shutdown | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_read_ahead | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_security_level | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_shutdown | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_trust | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL *,int) | | SSL_set_verify_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CONNECTION *,int) | | dtls1_read_failed | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CONNECTION *,int) | | ossl_statem_send_fatal | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CONNECTION *,int) | | ossl_statem_set_in_init | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CONNECTION *,int) | | tls1_shared_group | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_post_handshake_auth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_purpose | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_quiet_shutdown | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_security_level | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_srp_strength | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_trust | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | SSL_CTX_set_verify_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_CTX *,int) | | ssl_md | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (SSL_SESSION *,int) | | SSL_SESSION_set_protocol_version | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_REQ *,int) | | TS_REQ_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_REQ *,int) | | TS_REQ_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_RESP_CTX *,int) | | TS_RESP_CTX_add_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_STATUS_INFO *,int) | | TS_STATUS_INFO_set_status | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_TST_INFO *,int) | | TS_TST_INFO_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_TST_INFO *,int) | | TS_TST_INFO_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_VERIFY_CTX *,int) | | TS_VERIFY_CTX_add_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (TS_VERIFY_CTX *,int) | | TS_VERIFY_CTX_set_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (WPACKET *,int) | | ossl_DER_w_begin_sequence | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509 *,int) | | X509_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509 *,int) | | X509_self_signed | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_ACERT *,int) | | X509_ACERT_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_ATTRIBUTE *,int) | | X509_ATTRIBUTE_get0_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_CRL *,int) | | X509_CRL_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_NAME *,int) | | X509_NAME_delete_entry | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_REQ *,int) | | X509_REQ_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_REVOKED *,int) | | X509_REVOKED_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE *,int) | | X509_STORE_set_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE *,int) | | X509_STORE_set_purpose | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE *,int) | | X509_STORE_set_trust | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE_CTX *,int) | | X509_STORE_CTX_set_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE_CTX *,int) | | X509_STORE_CTX_set_error | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE_CTX *,int) | | X509_STORE_CTX_set_error_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE_CTX *,int) | | X509_STORE_CTX_set_purpose | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_STORE_CTX *,int) | | X509_STORE_CTX_set_trust | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_VERIFY_PARAM *,int) | | X509_VERIFY_PARAM_get0_host | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_VERIFY_PARAM *,int) | | X509_VERIFY_PARAM_set_auth_level | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_VERIFY_PARAM *,int) | | X509_VERIFY_PARAM_set_depth | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_VERIFY_PARAM *,int) | | X509_VERIFY_PARAM_set_purpose | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (X509_VERIFY_PARAM *,int) | | X509_VERIFY_PARAM_set_trust | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (_Float128,int) | | __ldexpf128 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (_Float128,int) | | __scalbnf128 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (__sigset_t *,int) | | __sigaddset_compat | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (__sigset_t *,int) | | __sigdelset_compat | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (acttab *,int) | | acttab_insert | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (addrinfo *,int) | | support_format_addrinfo | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (aiocb_union *,int) | | __aio_enqueue_request | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (argp_fmtstream_t,int) | | __argp_fmtstream_putc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (char **,int) | | addrsort | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (char *,int) | | Curl_str2addr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (char *,int) | | PEM_proc_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (char,int) | CStringT | CStringT | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (connectdata *,int) | | Curl_conn_is_ssl | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const ASN1_BIT_STRING *,int) | | ASN1_BIT_STRING_get_bit | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const BIGNUM *,int) | | BN_get_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const BIGNUM *,int) | | BN_is_bit_set | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const BIO *,int) | | BIO_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const BIO *,int) | | BIO_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const CMS_SignerInfo *,int) | | CMS_signed_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const CMS_SignerInfo *,int) | | CMS_unsigned_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const CRYPTO_EX_DATA *,int) | | CRYPTO_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DH *,int) | | DH_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DH *,int) | | DH_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DH *,int) | | ossl_dh_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DSA *,int) | | DSA_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DSA *,int) | | DSA_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const DSA *,int) | | ossl_dsa_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const ECX_KEY *,int) | | ossl_ecx_key_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EC_KEY *,int) | | EC_KEY_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EC_KEY *,int) | | ossl_ec_key_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const ENGINE *,int) | | ENGINE_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EVP_CIPHER_CTX *,int) | | EVP_CIPHER_CTX_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EVP_MD_CTX *,int) | | EVP_MD_CTX_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EVP_PKEY *,int) | | EVP_PKEY_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const EVP_PKEY *,int) | | EVP_PKEY_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const ML_DSA_KEY *,int) | | ossl_ml_dsa_key_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const ML_KEM_KEY *,int) | | ossl_ml_kem_key_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OPENSSL_STACK *,int) | | OPENSSL_sk_value | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OSSL_CMP_CERTREPMESSAGE *,int) | | ossl_cmp_certrepmessage_get0_certresponse | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OSSL_CMP_CTX *,int) | | OSSL_CMP_CTX_get0_newPkey | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OSSL_CMP_CTX *,int) | | OSSL_CMP_CTX_get_option | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OSSL_CMP_PKISI *,int) | | ossl_cmp_pkisi_check_pkifailureinfo | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const OSSL_CMP_POLLREPCONTENT *,int) | | ossl_cmp_pollrepcontent_get0_pollrep | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const QUIC_CHANNEL *,int) | | ossl_quic_channel_get_local_stream_count_avail | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const QUIC_CHANNEL *,int) | | ossl_quic_channel_get_remote_stream_count_avail | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const RSA *,int) | | RSA_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const RSA *,int) | | RSA_test_flags | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const RSA *,int) | | ossl_rsa_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const SLH_DSA_KEY *,int) | | ossl_slh_dsa_key_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const SSL *,int) | | SSL_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const SSL_CTX *,int) | | SSL_CTX_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const SSL_SESSION *,int) | | SSL_SESSION_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const SSL_SESSION *,int) | | ssl_session_dup | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const UI *,int) | | UI_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const UI_METHOD *,int) | | UI_method_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509 *,int) | | X509_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509 *,int) | | X509_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_ACERT *,int) | | X509_ACERT_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_CRL *,int) | | X509_CRL_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_NAME *,int) | | X509_NAME_get_entry | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_POLICY_LEVEL *,int) | | X509_policy_level_get0_node | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_POLICY_TREE *,int) | | X509_policy_tree_get0_level | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_REQ *,int) | | X509_REQ_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_REVOKED *,int) | | X509_REVOKED_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_STORE *,int) | | X509_STORE_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const X509_STORE_CTX *,int) | | X509_STORE_CTX_get_ex_data | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const XCHAR *,int) | CStringT | CStringT | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const YCHAR *,int) | CStringT | CStringT | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | DH_meth_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | DSA_meth_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | Jim_StrDupLen | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | NETSCAPE_SPKI_b64_decode | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | RSA_meth_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | ftok | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | gethostbyname2 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | parse_yesno | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const char *,int) | | res_gethostbyname2 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const stack_st_X509_ATTRIBUTE *,int) | | X509at_get_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const stack_st_X509_EXTENSION *,int) | | X509v3_get_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const unsigned char *,int) | | Jim_GenHashFunction | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const unsigned char *,int) | | OPENSSL_uni2asc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const unsigned char *,int) | | OPENSSL_uni2utf8 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (const void *,int) | | inet6_rth_getaddr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (double,int) | | __ldexp | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (double,int) | | __scalbn | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (double[],int) | | getloadavg | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (dynhds *,int) | | Curl_dynhds_set_opts | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (fexcept_t *,int) | | fegetexceptflag | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (float,int) | | __ldexpf | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (float,int) | | __scalbnf | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (gzFile,int) | | gzflush | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (gzFile,int) | | gzputc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int *,int) | | X509_PURPOSE_set | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int *,int) | | X509_TRUST_set | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int *,int) | | __lll_unlock_elision | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | BN_security_bits | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | EVP_MD_meth_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | EVP_PKEY_meth_new | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | __isctype | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | acttab_alloc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | div | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (int,int) | | inet6_rth_space | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (long double,int) | | __ldexpl | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (netlink_handle *,int) | | __netlink_request | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_auto_ping_ack | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_auto_window_update | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_closed_streams | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_http_messaging | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_recv_client_magic | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (nghttp2_option *,int) | | nghttp2_option_set_server_fallback_rfc7540_priorities | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (ns_msg,int) | | ns_msg_getflag | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (obstack *,int) | | _obstack_newchunk | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (posix_spawnattr_t *,int) | | posix_spawnattr_setcgroup_np | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (posix_spawnattr_t *,int) | | posix_spawnattr_setschedpolicy | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_attr_t *,int) | | __pthread_attr_setschedpolicy | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_barrierattr_t *,int) | | __pthread_barrierattr_setpshared | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_mutexattr_t *,int) | | ___pthread_mutexattr_settype | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_mutexattr_t *,int) | | __pthread_mutexattr_setprioceiling | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_mutexattr_t *,int) | | __pthread_mutexattr_setprotocol | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_rwlockattr_t *,int) | | __pthread_rwlockattr_setkind_np | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (pthread_rwlockattr_t *,int) | | __pthread_rwlockattr_setpshared | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (rule *,int) | | Configlist_add | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (rule *,int) | | Configlist_addbasis | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sigset_t *,int) | | sigaddset | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sigset_t *,int) | | sigdelset | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3 *,int) | | sqlite3_busy_timeout | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3 *,int) | | sqlite3_db_name | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3 *,int) | | sqlite3_wal_autocheckpoint | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_backup *,int) | | sqlite3_backup_step | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_context *,int) | | sqlite3_aggregate_context | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_context *,int) | | sqlite3_result_error_code | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_index_info *,int) | | sqlite3_vtab_collation | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_bind_parameter_name | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_blob | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_bytes | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_bytes16 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_decltype | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_decltype16 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_double | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_int | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_int64 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_name | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_name16 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_text | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_text16 | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_type | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_column_value | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (sqlite3_stmt *,int) | | sqlite3_stmt_explain | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (stack_st_PKCS7 *,int) | | PKCS12_add_safes | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (stack_st_SSL_COMP *,int) | | ssl3_comp_find | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (stack_st_X509_ATTRIBUTE *,int) | | X509at_delete_attr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (stack_st_X509_EXTENSION *,int) | | X509v3_delete_ext | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (timespec *,int) | | __timespec_get | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (timespec *,int) | | __timespec_getres | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (uint16_t,int) | | tls1_group_id2nid | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (unsigned char *,int) | | RAND_bytes | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (unsigned char *,int) | | RAND_priv_bytes | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (unsigned char *,int) | | ossl_ipaddr_to_asc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (unsigned short,int) | | dtls1_get_queue_priority | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (uv_env_item_t *,int) | | uv_os_free_environ | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (void *,int) | | DSO_dsobyaddr | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (void *,int) | | sqlite3_realloc | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (void *const *,int) | | __backtrace_symbols | 1 | +| thread.cpp:18:6:18:22 | thread_function_3 | (wchar_t,int) | CStringT | CStringT | 1 | | vector.cpp:13:6:13:9 | sink | (int) | | ASN1_STRING_type_new | 0 | | vector.cpp:13:6:13:9 | sink | (int) | | ASN1_tag2bit | 0 | | vector.cpp:13:6:13:9 | sink | (int) | | ASN1_tag2str | 0 | @@ -46491,6 +46931,14 @@ getParameterTypeName | stl.h:678:33:678:38 | format | 1 | func:0 && | | stl.h:683:6:683:48 | same_signature_as_format_but_different_name | 0 | format_string | | stl.h:683:6:683:48 | same_signature_as_format_but_different_name | 1 | func:0 && | +| stl.h:687:8:687:8 | operator= | 0 | const thread & | +| stl.h:687:8:687:8 | thread | 0 | const thread & | +| stl.h:690:12:690:17 | thread | 0 | func:0 && | +| stl.h:690:12:690:17 | thread | 0 | func:0 && | +| stl.h:690:12:690:17 | thread | 0 | func:0 && | +| stl.h:690:12:690:17 | thread | 1 | func:1 && | +| stl.h:690:12:690:17 | thread | 1 | func:1 && | +| stl.h:690:12:690:17 | thread | 1 | func:1 && | | string.cpp:17:6:17:9 | sink | 0 | const char * | | string.cpp:18:6:18:9 | sink | 0 | const string & | | string.cpp:19:6:19:9 | sink | 0 | const char * | @@ -46741,6 +47189,13 @@ getParameterTypeName | taint.cpp:817:6:817:27 | write_to_const_ptr_ptr | 1 | const char ** | | taint.cpp:822:6:822:19 | take_const_ptr | 0 | const char * | | taint.cpp:822:6:822:19 | take_const_ptr | 1 | const char * | +| thread.cpp:4:6:4:9 | sink | 0 | int | +| thread.cpp:6:8:6:8 | operator= | 0 | S && | +| thread.cpp:6:8:6:8 | operator= | 0 | const S & | +| thread.cpp:10:6:10:22 | thread_function_1 | 0 | S * | +| thread.cpp:14:6:14:22 | thread_function_2 | 0 | S | +| thread.cpp:18:6:18:22 | thread_function_3 | 0 | S * | +| thread.cpp:18:6:18:22 | thread_function_3 | 1 | int | | vector.cpp:13:6:13:9 | sink | 0 | int | | vector.cpp:14:27:14:30 | sink | 0 | vector> & | | vector.cpp:14:27:14:30 | sink | 0 | vector> & | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp new file mode 100644 index 00000000000..dbc6604b0f4 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp @@ -0,0 +1,29 @@ +#include "stl.h" + +int source(); +void sink(int); + +struct S { + int x; +}; + +void thread_function_1(S* s) { + sink(s->x); // $ MISSING: ir +} + +void thread_function_2(S s) { + sink(s.x); // $ MISSING: ir +} + +void thread_function_3(S* s, int y) { + sink(s->x); // $ MISSING: ir + sink(y); // clean +} + +void test_thread() { + S s; + s.x = source(); + std::thread t1(thread_function_1, &s); + std::thread t2(thread_function_2, s); + std::thread t3(thread_function_3, &s, 42); +} \ No newline at end of file From 89cf215ebb718b0e5cb493c4cb145de46318bd84 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 12:45:20 +0100 Subject: [PATCH 45/96] C++: Add models for 'std::thread' and accept test changes. --- cpp/ql/lib/ext/std.thread.model.yml | 11 +++++++++++ .../library-tests/dataflow/taint-tests/thread.cpp | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 cpp/ql/lib/ext/std.thread.model.yml diff --git a/cpp/ql/lib/ext/std.thread.model.yml b/cpp/ql/lib/ext/std.thread.model.yml new file mode 100644 index 00000000000..77062fae3d0 --- /dev/null +++ b/cpp/ql/lib/ext/std.thread.model.yml @@ -0,0 +1,11 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance + - ["std", "thread", True, "thread", "", "", "Argument[*@1]", "Argument[0].Parameter[@0]", "value", "manual"] + - ["std", "thread", True, "thread", "", "", "Argument[*@2]", "Argument[0].Parameter[@1]", "value", "manual"] + - ["std", "thread", True, "thread", "", "", "Argument[*@3]", "Argument[0].Parameter[@2]", "value", "manual"] + - ["std", "thread", True, "thread", "", "", "Argument[*@4]", "Argument[0].Parameter[@3]", "value", "manual"] + - ["std", "thread", True, "thread", "", "", "Argument[*@5]", "Argument[0].Parameter[@4]", "value", "manual"] + \ No newline at end of file diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp index dbc6604b0f4..b0393801a94 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp @@ -8,15 +8,15 @@ struct S { }; void thread_function_1(S* s) { - sink(s->x); // $ MISSING: ir + sink(s->x); // $ ir } void thread_function_2(S s) { - sink(s.x); // $ MISSING: ir + sink(s.x); // $ ir } void thread_function_3(S* s, int y) { - sink(s->x); // $ MISSING: ir + sink(s->x); // $ ir sink(y); // clean } From 95c2b9f8f79c255eeaabcf53e7d7c09db17c9ef4 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 8 Jul 2025 09:27:34 +0200 Subject: [PATCH 46/96] Rust: Add more type inference tests --- .../PathResolutionConsistency.expected | 18 +- .../test/library-tests/type-inference/main.rs | 90 ++ .../type-inference/type-inference.expected | 1167 +++++++++-------- 3 files changed, 733 insertions(+), 542 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected index 47ca3730f5b..d94235e8e53 100644 --- a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected @@ -1,9 +1,13 @@ multipleCallTargets | dereference.rs:61:15:61:24 | e1.deref() | -| main.rs:2096:13:2096:31 | ...::from(...) | -| main.rs:2097:13:2097:31 | ...::from(...) | -| main.rs:2098:13:2098:31 | ...::from(...) | -| main.rs:2104:13:2104:31 | ...::from(...) | -| main.rs:2105:13:2105:31 | ...::from(...) | -| main.rs:2106:13:2106:31 | ...::from(...) | -| main.rs:2142:21:2142:43 | ...::from(...) | +| main.rs:2129:17:2129:35 | ...::my_from(...) | +| main.rs:2130:17:2130:34 | ...::my_from(...) | +| main.rs:2132:9:2132:34 | ...::my_from2(...) | +| main.rs:2133:9:2133:33 | ...::my_from2(...) | +| main.rs:2186:13:2186:31 | ...::from(...) | +| main.rs:2187:13:2187:31 | ...::from(...) | +| main.rs:2188:13:2188:31 | ...::from(...) | +| main.rs:2194:13:2194:31 | ...::from(...) | +| main.rs:2195:13:2195:31 | ...::from(...) | +| main.rs:2196:13:2196:31 | ...::from(...) | +| main.rs:2232:21:2232:43 | ...::from(...) | diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 81b9e5eb4b1..5d947d41a37 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2042,6 +2042,80 @@ mod method_determined_by_argument_type { } } + trait MyFrom { + // MyFrom::my_from + fn my_from(value: T) -> Self; + } + + impl MyFrom for i64 { + // MyFrom::my_from + fn my_from(value: i64) -> Self { + value + } + } + + impl MyFrom for i64 { + // MyFrom::my_from + fn my_from(value: bool) -> Self { + if value { 1 } else { 0 } + } + } + + trait MyFrom2 { + // MyFrom2::my_from2 + fn my_from2(value: T, x: Self) -> (); + } + + impl MyFrom2 for i64 { + // MyFrom2::my_from2 + fn my_from2(value: i64, _: Self) -> () { + value; + } + } + + impl MyFrom2 for i64 { + // MyFrom2::my_from2 + fn my_from2(value: bool, _: Self) -> () { + if value { + 1 + } else { + 0 + }; + } + } + + trait MySelfTrait { + // MySelfTrait::f1 + fn f1(x: Self) -> i64; + + // MySelfTrait::f2 + fn f2(x: Self) -> Self; + } + + impl MySelfTrait for i64 { + // MySelfTrait::f1 + fn f1(x: Self) -> i64 { + x + 1 + } + + // MySelfTrait::f2 + fn f2(x: Self) -> Self { + x + 1 + } + } + + impl MySelfTrait for bool { + // MySelfTrait::f1 + fn f1(x: Self) -> i64 { + 0 + } + + // MySelfTrait::f2 + fn f2(x: Self) -> Self { + x + } + } + pub fn f() { let x: i64 = 73; x.my_add(5i64); // $ method=MyAdd::my_add @@ -2051,6 +2125,22 @@ mod method_determined_by_argument_type { S(1i64).my_add(S(2i64)); // $ method=S::my_add1 S(1i64).my_add(3i64); // $ MISSING: method=S::my_add2 S(1i64).my_add(&3i64); // $ method=S::my_add3 + + let x = i64::my_from(73i64); // $ method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from + let y = i64::my_from(true); // $ method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from + let z: i64 = MyFrom::my_from(73i64); // $ MISSING: method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from + i64::my_from2(73i64, 0i64); // $ method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 + i64::my_from2(true, 0i64); // $ method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 + MyFrom2::my_from2(73i64, 0i64); // $ MISSING: method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 + + i64::f1(73i64); // $ method=MySelfTrait::f1 + i64::f2(73i64); // $ method=MySelfTrait::f2 + bool::f1(true); // $ method=MySelfTrait::f1 + bool::f2(true); // $ method=MySelfTrait::f2 + MySelfTrait::f1(73i64); // $ SPURIOUS method=MySelfTrait::f1 MISSING: method=MySelfTrait::f1 + MySelfTrait::f2(73i64); // $ SPURIOUS method=MySelfTrait::f2 MISSING: method=MySelfTrait::f2 + MySelfTrait::f1(true); // $ SPURIOUS method=MySelfTrait::f1 MISSING: method=MySelfTrait::f1 + MySelfTrait::f2(true); // $ SPURIOUS method=MySelfTrait::f2 MISSING: method=MySelfTrait::f2 } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 82b2668b513..896b75eec04 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -3140,539 +3140,636 @@ inferType | main.rs:2041:16:2041:21 | self.0 | | main.rs:2033:14:2033:14 | T | | main.rs:2041:31:2041:35 | other | | file://:0:0:0:0 | & | | main.rs:2041:31:2041:35 | other | &T | main.rs:2033:14:2033:14 | T | -| main.rs:2046:13:2046:13 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2046:13:2046:13 | x | | {EXTERNAL LOCATION} | i64 | -| main.rs:2046:22:2046:23 | 73 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2046:22:2046:23 | 73 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2047:9:2047:9 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2047:9:2047:9 | x | | {EXTERNAL LOCATION} | i64 | -| main.rs:2047:9:2047:22 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2047:18:2047:21 | 5i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2048:9:2048:9 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2048:9:2048:9 | x | | {EXTERNAL LOCATION} | i64 | -| main.rs:2048:9:2048:23 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2048:18:2048:22 | &5i64 | | file://:0:0:0:0 | & | -| main.rs:2048:18:2048:22 | &5i64 | &T | {EXTERNAL LOCATION} | i64 | -| main.rs:2048:19:2048:22 | 5i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2049:9:2049:9 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2049:9:2049:9 | x | | {EXTERNAL LOCATION} | i64 | -| main.rs:2049:9:2049:22 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2049:18:2049:21 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:2051:9:2051:15 | S(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2051:9:2051:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | -| main.rs:2051:9:2051:31 | ... .my_add(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2051:11:2051:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2051:24:2051:30 | S(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2051:24:2051:30 | S(...) | T | {EXTERNAL LOCATION} | i64 | -| main.rs:2051:26:2051:29 | 2i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2052:9:2052:15 | S(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2052:9:2052:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | -| main.rs:2052:11:2052:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2052:24:2052:27 | 3i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2053:9:2053:15 | S(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2053:9:2053:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | -| main.rs:2053:9:2053:29 | ... .my_add(...) | | main.rs:2013:5:2013:19 | S | -| main.rs:2053:11:2053:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2053:24:2053:28 | &3i64 | | file://:0:0:0:0 | & | -| main.rs:2053:24:2053:28 | &3i64 | &T | {EXTERNAL LOCATION} | i64 | -| main.rs:2053:25:2053:28 | 3i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2061:26:2063:9 | { ... } | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2062:13:2062:25 | MyCallable {...} | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2065:17:2065:21 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:2065:17:2065:21 | SelfParam | &T | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2065:31:2067:9 | { ... } | | {EXTERNAL LOCATION} | i32 | -| main.rs:2065:31:2067:9 | { ... } | | {EXTERNAL LOCATION} | i64 | -| main.rs:2066:13:2066:13 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2066:13:2066:13 | 1 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2073:13:2073:13 | i | | {EXTERNAL LOCATION} | i32 | -| main.rs:2073:18:2073:26 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2073:18:2073:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2073:19:2073:19 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2073:22:2073:22 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2073:25:2073:25 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2074:18:2074:26 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2074:18:2074:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2074:18:2074:41 | ... .map(...) | | file://:0:0:0:0 | [] | -| main.rs:2074:19:2074:19 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2074:22:2074:22 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2074:25:2074:25 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2074:40:2074:40 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2075:18:2075:26 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2075:18:2075:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2075:19:2075:19 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2075:22:2075:22 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2075:25:2075:25 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:13:2077:17 | vals1 | | file://:0:0:0:0 | [] | -| main.rs:2077:13:2077:17 | vals1 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:13:2077:17 | vals1 | [T;...] | {EXTERNAL LOCATION} | u8 | -| main.rs:2077:21:2077:31 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2077:21:2077:31 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:21:2077:31 | [...] | [T;...] | {EXTERNAL LOCATION} | u8 | -| main.rs:2077:22:2077:24 | 1u8 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:22:2077:24 | 1u8 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2077:27:2077:27 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:27:2077:27 | 2 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2077:30:2077:30 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2077:30:2077:30 | 3 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2078:13:2078:13 | u | | {EXTERNAL LOCATION} | i32 | -| main.rs:2078:13:2078:13 | u | | {EXTERNAL LOCATION} | u8 | -| main.rs:2078:18:2078:22 | vals1 | | file://:0:0:0:0 | [] | -| main.rs:2078:18:2078:22 | vals1 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2078:18:2078:22 | vals1 | [T;...] | {EXTERNAL LOCATION} | u8 | -| main.rs:2080:13:2080:17 | vals2 | | file://:0:0:0:0 | [] | -| main.rs:2080:13:2080:17 | vals2 | [T;...] | {EXTERNAL LOCATION} | u16 | -| main.rs:2080:21:2080:29 | [1u16; 3] | | file://:0:0:0:0 | [] | -| main.rs:2080:21:2080:29 | [1u16; 3] | [T;...] | {EXTERNAL LOCATION} | u16 | -| main.rs:2080:22:2080:25 | 1u16 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2080:28:2080:28 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2081:13:2081:13 | u | | {EXTERNAL LOCATION} | u16 | -| main.rs:2081:18:2081:22 | vals2 | | file://:0:0:0:0 | [] | -| main.rs:2081:18:2081:22 | vals2 | [T;...] | {EXTERNAL LOCATION} | u16 | -| main.rs:2083:13:2083:17 | vals3 | | file://:0:0:0:0 | [] | -| main.rs:2083:13:2083:17 | vals3 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:13:2083:17 | vals3 | [T;...] | {EXTERNAL LOCATION} | u32 | -| main.rs:2083:26:2083:26 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:31:2083:39 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2083:31:2083:39 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:31:2083:39 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | -| main.rs:2083:32:2083:32 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:32:2083:32 | 1 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2083:35:2083:35 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:35:2083:35 | 2 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2083:38:2083:38 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2083:38:2083:38 | 3 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2084:13:2084:13 | u | | {EXTERNAL LOCATION} | i32 | -| main.rs:2084:13:2084:13 | u | | {EXTERNAL LOCATION} | u32 | -| main.rs:2084:18:2084:22 | vals3 | | file://:0:0:0:0 | [] | -| main.rs:2084:18:2084:22 | vals3 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2084:18:2084:22 | vals3 | [T;...] | {EXTERNAL LOCATION} | u32 | -| main.rs:2086:13:2086:17 | vals4 | | file://:0:0:0:0 | [] | -| main.rs:2086:13:2086:17 | vals4 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2086:13:2086:17 | vals4 | [T;...] | {EXTERNAL LOCATION} | u64 | -| main.rs:2086:26:2086:26 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2086:31:2086:36 | [1; 3] | | file://:0:0:0:0 | [] | -| main.rs:2086:31:2086:36 | [1; 3] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2086:31:2086:36 | [1; 3] | [T;...] | {EXTERNAL LOCATION} | u64 | -| main.rs:2086:32:2086:32 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2086:32:2086:32 | 1 | | {EXTERNAL LOCATION} | u64 | -| main.rs:2086:35:2086:35 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2087:13:2087:13 | u | | {EXTERNAL LOCATION} | i32 | -| main.rs:2087:13:2087:13 | u | | {EXTERNAL LOCATION} | u64 | -| main.rs:2087:18:2087:22 | vals4 | | file://:0:0:0:0 | [] | -| main.rs:2087:18:2087:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2087:18:2087:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | u64 | -| main.rs:2089:13:2089:24 | mut strings1 | | file://:0:0:0:0 | [] | -| main.rs:2089:13:2089:24 | mut strings1 | [T;...] | file://:0:0:0:0 | & | -| main.rs:2089:13:2089:24 | mut strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2089:28:2089:48 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2089:28:2089:48 | [...] | [T;...] | file://:0:0:0:0 | & | -| main.rs:2089:28:2089:48 | [...] | [T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2089:29:2089:33 | "foo" | | file://:0:0:0:0 | & | -| main.rs:2089:29:2089:33 | "foo" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2089:36:2089:40 | "bar" | | file://:0:0:0:0 | & | -| main.rs:2089:36:2089:40 | "bar" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2089:43:2089:47 | "baz" | | file://:0:0:0:0 | & | -| main.rs:2089:43:2089:47 | "baz" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2090:13:2090:13 | s | | {EXTERNAL LOCATION} | Item | -| main.rs:2090:13:2090:13 | s | | file://:0:0:0:0 | & | -| main.rs:2090:13:2090:13 | s | &T | file://:0:0:0:0 | & | -| main.rs:2090:13:2090:13 | s | &T.&T | {EXTERNAL LOCATION} | str | -| main.rs:2090:18:2090:26 | &strings1 | | file://:0:0:0:0 | & | -| main.rs:2090:18:2090:26 | &strings1 | &T | file://:0:0:0:0 | [] | -| main.rs:2090:18:2090:26 | &strings1 | &T.[T;...] | file://:0:0:0:0 | & | -| main.rs:2090:18:2090:26 | &strings1 | &T.[T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2090:19:2090:26 | strings1 | | file://:0:0:0:0 | [] | -| main.rs:2090:19:2090:26 | strings1 | [T;...] | file://:0:0:0:0 | & | -| main.rs:2090:19:2090:26 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2091:13:2091:13 | s | | {EXTERNAL LOCATION} | Item | -| main.rs:2091:13:2091:13 | s | | file://:0:0:0:0 | & | -| main.rs:2091:13:2091:13 | s | &T | file://:0:0:0:0 | & | -| main.rs:2091:13:2091:13 | s | &T.&T | {EXTERNAL LOCATION} | str | -| main.rs:2091:18:2091:30 | &mut strings1 | | file://:0:0:0:0 | & | -| main.rs:2091:18:2091:30 | &mut strings1 | &T | file://:0:0:0:0 | [] | -| main.rs:2091:18:2091:30 | &mut strings1 | &T.[T;...] | file://:0:0:0:0 | & | -| main.rs:2091:18:2091:30 | &mut strings1 | &T.[T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2091:23:2091:30 | strings1 | | file://:0:0:0:0 | [] | -| main.rs:2091:23:2091:30 | strings1 | [T;...] | file://:0:0:0:0 | & | -| main.rs:2091:23:2091:30 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2092:13:2092:13 | s | | file://:0:0:0:0 | & | -| main.rs:2092:13:2092:13 | s | &T | {EXTERNAL LOCATION} | str | -| main.rs:2092:18:2092:25 | strings1 | | file://:0:0:0:0 | [] | -| main.rs:2092:18:2092:25 | strings1 | [T;...] | file://:0:0:0:0 | & | -| main.rs:2092:18:2092:25 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | -| main.rs:2094:13:2094:20 | strings2 | | file://:0:0:0:0 | [] | -| main.rs:2094:13:2094:20 | strings2 | [T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2095:9:2099:9 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2095:9:2099:9 | [...] | [T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2096:13:2096:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2096:26:2096:30 | "foo" | | file://:0:0:0:0 | & | -| main.rs:2096:26:2096:30 | "foo" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2097:13:2097:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2097:26:2097:30 | "bar" | | file://:0:0:0:0 | & | -| main.rs:2097:26:2097:30 | "bar" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2098:13:2098:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2098:26:2098:30 | "baz" | | file://:0:0:0:0 | & | -| main.rs:2098:26:2098:30 | "baz" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2100:13:2100:13 | s | | {EXTERNAL LOCATION} | String | -| main.rs:2100:18:2100:25 | strings2 | | file://:0:0:0:0 | [] | -| main.rs:2100:18:2100:25 | strings2 | [T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2102:13:2102:20 | strings3 | | file://:0:0:0:0 | & | -| main.rs:2102:13:2102:20 | strings3 | &T | file://:0:0:0:0 | [] | -| main.rs:2102:13:2102:20 | strings3 | &T.[T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2103:9:2107:9 | &... | | file://:0:0:0:0 | & | -| main.rs:2103:9:2107:9 | &... | &T | file://:0:0:0:0 | [] | -| main.rs:2103:9:2107:9 | &... | &T.[T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2103:10:2107:9 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2103:10:2107:9 | [...] | [T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2104:13:2104:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2104:26:2104:30 | "foo" | | file://:0:0:0:0 | & | -| main.rs:2104:26:2104:30 | "foo" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2105:13:2105:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2105:26:2105:30 | "bar" | | file://:0:0:0:0 | & | -| main.rs:2105:26:2105:30 | "bar" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2106:13:2106:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | -| main.rs:2106:26:2106:30 | "baz" | | file://:0:0:0:0 | & | -| main.rs:2106:26:2106:30 | "baz" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2108:13:2108:13 | s | | {EXTERNAL LOCATION} | Item | -| main.rs:2108:13:2108:13 | s | | file://:0:0:0:0 | & | -| main.rs:2108:13:2108:13 | s | &T | {EXTERNAL LOCATION} | String | -| main.rs:2108:18:2108:25 | strings3 | | file://:0:0:0:0 | & | -| main.rs:2108:18:2108:25 | strings3 | &T | file://:0:0:0:0 | [] | -| main.rs:2108:18:2108:25 | strings3 | &T.[T;...] | {EXTERNAL LOCATION} | String | -| main.rs:2110:13:2110:21 | callables | | file://:0:0:0:0 | [] | -| main.rs:2110:13:2110:21 | callables | [T;...] | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2110:25:2110:81 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2110:25:2110:81 | [...] | [T;...] | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2110:26:2110:42 | ...::new(...) | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2110:45:2110:61 | ...::new(...) | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2110:64:2110:80 | ...::new(...) | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2111:13:2111:13 | c | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2112:12:2112:20 | callables | | file://:0:0:0:0 | [] | -| main.rs:2112:12:2112:20 | callables | [T;...] | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2114:17:2114:22 | result | | {EXTERNAL LOCATION} | i64 | -| main.rs:2114:26:2114:26 | c | | main.rs:2058:5:2058:24 | MyCallable | -| main.rs:2114:26:2114:33 | c.call() | | {EXTERNAL LOCATION} | i64 | -| main.rs:2119:13:2119:13 | i | | {EXTERNAL LOCATION} | Item | -| main.rs:2119:13:2119:13 | i | | {EXTERNAL LOCATION} | i32 | -| main.rs:2119:18:2119:18 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2119:18:2119:22 | 0..10 | | {EXTERNAL LOCATION} | Range | -| main.rs:2119:18:2119:22 | 0..10 | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2119:21:2119:22 | 10 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:13:2120:13 | u | | {EXTERNAL LOCATION} | Range | -| main.rs:2120:13:2120:13 | u | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:13:2120:13 | u | Idx | {EXTERNAL LOCATION} | u8 | -| main.rs:2120:18:2120:26 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2120:18:2120:26 | [...] | [T;...] | {EXTERNAL LOCATION} | Range | -| main.rs:2120:18:2120:26 | [...] | [T;...].Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:18:2120:26 | [...] | [T;...].Idx | {EXTERNAL LOCATION} | u8 | -| main.rs:2120:19:2120:21 | 0u8 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:19:2120:21 | 0u8 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2120:19:2120:25 | 0u8..10 | | {EXTERNAL LOCATION} | Range | -| main.rs:2120:19:2120:25 | 0u8..10 | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:19:2120:25 | 0u8..10 | Idx | {EXTERNAL LOCATION} | u8 | -| main.rs:2120:24:2120:25 | 10 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2120:24:2120:25 | 10 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2121:13:2121:17 | range | | {EXTERNAL LOCATION} | Range | -| main.rs:2121:13:2121:17 | range | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2121:21:2121:21 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2121:21:2121:25 | 0..10 | | {EXTERNAL LOCATION} | Range | -| main.rs:2121:21:2121:25 | 0..10 | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2121:24:2121:25 | 10 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2122:13:2122:13 | i | | {EXTERNAL LOCATION} | Item | -| main.rs:2122:13:2122:13 | i | | {EXTERNAL LOCATION} | i32 | -| main.rs:2122:18:2122:22 | range | | {EXTERNAL LOCATION} | Range | -| main.rs:2122:18:2122:22 | range | Idx | {EXTERNAL LOCATION} | i32 | -| main.rs:2124:13:2124:18 | range1 | | {EXTERNAL LOCATION} | Range | -| main.rs:2124:13:2124:18 | range1 | Idx | {EXTERNAL LOCATION} | u16 | -| main.rs:2125:9:2128:9 | ...::Range {...} | | {EXTERNAL LOCATION} | Range | -| main.rs:2125:9:2128:9 | ...::Range {...} | Idx | {EXTERNAL LOCATION} | u16 | -| main.rs:2126:20:2126:23 | 0u16 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2127:18:2127:22 | 10u16 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2129:13:2129:13 | u | | {EXTERNAL LOCATION} | Item | -| main.rs:2129:13:2129:13 | u | | {EXTERNAL LOCATION} | u16 | -| main.rs:2129:18:2129:23 | range1 | | {EXTERNAL LOCATION} | Range | -| main.rs:2129:18:2129:23 | range1 | Idx | {EXTERNAL LOCATION} | u16 | -| main.rs:2133:26:2133:26 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2133:29:2133:29 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2133:32:2133:32 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2136:13:2136:18 | vals4a | | {EXTERNAL LOCATION} | Vec | -| main.rs:2136:13:2136:18 | vals4a | A | {EXTERNAL LOCATION} | Global | -| main.rs:2136:13:2136:18 | vals4a | T | {EXTERNAL LOCATION} | u16 | -| main.rs:2136:32:2136:43 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2136:32:2136:43 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2136:32:2136:43 | [...] | [T;...] | {EXTERNAL LOCATION} | u16 | -| main.rs:2136:32:2136:52 | ... .to_vec() | | {EXTERNAL LOCATION} | Vec | -| main.rs:2136:32:2136:52 | ... .to_vec() | A | {EXTERNAL LOCATION} | Global | -| main.rs:2136:32:2136:52 | ... .to_vec() | T | {EXTERNAL LOCATION} | u16 | -| main.rs:2136:33:2136:36 | 1u16 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2136:33:2136:36 | 1u16 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2136:39:2136:39 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2136:39:2136:39 | 2 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2136:42:2136:42 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2136:42:2136:42 | 3 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2137:13:2137:13 | u | | {EXTERNAL LOCATION} | Vec | -| main.rs:2137:13:2137:13 | u | | {EXTERNAL LOCATION} | u16 | -| main.rs:2137:13:2137:13 | u | | file://:0:0:0:0 | & | -| main.rs:2137:13:2137:13 | u | A | {EXTERNAL LOCATION} | Global | -| main.rs:2137:13:2137:13 | u | T | {EXTERNAL LOCATION} | u16 | -| main.rs:2137:18:2137:23 | vals4a | | {EXTERNAL LOCATION} | Vec | -| main.rs:2137:18:2137:23 | vals4a | A | {EXTERNAL LOCATION} | Global | -| main.rs:2137:18:2137:23 | vals4a | T | {EXTERNAL LOCATION} | u16 | -| main.rs:2139:22:2139:33 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2139:22:2139:33 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2139:22:2139:33 | [...] | [T;...] | {EXTERNAL LOCATION} | u16 | -| main.rs:2139:23:2139:26 | 1u16 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2139:23:2139:26 | 1u16 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2139:29:2139:29 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2139:29:2139:29 | 2 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2139:32:2139:32 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2139:32:2139:32 | 3 | | {EXTERNAL LOCATION} | u16 | -| main.rs:2142:13:2142:17 | vals5 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2142:13:2142:17 | vals5 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2142:13:2142:17 | vals5 | T | {EXTERNAL LOCATION} | u8 | -| main.rs:2142:21:2142:43 | ...::from(...) | | {EXTERNAL LOCATION} | Vec | -| main.rs:2142:21:2142:43 | ...::from(...) | A | {EXTERNAL LOCATION} | Global | -| main.rs:2142:21:2142:43 | ...::from(...) | T | {EXTERNAL LOCATION} | u8 | -| main.rs:2142:31:2142:42 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2142:31:2142:42 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2142:31:2142:42 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | -| main.rs:2142:32:2142:35 | 1u32 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2142:32:2142:35 | 1u32 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2142:38:2142:38 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2142:38:2142:38 | 2 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2142:41:2142:41 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2142:41:2142:41 | 3 | | {EXTERNAL LOCATION} | u32 | -| main.rs:2143:13:2143:13 | u | | {EXTERNAL LOCATION} | Vec | -| main.rs:2143:13:2143:13 | u | | {EXTERNAL LOCATION} | u8 | -| main.rs:2143:13:2143:13 | u | | file://:0:0:0:0 | & | -| main.rs:2143:13:2143:13 | u | A | {EXTERNAL LOCATION} | Global | -| main.rs:2143:13:2143:13 | u | T | {EXTERNAL LOCATION} | u8 | -| main.rs:2143:18:2143:22 | vals5 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2143:18:2143:22 | vals5 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2143:18:2143:22 | vals5 | T | {EXTERNAL LOCATION} | u8 | -| main.rs:2145:13:2145:17 | vals6 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2145:13:2145:17 | vals6 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2145:13:2145:17 | vals6 | T | file://:0:0:0:0 | & | -| main.rs:2145:13:2145:17 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | -| main.rs:2145:32:2145:43 | [...] | | file://:0:0:0:0 | [] | -| main.rs:2145:32:2145:43 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | -| main.rs:2145:32:2145:43 | [...] | [T;...] | {EXTERNAL LOCATION} | u64 | -| main.rs:2145:32:2145:60 | ... .collect() | | {EXTERNAL LOCATION} | Vec | -| main.rs:2145:32:2145:60 | ... .collect() | A | {EXTERNAL LOCATION} | Global | -| main.rs:2145:32:2145:60 | ... .collect() | T | file://:0:0:0:0 | & | -| main.rs:2145:32:2145:60 | ... .collect() | T.&T | {EXTERNAL LOCATION} | u64 | -| main.rs:2145:33:2145:36 | 1u64 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2145:33:2145:36 | 1u64 | | {EXTERNAL LOCATION} | u64 | -| main.rs:2145:39:2145:39 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2145:39:2145:39 | 2 | | {EXTERNAL LOCATION} | u64 | -| main.rs:2145:42:2145:42 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2145:42:2145:42 | 3 | | {EXTERNAL LOCATION} | u64 | -| main.rs:2146:13:2146:13 | u | | {EXTERNAL LOCATION} | Vec | -| main.rs:2146:13:2146:13 | u | | file://:0:0:0:0 | & | -| main.rs:2146:13:2146:13 | u | &T | {EXTERNAL LOCATION} | u64 | -| main.rs:2146:13:2146:13 | u | A | {EXTERNAL LOCATION} | Global | -| main.rs:2146:13:2146:13 | u | T | file://:0:0:0:0 | & | -| main.rs:2146:13:2146:13 | u | T.&T | {EXTERNAL LOCATION} | u64 | -| main.rs:2146:18:2146:22 | vals6 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2146:18:2146:22 | vals6 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2146:18:2146:22 | vals6 | T | file://:0:0:0:0 | & | -| main.rs:2146:18:2146:22 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | -| main.rs:2148:13:2148:21 | mut vals7 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2148:13:2148:21 | mut vals7 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2148:25:2148:34 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | -| main.rs:2148:25:2148:34 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| main.rs:2149:9:2149:13 | vals7 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2149:9:2149:13 | vals7 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2149:20:2149:22 | 1u8 | | {EXTERNAL LOCATION} | u8 | -| main.rs:2150:13:2150:13 | u | | {EXTERNAL LOCATION} | Vec | -| main.rs:2150:13:2150:13 | u | | file://:0:0:0:0 | & | -| main.rs:2150:13:2150:13 | u | A | {EXTERNAL LOCATION} | Global | -| main.rs:2150:18:2150:22 | vals7 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2150:18:2150:22 | vals7 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2152:33:2152:33 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2152:36:2152:36 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2152:45:2152:45 | 3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2152:48:2152:48 | 4 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2159:13:2159:20 | mut map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2159:13:2159:20 | mut map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2159:24:2159:55 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2159:24:2159:55 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2160:9:2160:12 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2160:9:2160:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2160:9:2160:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2160:21:2160:21 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2160:24:2160:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| main.rs:2160:24:2160:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| main.rs:2160:33:2160:37 | "one" | | file://:0:0:0:0 | & | -| main.rs:2160:33:2160:37 | "one" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2161:9:2161:12 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2161:9:2161:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2161:9:2161:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2161:21:2161:21 | 2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2161:24:2161:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| main.rs:2161:24:2161:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| main.rs:2161:33:2161:37 | "two" | | file://:0:0:0:0 | & | -| main.rs:2161:33:2161:37 | "two" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2162:13:2162:15 | key | | {EXTERNAL LOCATION} | Item | -| main.rs:2162:13:2162:15 | key | | file://:0:0:0:0 | & | -| main.rs:2162:20:2162:23 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2162:20:2162:23 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2162:20:2162:30 | map1.keys() | | {EXTERNAL LOCATION} | Keys | -| main.rs:2163:13:2163:17 | value | | {EXTERNAL LOCATION} | Item | -| main.rs:2163:13:2163:17 | value | | file://:0:0:0:0 | & | -| main.rs:2163:22:2163:25 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2163:22:2163:25 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2163:22:2163:34 | map1.values() | | {EXTERNAL LOCATION} | Values | -| main.rs:2164:13:2164:24 | TuplePat | | {EXTERNAL LOCATION} | Item | -| main.rs:2164:29:2164:32 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2164:29:2164:32 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2164:29:2164:39 | map1.iter() | | {EXTERNAL LOCATION} | Iter | -| main.rs:2165:13:2165:24 | TuplePat | | {EXTERNAL LOCATION} | Item | -| main.rs:2165:29:2165:33 | &map1 | | file://:0:0:0:0 | & | -| main.rs:2165:29:2165:33 | &map1 | &T | {EXTERNAL LOCATION} | HashMap | -| main.rs:2165:29:2165:33 | &map1 | &T.S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2165:30:2165:33 | map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2165:30:2165:33 | map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2169:13:2169:17 | mut a | | {EXTERNAL LOCATION} | i32 | -| main.rs:2169:13:2169:17 | mut a | | {EXTERNAL LOCATION} | i64 | -| main.rs:2169:26:2169:26 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2169:26:2169:26 | 0 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2171:23:2171:23 | a | | {EXTERNAL LOCATION} | i32 | -| main.rs:2171:23:2171:23 | a | | {EXTERNAL LOCATION} | i64 | -| main.rs:2171:23:2171:28 | ... < ... | | {EXTERNAL LOCATION} | bool | -| main.rs:2171:27:2171:28 | 10 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2173:13:2173:13 | a | | {EXTERNAL LOCATION} | i32 | -| main.rs:2173:13:2173:13 | a | | {EXTERNAL LOCATION} | i64 | -| main.rs:2173:13:2173:18 | ... += ... | | file://:0:0:0:0 | () | -| main.rs:2173:18:2173:18 | 1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2187:40:2189:9 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2187:40:2189:9 | { ... } | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2187:40:2189:9 | { ... } | T.T | main.rs:2186:10:2186:19 | T | -| main.rs:2188:13:2188:16 | None | | {EXTERNAL LOCATION} | Option | -| main.rs:2188:13:2188:16 | None | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2188:13:2188:16 | None | T.T | main.rs:2186:10:2186:19 | T | -| main.rs:2191:30:2193:9 | { ... } | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2191:30:2193:9 | { ... } | T | main.rs:2186:10:2186:19 | T | -| main.rs:2192:13:2192:28 | S1(...) | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2192:13:2192:28 | S1(...) | T | main.rs:2186:10:2186:19 | T | -| main.rs:2192:16:2192:27 | ...::default(...) | | main.rs:2186:10:2186:19 | T | -| main.rs:2195:19:2195:22 | SelfParam | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2195:19:2195:22 | SelfParam | T | main.rs:2186:10:2186:19 | T | -| main.rs:2195:33:2197:9 | { ... } | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2195:33:2197:9 | { ... } | T | main.rs:2186:10:2186:19 | T | -| main.rs:2196:13:2196:16 | self | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2196:13:2196:16 | self | T | main.rs:2186:10:2186:19 | T | -| main.rs:2209:13:2209:14 | x1 | | {EXTERNAL LOCATION} | Option | -| main.rs:2209:13:2209:14 | x1 | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2209:13:2209:14 | x1 | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2209:34:2209:48 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2209:34:2209:48 | ...::assoc_fun(...) | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2209:34:2209:48 | ...::assoc_fun(...) | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2210:13:2210:14 | x2 | | {EXTERNAL LOCATION} | Option | -| main.rs:2210:13:2210:14 | x2 | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2210:13:2210:14 | x2 | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2210:18:2210:38 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2210:18:2210:38 | ...::assoc_fun(...) | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2210:18:2210:38 | ...::assoc_fun(...) | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2211:13:2211:14 | x3 | | {EXTERNAL LOCATION} | Option | -| main.rs:2211:13:2211:14 | x3 | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2211:13:2211:14 | x3 | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2211:18:2211:32 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2211:18:2211:32 | ...::assoc_fun(...) | T | main.rs:2181:5:2181:20 | S1 | -| main.rs:2211:18:2211:32 | ...::assoc_fun(...) | T.T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2212:13:2212:14 | x4 | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2212:13:2212:14 | x4 | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2212:18:2212:48 | ...::method(...) | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2212:18:2212:48 | ...::method(...) | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2212:35:2212:47 | ...::default(...) | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2212:35:2212:47 | ...::default(...) | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2213:13:2213:14 | x5 | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2213:13:2213:14 | x5 | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2213:18:2213:42 | ...::method(...) | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2213:18:2213:42 | ...::method(...) | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2213:29:2213:41 | ...::default(...) | | main.rs:2181:5:2181:20 | S1 | -| main.rs:2213:29:2213:41 | ...::default(...) | T | main.rs:2183:5:2184:14 | S2 | -| main.rs:2214:13:2214:14 | x6 | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2214:13:2214:14 | x6 | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2214:18:2214:45 | S4::<...>(...) | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2214:18:2214:45 | S4::<...>(...) | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2214:27:2214:44 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | -| main.rs:2214:27:2214:44 | ...::default(...) | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2215:13:2215:14 | x7 | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2215:13:2215:14 | x7 | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2215:18:2215:23 | S4(...) | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2215:18:2215:23 | S4(...) | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2215:21:2215:22 | S2 | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2216:13:2216:14 | x8 | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2216:13:2216:14 | x8 | T4 | {EXTERNAL LOCATION} | i32 | -| main.rs:2216:18:2216:22 | S4(...) | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2216:18:2216:22 | S4(...) | T4 | {EXTERNAL LOCATION} | i32 | -| main.rs:2216:21:2216:21 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2217:13:2217:14 | x9 | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2217:13:2217:14 | x9 | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2217:18:2217:34 | S4(...) | | main.rs:2202:5:2202:27 | S4 | -| main.rs:2217:18:2217:34 | S4(...) | T4 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2217:21:2217:33 | ...::default(...) | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2218:13:2218:15 | x10 | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2218:13:2218:15 | x10 | T5 | {EXTERNAL LOCATION} | trait Default | -| main.rs:2218:13:2218:15 | x10 | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2218:19:2221:9 | S5::<...> {...} | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2218:19:2221:9 | S5::<...> {...} | T5 | {EXTERNAL LOCATION} | trait Default | -| main.rs:2218:19:2221:9 | S5::<...> {...} | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2220:20:2220:37 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | -| main.rs:2220:20:2220:37 | ...::default(...) | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2222:13:2222:15 | x11 | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2222:13:2222:15 | x11 | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2222:19:2222:34 | S5 {...} | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2222:19:2222:34 | S5 {...} | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2222:31:2222:32 | S2 | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2223:13:2223:15 | x12 | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2223:13:2223:15 | x12 | T5 | {EXTERNAL LOCATION} | i32 | -| main.rs:2223:19:2223:33 | S5 {...} | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2223:19:2223:33 | S5 {...} | T5 | {EXTERNAL LOCATION} | i32 | -| main.rs:2223:31:2223:31 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2224:13:2224:15 | x13 | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2224:13:2224:15 | x13 | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2224:19:2227:9 | S5 {...} | | main.rs:2204:5:2206:5 | S5 | -| main.rs:2224:19:2227:9 | S5 {...} | T5 | main.rs:2183:5:2184:14 | S2 | -| main.rs:2226:20:2226:32 | ...::default(...) | | main.rs:2183:5:2184:14 | S2 | -| main.rs:2236:14:2236:18 | S1 {...} | | main.rs:2232:5:2232:16 | S1 | -| main.rs:2236:21:2236:25 | S1 {...} | | main.rs:2232:5:2232:16 | S1 | -| main.rs:2238:16:2238:19 | SelfParam | | main.rs:2232:5:2232:16 | S1 | -| main.rs:2261:5:2261:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:5:2262:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:20:2262:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:41:2262:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2278:5:2278:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | -| main.rs:2290:44:2309:5 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:13:2291:17 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:13:2291:17 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2291:21:2291:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:21:2291:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2291:26:2291:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2292:29:2292:33 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2292:29:2292:33 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2294:22:2294:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2294:22:2294:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2296:15:2296:19 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2296:15:2296:19 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2299:26:2299:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2299:26:2299:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2303:13:2303:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2303:20:2303:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2303:20:2303:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2303:20:2303:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | -| main.rs:2304:13:2304:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2304:20:2304:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2305:18:2305:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2305:18:2305:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2305:20:2305:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:13:2306:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:20:2306:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2306:20:2306:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:20:2306:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | -| main.rs:2307:18:2307:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2307:18:2307:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2307:20:2307:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2308:9:2308:12 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2047:20:2047:24 | value | | main.rs:2045:18:2045:18 | T | +| main.rs:2052:20:2052:24 | value | | {EXTERNAL LOCATION} | i64 | +| main.rs:2052:40:2054:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2053:13:2053:17 | value | | {EXTERNAL LOCATION} | i64 | +| main.rs:2059:20:2059:24 | value | | {EXTERNAL LOCATION} | bool | +| main.rs:2059:41:2061:9 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2059:41:2061:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2060:13:2060:37 | if value {...} else {...} | | {EXTERNAL LOCATION} | i32 | +| main.rs:2060:13:2060:37 | if value {...} else {...} | | {EXTERNAL LOCATION} | i64 | +| main.rs:2060:16:2060:20 | value | | {EXTERNAL LOCATION} | bool | +| main.rs:2060:22:2060:26 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2060:22:2060:26 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2060:24:2060:24 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2060:24:2060:24 | 1 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2060:33:2060:37 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2060:33:2060:37 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2060:35:2060:35 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2060:35:2060:35 | 0 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2066:21:2066:25 | value | | main.rs:2064:19:2064:19 | T | +| main.rs:2066:31:2066:31 | x | | main.rs:2064:5:2067:5 | Self [trait MyFrom2] | +| main.rs:2071:21:2071:25 | value | | {EXTERNAL LOCATION} | i64 | +| main.rs:2071:33:2071:33 | _ | | {EXTERNAL LOCATION} | i64 | +| main.rs:2072:13:2072:17 | value | | {EXTERNAL LOCATION} | i64 | +| main.rs:2078:21:2078:25 | value | | {EXTERNAL LOCATION} | bool | +| main.rs:2078:34:2078:34 | _ | | {EXTERNAL LOCATION} | i64 | +| main.rs:2079:13:2083:13 | if value {...} else {...} | | {EXTERNAL LOCATION} | i32 | +| main.rs:2079:16:2079:20 | value | | {EXTERNAL LOCATION} | bool | +| main.rs:2079:22:2081:13 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2080:17:2080:17 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2081:20:2083:13 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2082:17:2082:17 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2089:15:2089:15 | x | | main.rs:2087:5:2093:5 | Self [trait MySelfTrait] | +| main.rs:2092:15:2092:15 | x | | main.rs:2087:5:2093:5 | Self [trait MySelfTrait] | +| main.rs:2097:15:2097:15 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2097:31:2099:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2098:13:2098:13 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2098:13:2098:17 | ... + ... | | {EXTERNAL LOCATION} | i64 | +| main.rs:2098:17:2098:17 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2102:15:2102:15 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2102:32:2104:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2103:13:2103:13 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2103:13:2103:17 | ... + ... | | {EXTERNAL LOCATION} | i64 | +| main.rs:2103:17:2103:17 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2109:15:2109:15 | x | | {EXTERNAL LOCATION} | bool | +| main.rs:2109:31:2111:9 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2109:31:2111:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2110:13:2110:13 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2110:13:2110:13 | 0 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2114:15:2114:15 | x | | {EXTERNAL LOCATION} | bool | +| main.rs:2114:32:2116:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| main.rs:2115:13:2115:13 | x | | {EXTERNAL LOCATION} | bool | +| main.rs:2120:13:2120:13 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2120:13:2120:13 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2120:22:2120:23 | 73 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2120:22:2120:23 | 73 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2121:9:2121:9 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2121:9:2121:9 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2121:9:2121:22 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2121:18:2121:21 | 5i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2122:9:2122:9 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2122:9:2122:9 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2122:9:2122:23 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2122:18:2122:22 | &5i64 | | file://:0:0:0:0 | & | +| main.rs:2122:18:2122:22 | &5i64 | &T | {EXTERNAL LOCATION} | i64 | +| main.rs:2122:19:2122:22 | 5i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2123:9:2123:9 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2123:9:2123:9 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2123:9:2123:22 | x.my_add(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2123:18:2123:21 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2125:9:2125:15 | S(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2125:9:2125:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | +| main.rs:2125:9:2125:31 | ... .my_add(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2125:11:2125:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2125:24:2125:30 | S(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2125:24:2125:30 | S(...) | T | {EXTERNAL LOCATION} | i64 | +| main.rs:2125:26:2125:29 | 2i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2126:9:2126:15 | S(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2126:9:2126:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | +| main.rs:2126:11:2126:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2126:24:2126:27 | 3i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2127:9:2127:15 | S(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2127:9:2127:15 | S(...) | T | {EXTERNAL LOCATION} | i64 | +| main.rs:2127:9:2127:29 | ... .my_add(...) | | main.rs:2013:5:2013:19 | S | +| main.rs:2127:11:2127:14 | 1i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2127:24:2127:28 | &3i64 | | file://:0:0:0:0 | & | +| main.rs:2127:24:2127:28 | &3i64 | &T | {EXTERNAL LOCATION} | i64 | +| main.rs:2127:25:2127:28 | 3i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2129:13:2129:13 | x | | {EXTERNAL LOCATION} | i64 | +| main.rs:2129:17:2129:35 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2129:30:2129:34 | 73i64 | | {EXTERNAL LOCATION} | bool | +| main.rs:2129:30:2129:34 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2130:13:2130:13 | y | | {EXTERNAL LOCATION} | i64 | +| main.rs:2130:17:2130:34 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2130:30:2130:33 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2130:30:2130:33 | true | | {EXTERNAL LOCATION} | i64 | +| main.rs:2131:13:2131:13 | z | | {EXTERNAL LOCATION} | i64 | +| main.rs:2131:13:2131:13 | z | | main.rs:2045:5:2048:5 | trait MyFrom | +| main.rs:2131:22:2131:43 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2131:22:2131:43 | ...::my_from(...) | | main.rs:2045:5:2048:5 | trait MyFrom | +| main.rs:2131:38:2131:42 | 73i64 | | {EXTERNAL LOCATION} | bool | +| main.rs:2131:38:2131:42 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2132:23:2132:27 | 73i64 | | {EXTERNAL LOCATION} | bool | +| main.rs:2132:23:2132:27 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2132:30:2132:33 | 0i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2133:23:2133:26 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2133:23:2133:26 | true | | {EXTERNAL LOCATION} | i64 | +| main.rs:2133:29:2133:32 | 0i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2134:27:2134:31 | 73i64 | | {EXTERNAL LOCATION} | bool | +| main.rs:2134:27:2134:31 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2134:34:2134:37 | 0i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2134:34:2134:37 | 0i64 | | main.rs:2064:5:2067:5 | trait MyFrom2 | +| main.rs:2136:9:2136:22 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2136:17:2136:21 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2137:9:2137:22 | ...::f2(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2137:17:2137:21 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2138:9:2138:22 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2138:18:2138:21 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2139:9:2139:22 | ...::f2(...) | | {EXTERNAL LOCATION} | bool | +| main.rs:2139:18:2139:21 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2140:9:2140:30 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2140:25:2140:29 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2140:25:2140:29 | 73i64 | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2141:9:2141:30 | ...::f2(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2141:9:2141:30 | ...::f2(...) | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2141:25:2141:29 | 73i64 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2141:25:2141:29 | 73i64 | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2142:9:2142:29 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2142:25:2142:28 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2142:25:2142:28 | true | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2143:9:2143:29 | ...::f2(...) | | {EXTERNAL LOCATION} | bool | +| main.rs:2143:9:2143:29 | ...::f2(...) | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2143:25:2143:28 | true | | {EXTERNAL LOCATION} | bool | +| main.rs:2143:25:2143:28 | true | | main.rs:2087:5:2093:5 | trait MySelfTrait | +| main.rs:2151:26:2153:9 | { ... } | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2152:13:2152:25 | MyCallable {...} | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2155:17:2155:21 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:2155:17:2155:21 | SelfParam | &T | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2155:31:2157:9 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2155:31:2157:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2156:13:2156:13 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2156:13:2156:13 | 1 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2163:13:2163:13 | i | | {EXTERNAL LOCATION} | i32 | +| main.rs:2163:18:2163:26 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2163:18:2163:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2163:19:2163:19 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2163:22:2163:22 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2163:25:2163:25 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2164:18:2164:26 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2164:18:2164:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2164:18:2164:41 | ... .map(...) | | file://:0:0:0:0 | [] | +| main.rs:2164:19:2164:19 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2164:22:2164:22 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2164:25:2164:25 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2164:40:2164:40 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2165:18:2165:26 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2165:18:2165:26 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2165:19:2165:19 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2165:22:2165:22 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2165:25:2165:25 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:13:2167:17 | vals1 | | file://:0:0:0:0 | [] | +| main.rs:2167:13:2167:17 | vals1 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:13:2167:17 | vals1 | [T;...] | {EXTERNAL LOCATION} | u8 | +| main.rs:2167:21:2167:31 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2167:21:2167:31 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:21:2167:31 | [...] | [T;...] | {EXTERNAL LOCATION} | u8 | +| main.rs:2167:22:2167:24 | 1u8 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:22:2167:24 | 1u8 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2167:27:2167:27 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:27:2167:27 | 2 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2167:30:2167:30 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2167:30:2167:30 | 3 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2168:13:2168:13 | u | | {EXTERNAL LOCATION} | i32 | +| main.rs:2168:13:2168:13 | u | | {EXTERNAL LOCATION} | u8 | +| main.rs:2168:18:2168:22 | vals1 | | file://:0:0:0:0 | [] | +| main.rs:2168:18:2168:22 | vals1 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2168:18:2168:22 | vals1 | [T;...] | {EXTERNAL LOCATION} | u8 | +| main.rs:2170:13:2170:17 | vals2 | | file://:0:0:0:0 | [] | +| main.rs:2170:13:2170:17 | vals2 | [T;...] | {EXTERNAL LOCATION} | u16 | +| main.rs:2170:21:2170:29 | [1u16; 3] | | file://:0:0:0:0 | [] | +| main.rs:2170:21:2170:29 | [1u16; 3] | [T;...] | {EXTERNAL LOCATION} | u16 | +| main.rs:2170:22:2170:25 | 1u16 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2170:28:2170:28 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2171:13:2171:13 | u | | {EXTERNAL LOCATION} | u16 | +| main.rs:2171:18:2171:22 | vals2 | | file://:0:0:0:0 | [] | +| main.rs:2171:18:2171:22 | vals2 | [T;...] | {EXTERNAL LOCATION} | u16 | +| main.rs:2173:13:2173:17 | vals3 | | file://:0:0:0:0 | [] | +| main.rs:2173:13:2173:17 | vals3 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:13:2173:17 | vals3 | [T;...] | {EXTERNAL LOCATION} | u32 | +| main.rs:2173:26:2173:26 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:31:2173:39 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2173:31:2173:39 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:31:2173:39 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | +| main.rs:2173:32:2173:32 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:32:2173:32 | 1 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2173:35:2173:35 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:35:2173:35 | 2 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2173:38:2173:38 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2173:38:2173:38 | 3 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2174:13:2174:13 | u | | {EXTERNAL LOCATION} | i32 | +| main.rs:2174:13:2174:13 | u | | {EXTERNAL LOCATION} | u32 | +| main.rs:2174:18:2174:22 | vals3 | | file://:0:0:0:0 | [] | +| main.rs:2174:18:2174:22 | vals3 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2174:18:2174:22 | vals3 | [T;...] | {EXTERNAL LOCATION} | u32 | +| main.rs:2176:13:2176:17 | vals4 | | file://:0:0:0:0 | [] | +| main.rs:2176:13:2176:17 | vals4 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2176:13:2176:17 | vals4 | [T;...] | {EXTERNAL LOCATION} | u64 | +| main.rs:2176:26:2176:26 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2176:31:2176:36 | [1; 3] | | file://:0:0:0:0 | [] | +| main.rs:2176:31:2176:36 | [1; 3] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2176:31:2176:36 | [1; 3] | [T;...] | {EXTERNAL LOCATION} | u64 | +| main.rs:2176:32:2176:32 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2176:32:2176:32 | 1 | | {EXTERNAL LOCATION} | u64 | +| main.rs:2176:35:2176:35 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2177:13:2177:13 | u | | {EXTERNAL LOCATION} | i32 | +| main.rs:2177:13:2177:13 | u | | {EXTERNAL LOCATION} | u64 | +| main.rs:2177:18:2177:22 | vals4 | | file://:0:0:0:0 | [] | +| main.rs:2177:18:2177:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2177:18:2177:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | u64 | +| main.rs:2179:13:2179:24 | mut strings1 | | file://:0:0:0:0 | [] | +| main.rs:2179:13:2179:24 | mut strings1 | [T;...] | file://:0:0:0:0 | & | +| main.rs:2179:13:2179:24 | mut strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2179:28:2179:48 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2179:28:2179:48 | [...] | [T;...] | file://:0:0:0:0 | & | +| main.rs:2179:28:2179:48 | [...] | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2179:29:2179:33 | "foo" | | file://:0:0:0:0 | & | +| main.rs:2179:29:2179:33 | "foo" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2179:36:2179:40 | "bar" | | file://:0:0:0:0 | & | +| main.rs:2179:36:2179:40 | "bar" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2179:43:2179:47 | "baz" | | file://:0:0:0:0 | & | +| main.rs:2179:43:2179:47 | "baz" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2180:13:2180:13 | s | | {EXTERNAL LOCATION} | Item | +| main.rs:2180:13:2180:13 | s | | file://:0:0:0:0 | & | +| main.rs:2180:13:2180:13 | s | &T | file://:0:0:0:0 | & | +| main.rs:2180:13:2180:13 | s | &T.&T | {EXTERNAL LOCATION} | str | +| main.rs:2180:18:2180:26 | &strings1 | | file://:0:0:0:0 | & | +| main.rs:2180:18:2180:26 | &strings1 | &T | file://:0:0:0:0 | [] | +| main.rs:2180:18:2180:26 | &strings1 | &T.[T;...] | file://:0:0:0:0 | & | +| main.rs:2180:18:2180:26 | &strings1 | &T.[T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2180:19:2180:26 | strings1 | | file://:0:0:0:0 | [] | +| main.rs:2180:19:2180:26 | strings1 | [T;...] | file://:0:0:0:0 | & | +| main.rs:2180:19:2180:26 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2181:13:2181:13 | s | | {EXTERNAL LOCATION} | Item | +| main.rs:2181:13:2181:13 | s | | file://:0:0:0:0 | & | +| main.rs:2181:13:2181:13 | s | &T | file://:0:0:0:0 | & | +| main.rs:2181:13:2181:13 | s | &T.&T | {EXTERNAL LOCATION} | str | +| main.rs:2181:18:2181:30 | &mut strings1 | | file://:0:0:0:0 | & | +| main.rs:2181:18:2181:30 | &mut strings1 | &T | file://:0:0:0:0 | [] | +| main.rs:2181:18:2181:30 | &mut strings1 | &T.[T;...] | file://:0:0:0:0 | & | +| main.rs:2181:18:2181:30 | &mut strings1 | &T.[T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2181:23:2181:30 | strings1 | | file://:0:0:0:0 | [] | +| main.rs:2181:23:2181:30 | strings1 | [T;...] | file://:0:0:0:0 | & | +| main.rs:2181:23:2181:30 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2182:13:2182:13 | s | | file://:0:0:0:0 | & | +| main.rs:2182:13:2182:13 | s | &T | {EXTERNAL LOCATION} | str | +| main.rs:2182:18:2182:25 | strings1 | | file://:0:0:0:0 | [] | +| main.rs:2182:18:2182:25 | strings1 | [T;...] | file://:0:0:0:0 | & | +| main.rs:2182:18:2182:25 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2184:13:2184:20 | strings2 | | file://:0:0:0:0 | [] | +| main.rs:2184:13:2184:20 | strings2 | [T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2185:9:2189:9 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2185:9:2189:9 | [...] | [T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2186:13:2186:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2186:26:2186:30 | "foo" | | file://:0:0:0:0 | & | +| main.rs:2186:26:2186:30 | "foo" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2187:13:2187:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2187:26:2187:30 | "bar" | | file://:0:0:0:0 | & | +| main.rs:2187:26:2187:30 | "bar" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2188:13:2188:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2188:26:2188:30 | "baz" | | file://:0:0:0:0 | & | +| main.rs:2188:26:2188:30 | "baz" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2190:13:2190:13 | s | | {EXTERNAL LOCATION} | String | +| main.rs:2190:18:2190:25 | strings2 | | file://:0:0:0:0 | [] | +| main.rs:2190:18:2190:25 | strings2 | [T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2192:13:2192:20 | strings3 | | file://:0:0:0:0 | & | +| main.rs:2192:13:2192:20 | strings3 | &T | file://:0:0:0:0 | [] | +| main.rs:2192:13:2192:20 | strings3 | &T.[T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2193:9:2197:9 | &... | | file://:0:0:0:0 | & | +| main.rs:2193:9:2197:9 | &... | &T | file://:0:0:0:0 | [] | +| main.rs:2193:9:2197:9 | &... | &T.[T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2193:10:2197:9 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2193:10:2197:9 | [...] | [T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2194:13:2194:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2194:26:2194:30 | "foo" | | file://:0:0:0:0 | & | +| main.rs:2194:26:2194:30 | "foo" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2195:13:2195:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2195:26:2195:30 | "bar" | | file://:0:0:0:0 | & | +| main.rs:2195:26:2195:30 | "bar" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2196:13:2196:31 | ...::from(...) | | {EXTERNAL LOCATION} | String | +| main.rs:2196:26:2196:30 | "baz" | | file://:0:0:0:0 | & | +| main.rs:2196:26:2196:30 | "baz" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2198:13:2198:13 | s | | {EXTERNAL LOCATION} | Item | +| main.rs:2198:13:2198:13 | s | | file://:0:0:0:0 | & | +| main.rs:2198:13:2198:13 | s | &T | {EXTERNAL LOCATION} | String | +| main.rs:2198:18:2198:25 | strings3 | | file://:0:0:0:0 | & | +| main.rs:2198:18:2198:25 | strings3 | &T | file://:0:0:0:0 | [] | +| main.rs:2198:18:2198:25 | strings3 | &T.[T;...] | {EXTERNAL LOCATION} | String | +| main.rs:2200:13:2200:21 | callables | | file://:0:0:0:0 | [] | +| main.rs:2200:13:2200:21 | callables | [T;...] | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2200:25:2200:81 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2200:25:2200:81 | [...] | [T;...] | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2200:26:2200:42 | ...::new(...) | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2200:45:2200:61 | ...::new(...) | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2200:64:2200:80 | ...::new(...) | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2201:13:2201:13 | c | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2202:12:2202:20 | callables | | file://:0:0:0:0 | [] | +| main.rs:2202:12:2202:20 | callables | [T;...] | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2204:17:2204:22 | result | | {EXTERNAL LOCATION} | i64 | +| main.rs:2204:26:2204:26 | c | | main.rs:2148:5:2148:24 | MyCallable | +| main.rs:2204:26:2204:33 | c.call() | | {EXTERNAL LOCATION} | i64 | +| main.rs:2209:13:2209:13 | i | | {EXTERNAL LOCATION} | Item | +| main.rs:2209:13:2209:13 | i | | {EXTERNAL LOCATION} | i32 | +| main.rs:2209:18:2209:18 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2209:18:2209:22 | 0..10 | | {EXTERNAL LOCATION} | Range | +| main.rs:2209:18:2209:22 | 0..10 | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2209:21:2209:22 | 10 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:13:2210:13 | u | | {EXTERNAL LOCATION} | Range | +| main.rs:2210:13:2210:13 | u | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:13:2210:13 | u | Idx | {EXTERNAL LOCATION} | u8 | +| main.rs:2210:18:2210:26 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2210:18:2210:26 | [...] | [T;...] | {EXTERNAL LOCATION} | Range | +| main.rs:2210:18:2210:26 | [...] | [T;...].Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:18:2210:26 | [...] | [T;...].Idx | {EXTERNAL LOCATION} | u8 | +| main.rs:2210:19:2210:21 | 0u8 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:19:2210:21 | 0u8 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2210:19:2210:25 | 0u8..10 | | {EXTERNAL LOCATION} | Range | +| main.rs:2210:19:2210:25 | 0u8..10 | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:19:2210:25 | 0u8..10 | Idx | {EXTERNAL LOCATION} | u8 | +| main.rs:2210:24:2210:25 | 10 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2210:24:2210:25 | 10 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2211:13:2211:17 | range | | {EXTERNAL LOCATION} | Range | +| main.rs:2211:13:2211:17 | range | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2211:21:2211:21 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2211:21:2211:25 | 0..10 | | {EXTERNAL LOCATION} | Range | +| main.rs:2211:21:2211:25 | 0..10 | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2211:24:2211:25 | 10 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2212:13:2212:13 | i | | {EXTERNAL LOCATION} | Item | +| main.rs:2212:13:2212:13 | i | | {EXTERNAL LOCATION} | i32 | +| main.rs:2212:18:2212:22 | range | | {EXTERNAL LOCATION} | Range | +| main.rs:2212:18:2212:22 | range | Idx | {EXTERNAL LOCATION} | i32 | +| main.rs:2214:13:2214:18 | range1 | | {EXTERNAL LOCATION} | Range | +| main.rs:2214:13:2214:18 | range1 | Idx | {EXTERNAL LOCATION} | u16 | +| main.rs:2215:9:2218:9 | ...::Range {...} | | {EXTERNAL LOCATION} | Range | +| main.rs:2215:9:2218:9 | ...::Range {...} | Idx | {EXTERNAL LOCATION} | u16 | +| main.rs:2216:20:2216:23 | 0u16 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2217:18:2217:22 | 10u16 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2219:13:2219:13 | u | | {EXTERNAL LOCATION} | Item | +| main.rs:2219:13:2219:13 | u | | {EXTERNAL LOCATION} | u16 | +| main.rs:2219:18:2219:23 | range1 | | {EXTERNAL LOCATION} | Range | +| main.rs:2219:18:2219:23 | range1 | Idx | {EXTERNAL LOCATION} | u16 | +| main.rs:2223:26:2223:26 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2223:29:2223:29 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2223:32:2223:32 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2226:13:2226:18 | vals4a | | {EXTERNAL LOCATION} | Vec | +| main.rs:2226:13:2226:18 | vals4a | A | {EXTERNAL LOCATION} | Global | +| main.rs:2226:13:2226:18 | vals4a | T | {EXTERNAL LOCATION} | u16 | +| main.rs:2226:32:2226:43 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2226:32:2226:43 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2226:32:2226:43 | [...] | [T;...] | {EXTERNAL LOCATION} | u16 | +| main.rs:2226:32:2226:52 | ... .to_vec() | | {EXTERNAL LOCATION} | Vec | +| main.rs:2226:32:2226:52 | ... .to_vec() | A | {EXTERNAL LOCATION} | Global | +| main.rs:2226:32:2226:52 | ... .to_vec() | T | {EXTERNAL LOCATION} | u16 | +| main.rs:2226:33:2226:36 | 1u16 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2226:33:2226:36 | 1u16 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2226:39:2226:39 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2226:39:2226:39 | 2 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2226:42:2226:42 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2226:42:2226:42 | 3 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2227:13:2227:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2227:13:2227:13 | u | | {EXTERNAL LOCATION} | u16 | +| main.rs:2227:13:2227:13 | u | | file://:0:0:0:0 | & | +| main.rs:2227:13:2227:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2227:13:2227:13 | u | T | {EXTERNAL LOCATION} | u16 | +| main.rs:2227:18:2227:23 | vals4a | | {EXTERNAL LOCATION} | Vec | +| main.rs:2227:18:2227:23 | vals4a | A | {EXTERNAL LOCATION} | Global | +| main.rs:2227:18:2227:23 | vals4a | T | {EXTERNAL LOCATION} | u16 | +| main.rs:2229:22:2229:33 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2229:22:2229:33 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2229:22:2229:33 | [...] | [T;...] | {EXTERNAL LOCATION} | u16 | +| main.rs:2229:23:2229:26 | 1u16 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2229:23:2229:26 | 1u16 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2229:29:2229:29 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2229:29:2229:29 | 2 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2229:32:2229:32 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2229:32:2229:32 | 3 | | {EXTERNAL LOCATION} | u16 | +| main.rs:2232:13:2232:17 | vals5 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2232:13:2232:17 | vals5 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2232:13:2232:17 | vals5 | T | {EXTERNAL LOCATION} | u8 | +| main.rs:2232:21:2232:43 | ...::from(...) | | {EXTERNAL LOCATION} | Vec | +| main.rs:2232:21:2232:43 | ...::from(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2232:21:2232:43 | ...::from(...) | T | {EXTERNAL LOCATION} | u8 | +| main.rs:2232:31:2232:42 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | +| main.rs:2232:32:2232:35 | 1u32 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:32:2232:35 | 1u32 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2232:38:2232:38 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:38:2232:38 | 2 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | u32 | +| main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | u8 | +| main.rs:2233:13:2233:13 | u | | file://:0:0:0:0 | & | +| main.rs:2233:13:2233:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2233:13:2233:13 | u | T | {EXTERNAL LOCATION} | u8 | +| main.rs:2233:18:2233:22 | vals5 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2233:18:2233:22 | vals5 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2233:18:2233:22 | vals5 | T | {EXTERNAL LOCATION} | u8 | +| main.rs:2235:13:2235:17 | vals6 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2235:13:2235:17 | vals6 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2235:13:2235:17 | vals6 | T | file://:0:0:0:0 | & | +| main.rs:2235:13:2235:17 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | +| main.rs:2235:32:2235:43 | [...] | | file://:0:0:0:0 | [] | +| main.rs:2235:32:2235:43 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| main.rs:2235:32:2235:43 | [...] | [T;...] | {EXTERNAL LOCATION} | u64 | +| main.rs:2235:32:2235:60 | ... .collect() | | {EXTERNAL LOCATION} | Vec | +| main.rs:2235:32:2235:60 | ... .collect() | A | {EXTERNAL LOCATION} | Global | +| main.rs:2235:32:2235:60 | ... .collect() | T | file://:0:0:0:0 | & | +| main.rs:2235:32:2235:60 | ... .collect() | T.&T | {EXTERNAL LOCATION} | u64 | +| main.rs:2235:33:2235:36 | 1u64 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2235:33:2235:36 | 1u64 | | {EXTERNAL LOCATION} | u64 | +| main.rs:2235:39:2235:39 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2235:39:2235:39 | 2 | | {EXTERNAL LOCATION} | u64 | +| main.rs:2235:42:2235:42 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2235:42:2235:42 | 3 | | {EXTERNAL LOCATION} | u64 | +| main.rs:2236:13:2236:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2236:13:2236:13 | u | | file://:0:0:0:0 | & | +| main.rs:2236:13:2236:13 | u | &T | {EXTERNAL LOCATION} | u64 | +| main.rs:2236:13:2236:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2236:13:2236:13 | u | T | file://:0:0:0:0 | & | +| main.rs:2236:13:2236:13 | u | T.&T | {EXTERNAL LOCATION} | u64 | +| main.rs:2236:18:2236:22 | vals6 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2236:18:2236:22 | vals6 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2236:18:2236:22 | vals6 | T | file://:0:0:0:0 | & | +| main.rs:2236:18:2236:22 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | +| main.rs:2238:13:2238:21 | mut vals7 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2238:13:2238:21 | mut vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2238:25:2238:34 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | +| main.rs:2238:25:2238:34 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2239:9:2239:13 | vals7 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2239:9:2239:13 | vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2239:20:2239:22 | 1u8 | | {EXTERNAL LOCATION} | u8 | +| main.rs:2240:13:2240:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2240:13:2240:13 | u | | file://:0:0:0:0 | & | +| main.rs:2240:13:2240:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2240:18:2240:22 | vals7 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2240:18:2240:22 | vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2242:33:2242:33 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2242:36:2242:36 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2242:45:2242:45 | 3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2242:48:2242:48 | 4 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2249:13:2249:20 | mut map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2249:13:2249:20 | mut map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2249:24:2249:55 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2249:24:2249:55 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2250:9:2250:12 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2250:9:2250:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2250:9:2250:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2250:21:2250:21 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2250:24:2250:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| main.rs:2250:24:2250:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2250:33:2250:37 | "one" | | file://:0:0:0:0 | & | +| main.rs:2250:33:2250:37 | "one" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2251:9:2251:12 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2251:9:2251:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2251:9:2251:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2251:21:2251:21 | 2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2251:24:2251:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| main.rs:2251:24:2251:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2251:33:2251:37 | "two" | | file://:0:0:0:0 | & | +| main.rs:2251:33:2251:37 | "two" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2252:13:2252:15 | key | | {EXTERNAL LOCATION} | Item | +| main.rs:2252:13:2252:15 | key | | file://:0:0:0:0 | & | +| main.rs:2252:20:2252:23 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2252:20:2252:23 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2252:20:2252:30 | map1.keys() | | {EXTERNAL LOCATION} | Keys | +| main.rs:2253:13:2253:17 | value | | {EXTERNAL LOCATION} | Item | +| main.rs:2253:13:2253:17 | value | | file://:0:0:0:0 | & | +| main.rs:2253:22:2253:25 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2253:22:2253:25 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2253:22:2253:34 | map1.values() | | {EXTERNAL LOCATION} | Values | +| main.rs:2254:13:2254:24 | TuplePat | | {EXTERNAL LOCATION} | Item | +| main.rs:2254:29:2254:32 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2254:29:2254:32 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2254:29:2254:39 | map1.iter() | | {EXTERNAL LOCATION} | Iter | +| main.rs:2255:13:2255:24 | TuplePat | | {EXTERNAL LOCATION} | Item | +| main.rs:2255:29:2255:33 | &map1 | | file://:0:0:0:0 | & | +| main.rs:2255:29:2255:33 | &map1 | &T | {EXTERNAL LOCATION} | HashMap | +| main.rs:2255:29:2255:33 | &map1 | &T.S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2255:30:2255:33 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2255:30:2255:33 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i32 | +| main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i64 | +| main.rs:2259:26:2259:26 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2259:26:2259:26 | 0 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2261:23:2261:23 | a | | {EXTERNAL LOCATION} | i32 | +| main.rs:2261:23:2261:23 | a | | {EXTERNAL LOCATION} | i64 | +| main.rs:2261:23:2261:28 | ... < ... | | {EXTERNAL LOCATION} | bool | +| main.rs:2261:27:2261:28 | 10 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2263:13:2263:13 | a | | {EXTERNAL LOCATION} | i32 | +| main.rs:2263:13:2263:13 | a | | {EXTERNAL LOCATION} | i64 | +| main.rs:2263:13:2263:18 | ... += ... | | file://:0:0:0:0 | () | +| main.rs:2263:18:2263:18 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2277:40:2279:9 | { ... } | | {EXTERNAL LOCATION} | Option | +| main.rs:2277:40:2279:9 | { ... } | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2277:40:2279:9 | { ... } | T.T | main.rs:2276:10:2276:19 | T | +| main.rs:2278:13:2278:16 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2278:13:2278:16 | None | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2278:13:2278:16 | None | T.T | main.rs:2276:10:2276:19 | T | +| main.rs:2281:30:2283:9 | { ... } | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2281:30:2283:9 | { ... } | T | main.rs:2276:10:2276:19 | T | +| main.rs:2282:13:2282:28 | S1(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2282:13:2282:28 | S1(...) | T | main.rs:2276:10:2276:19 | T | +| main.rs:2282:16:2282:27 | ...::default(...) | | main.rs:2276:10:2276:19 | T | +| main.rs:2285:19:2285:22 | SelfParam | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2285:19:2285:22 | SelfParam | T | main.rs:2276:10:2276:19 | T | +| main.rs:2285:33:2287:9 | { ... } | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2285:33:2287:9 | { ... } | T | main.rs:2276:10:2276:19 | T | +| main.rs:2286:13:2286:16 | self | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2286:13:2286:16 | self | T | main.rs:2276:10:2276:19 | T | +| main.rs:2299:13:2299:14 | x1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2299:13:2299:14 | x1 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2299:13:2299:14 | x1 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2300:13:2300:14 | x2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2300:13:2300:14 | x2 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2300:13:2300:14 | x2 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2301:13:2301:14 | x3 | | {EXTERNAL LOCATION} | Option | +| main.rs:2301:13:2301:14 | x3 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2301:13:2301:14 | x3 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2302:13:2302:14 | x4 | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2302:13:2302:14 | x4 | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2302:18:2302:48 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2302:18:2302:48 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2302:35:2302:47 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2302:35:2302:47 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2303:13:2303:14 | x5 | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2303:13:2303:14 | x5 | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2303:18:2303:42 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2303:18:2303:42 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2303:29:2303:41 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2303:29:2303:41 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2304:13:2304:14 | x6 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2304:13:2304:14 | x6 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2304:18:2304:45 | S4::<...>(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2304:18:2304:45 | S4::<...>(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2304:27:2304:44 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | +| main.rs:2304:27:2304:44 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2305:13:2305:14 | x7 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2305:13:2305:14 | x7 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2305:18:2305:23 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2305:18:2305:23 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2305:21:2305:22 | S2 | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2306:13:2306:14 | x8 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2306:13:2306:14 | x8 | T4 | {EXTERNAL LOCATION} | i32 | +| main.rs:2306:18:2306:22 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2306:18:2306:22 | S4(...) | T4 | {EXTERNAL LOCATION} | i32 | +| main.rs:2306:21:2306:21 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2307:13:2307:14 | x9 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2307:13:2307:14 | x9 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2307:18:2307:34 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2307:18:2307:34 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2307:21:2307:33 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2308:13:2308:15 | x10 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2308:13:2308:15 | x10 | T5 | {EXTERNAL LOCATION} | trait Default | +| main.rs:2308:13:2308:15 | x10 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2308:19:2311:9 | S5::<...> {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2308:19:2311:9 | S5::<...> {...} | T5 | {EXTERNAL LOCATION} | trait Default | +| main.rs:2308:19:2311:9 | S5::<...> {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2310:20:2310:37 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | +| main.rs:2310:20:2310:37 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2312:13:2312:15 | x11 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2312:13:2312:15 | x11 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2312:19:2312:34 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2312:19:2312:34 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2312:31:2312:32 | S2 | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2313:13:2313:15 | x12 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2313:13:2313:15 | x12 | T5 | {EXTERNAL LOCATION} | i32 | +| main.rs:2313:19:2313:33 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2313:19:2313:33 | S5 {...} | T5 | {EXTERNAL LOCATION} | i32 | +| main.rs:2313:31:2313:31 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2314:13:2314:15 | x13 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2314:13:2314:15 | x13 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2314:19:2317:9 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2314:19:2317:9 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2316:20:2316:32 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2326:14:2326:18 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | +| main.rs:2326:21:2326:25 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | +| main.rs:2328:16:2328:19 | SelfParam | | main.rs:2322:5:2322:16 | S1 | +| main.rs:2351:5:2351:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2352:5:2352:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2352:20:2352:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2352:41:2352:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2368:5:2368:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| main.rs:2380:44:2399:5 | { ... } | | {EXTERNAL LOCATION} | Option | +| main.rs:2381:13:2381:17 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2381:13:2381:17 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:21:2381:28 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2381:21:2381:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:26:2381:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:29:2382:33 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2382:29:2382:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2384:22:2384:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2384:22:2384:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2386:15:2386:19 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2386:15:2386:19 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2389:26:2389:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2389:26:2389:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2393:13:2393:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:20:2393:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2393:20:2393:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:20:2393:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:13:2394:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:20:2394:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2395:18:2395:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2395:18:2395:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2395:20:2395:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2396:13:2396:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2396:20:2396:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2396:20:2396:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2396:20:2396:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | +| main.rs:2397:18:2397:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2397:18:2397:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2397:20:2397:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2398:9:2398:12 | None | | {EXTERNAL LOCATION} | Option | testFailures From ebde0bdc472701204cd94245ab4feeb598c58530 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 8 Jul 2025 13:15:27 +0200 Subject: [PATCH 47/96] Rust: Disambiguate calls to associated functions --- .../elements/internal/CallExprBaseImpl.qll | 3 +- .../rust/elements/internal/CallExprImpl.qll | 10 - .../rust/elements/internal/CallImpl.qll | 74 +++-- .../elements/internal/MethodCallExprImpl.qll | 4 - rust/ql/lib/codeql/rust/internal/Type.qll | 2 + .../codeql/rust/internal/TypeInference.qll | 281 ++++++++++++++---- 6 files changed, 282 insertions(+), 92 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll index b78720b08fa..cdccc3f31d9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll @@ -13,6 +13,7 @@ private import codeql.rust.elements.Resolvable */ module Impl { private import rust + private import codeql.rust.internal.TypeInference as TypeInference pragma[nomagic] Resolvable getCallResolvable(CallExprBase call) { @@ -27,7 +28,7 @@ module Impl { */ class CallExprBase extends Generated::CallExprBase { /** Gets the static target of this call, if any. */ - Callable getStaticTarget() { none() } // overridden by subclasses, but cannot be made abstract + final Function getStaticTarget() { result = TypeInference::resolveCallTarget(this) } override Expr getArg(int index) { result = this.getArgList().getArg(index) } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll index e5262014ab4..5723e1fdbb5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll @@ -14,7 +14,6 @@ private import codeql.rust.elements.PathExpr module Impl { private import rust private import codeql.rust.internal.PathResolution as PathResolution - private import codeql.rust.internal.TypeInference as TypeInference pragma[nomagic] Path getFunctionPath(CallExpr ce) { result = ce.getFunction().(PathExpr).getPath() } @@ -37,15 +36,6 @@ module Impl { class CallExpr extends Generated::CallExpr { override string toStringImpl() { result = this.getFunction().toAbbreviatedString() + "(...)" } - override Callable getStaticTarget() { - // If this call is to a trait method, e.g., `Trait::foo(bar)`, then check - // if type inference can resolve it to the correct trait implementation. - result = TypeInference::resolveMethodCallTarget(this) - or - not exists(TypeInference::resolveMethodCallTarget(this)) and - result = getResolvedFunction(this) - } - /** Gets the struct that this call resolves to, if any. */ Struct getStruct() { result = getResolvedFunction(this) } diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll index 955e230dd76..ac6e08bb9cf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll @@ -40,6 +40,9 @@ module Impl { /** Gets the trait targeted by this call, if any. */ abstract Trait getTrait(); + /** Holds if this call targets a trait. */ + predicate hasTrait() { exists(this.getTrait()) } + /** Gets the name of the method called if this call is a method call. */ abstract string getMethodName(); @@ -59,12 +62,7 @@ module Impl { Expr getReceiver() { result = this.getArgument(TSelfArgumentPosition()) } /** Gets the static target of this call, if any. */ - Function getStaticTarget() { - result = TypeInference::resolveMethodCallTarget(this) - or - not exists(TypeInference::resolveMethodCallTarget(this)) and - result = this.(CallExpr).getStaticTarget() - } + Function getStaticTarget() { result = TypeInference::resolveCallTarget(this) } /** Gets a runtime target of this call, if any. */ pragma[nomagic] @@ -78,23 +76,44 @@ module Impl { } } - /** Holds if the call expression dispatches to a method. */ - private predicate callIsMethodCall(CallExpr call, Path qualifier, string methodName) { - exists(Path path, Function f | - path = call.getFunction().(PathExpr).getPath() and - f = resolvePath(path) and - f.getParamList().hasSelfParam() and - qualifier = path.getQualifier() and - path.getSegment().getIdentifier().getText() = methodName + private predicate callHasQualifier(CallExpr call, Path path, Path qualifier) { + path = call.getFunction().(PathExpr).getPath() and + qualifier = path.getQualifier() + } + + private predicate callHasTraitQualifier(CallExpr call, Trait qualifier) { + exists(RelevantPath qualifierPath | + callHasQualifier(call, _, qualifierPath) and + qualifier = resolvePath(qualifierPath) and + // When the qualifier is `Self` and resolves to a trait, it's inside a + // trait method's default implementation. This is not a dispatch whose + // target is inferred from the type of the receiver, but should always + // resolve to the function in the trait block as path resolution does. + not qualifierPath.isUnqualified("Self") ) } - private class CallExprCall extends Call instanceof CallExpr { - CallExprCall() { not callIsMethodCall(this, _, _) } + /** Holds if the call expression dispatches to a method. */ + private predicate callIsMethodCall( + CallExpr call, Path qualifier, string methodName, boolean selfIsRef + ) { + exists(Path path, Function f | + callHasQualifier(call, path, qualifier) and + f = resolvePath(path) and + path.getSegment().getIdentifier().getText() = methodName and + exists(SelfParam self | + self = f.getParamList().getSelfParam() and + if self.isRef() then selfIsRef = true else selfIsRef = false + ) + ) + } + + class CallExprCall extends Call instanceof CallExpr { + CallExprCall() { not callIsMethodCall(this, _, _, _) } override string getMethodName() { none() } - override Trait getTrait() { none() } + override Trait getTrait() { callHasTraitQualifier(this, result) } override predicate implicitBorrowAt(ArgumentPosition pos, boolean certain) { none() } @@ -103,22 +122,23 @@ module Impl { } } - private class CallExprMethodCall extends Call instanceof CallExpr { + class CallExprMethodCall extends Call instanceof CallExpr { Path qualifier; string methodName; + boolean selfIsRef; - CallExprMethodCall() { callIsMethodCall(this, qualifier, methodName) } + CallExprMethodCall() { callIsMethodCall(this, qualifier, methodName, selfIsRef) } + + /** + * Holds if this call must have an explicit borrow for the `self` argument, + * because the corresponding parameter is `&self`. Explicit borrows are not + * needed when using method call syntax. + */ + predicate hasExplicitSelfBorrow() { selfIsRef = true } override string getMethodName() { result = methodName } - override Trait getTrait() { - result = resolvePath(qualifier) and - // When the qualifier is `Self` and resolves to a trait, it's inside a - // trait method's default implementation. This is not a dispatch whose - // target is inferred from the type of the receiver, but should always - // resolve to the function in the trait block as path resolution does. - qualifier.toString() != "Self" - } + override Trait getTrait() { callHasTraitQualifier(this, result) } override predicate implicitBorrowAt(ArgumentPosition pos, boolean certain) { none() } diff --git a/rust/ql/lib/codeql/rust/elements/internal/MethodCallExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/MethodCallExprImpl.qll index 1141ade4bd6..ac8d9b210e9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/MethodCallExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/MethodCallExprImpl.qll @@ -6,8 +6,6 @@ private import rust private import codeql.rust.elements.internal.generated.MethodCallExpr -private import codeql.rust.internal.PathResolution -private import codeql.rust.internal.TypeInference /** * INTERNAL: This module contains the customizable definition of `MethodCallExpr` and should not @@ -23,8 +21,6 @@ module Impl { * ``` */ class MethodCallExpr extends Generated::MethodCallExpr { - override Function getStaticTarget() { result = resolveMethodCallTarget(this) } - private string toStringPart(int index) { index = 0 and result = this.getReceiver().toAbbreviatedString() diff --git a/rust/ql/lib/codeql/rust/internal/Type.qll b/rust/ql/lib/codeql/rust/internal/Type.qll index 497639b95c0..77337138a84 100644 --- a/rust/ql/lib/codeql/rust/internal/Type.qll +++ b/rust/ql/lib/codeql/rust/internal/Type.qll @@ -425,6 +425,8 @@ final class TraitTypeAbstraction extends TypeAbstraction, Trait { result.(TypeParamTypeParameter).getTypeParam() = this.getGenericParamList().getATypeParam() or result.(AssociatedTypeTypeParameter).getTrait() = this + or + result.(SelfTypeParameter).getTrait() = this } } diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index abed5eb5672..a08cc8137be 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -11,6 +11,7 @@ private import codeql.rust.frameworks.stdlib.Stdlib private import codeql.rust.frameworks.stdlib.Builtins as Builtins private import codeql.rust.elements.Call private import codeql.rust.elements.internal.CallImpl::Impl as CallImpl +private import codeql.rust.elements.internal.CallExprImpl::Impl as CallExprImpl class Type = T::Type; @@ -522,6 +523,15 @@ private Type inferPathExprType(PathExpr pe, TypePath path) { ) } +/** Gets the explicit type qualifier of the call `ce`, if any. */ +private Type getTypeQualifier(CallExpr ce, TypePath path) { + exists(PathExpr pe, TypeMention tm | + pe = ce.getFunction() and + tm = pe.getPath().getQualifier() and + result = tm.resolveTypeAt(path) + ) +} + /** * A matching configuration for resolving types of call expressions * like `foo::bar(baz)` and `foo.bar(baz)`. @@ -724,8 +734,6 @@ private module CallExprBaseMatchingInput implements MatchingInputSig { } } - private import codeql.rust.elements.internal.CallExprImpl::Impl as CallExprImpl - final class Access extends Call { pragma[nomagic] Type getTypeArgument(TypeArgumentPosition apos, TypePath path) { @@ -761,17 +769,13 @@ private module CallExprBaseMatchingInput implements MatchingInputSig { or // The `Self` type is supplied explicitly as a type qualifier, e.g. `Foo::::baz()` apos = TArgumentAccessPosition(CallImpl::TSelfArgumentPosition(), false, false) and - exists(PathExpr pe, TypeMention tm | - pe = this.(CallExpr).getFunction() and - tm = pe.getPath().getQualifier() and - result = tm.resolveTypeAt(path) - ) + result = getTypeQualifier(this, path) } Declaration getTarget() { result = resolveMethodCallTarget(this) // mutual recursion; resolving method calls requires resolving types and vice versa or - result = CallExprImpl::getResolvedFunction(this) + result = resolveFunctionCallTarget(this) // potential mutual recursion; resolving some associated function calls requires resolving types } } @@ -1220,15 +1224,28 @@ private Type inferForLoopExprType(AstNode n, TypePath path) { ) } +pragma[nomagic] +private Type inferCastExprType(CastExpr ce, TypePath path) { + result = ce.getTypeRepr().(TypeMention).resolveTypeAt(path) +} + final class MethodCall extends Call { MethodCall() { exists(this.getReceiver()) } + private Type getReceiverTypeAt(TypePath path) { + result = inferType(super.getReceiver(), path) + or + result = getTypeQualifier(this, path) + } + /** Gets the type of the receiver of the method call at `path`. */ Type getTypeAt(TypePath path) { - if this.receiverImplicitlyBorrowed() + if + this.receiverImplicitlyBorrowed() or + this.(CallImpl::CallExprMethodCall).hasExplicitSelfBorrow() then exists(TypePath path0, Type t0 | - t0 = inferType(super.getReceiver(), path0) and + t0 = this.getReceiverTypeAt(path0) and ( path0.isCons(TRefTypeParameter(), path) or @@ -1256,7 +1273,7 @@ final class MethodCall extends Call { t0.(StructType).asItemNode() instanceof StringStruct and result.(StructType).asItemNode() instanceof Builtins::Str ) - else result = inferType(super.getReceiver(), path) + else result = this.getReceiverTypeAt(path) } } @@ -1349,8 +1366,6 @@ private predicate implSiblingCandidate( // contains the same `impl` block so considering both would give spurious // siblings). not exists(impl.getAttributeMacroExpansion()) and - // We use this for resolving methods, so exclude traits that do not have methods. - exists(Function f | f = trait.getASuccessor(_) and f.getParamList().hasSelfParam()) and selfTy = impl.getSelfTy() and rootType = selfTy.resolveType() } @@ -1385,42 +1400,49 @@ private predicate implSiblings(TraitItemNode trait, Impl impl1, Impl impl2) { pragma[nomagic] private predicate implHasSibling(Impl impl, Trait trait) { implSiblings(trait, impl, _) } +pragma[nomagic] +private predicate functionTypeAtPath(Function f, int pos, TypePath path, Type type) { + exists(TypeMention tm | type = tm.resolveTypeAt(path) | + tm = f.getParam(pos).getTypeRepr() + or + pos = -1 and + tm = f.getRetType().getTypeRepr() + ) +} + /** - * Holds if a type parameter of `trait` occurs in the method with the name - * `methodName` at the `pos`th parameter at `path`. + * Holds if type parameter `tp` of `trait` occurs in the function with the name + * `functionName` at the `pos`th parameter at `path`. + * + * The special position `-1` refers to the return type of the function, which + * is sometimes needed to disambiguate associated function calls like + * `Default::default()` (in this case, `tp` is the special `Self` type parameter). */ bindingset[trait] pragma[inline_late] private predicate traitTypeParameterOccurrence( - TraitItemNode trait, string methodName, int pos, TypePath path + TraitItemNode trait, Function f, string functionName, int pos, TypePath path, TypeParameter tp ) { - exists(Function f | f = trait.getASuccessor(methodName) | - f.getParam(pos).getTypeRepr().(TypeMention).resolveTypeAt(path) = - trait.(TraitTypeAbstraction).getATypeParameter() - ) -} - -bindingset[f, pos, path] -pragma[inline_late] -private predicate methodTypeAtPath(Function f, int pos, TypePath path, Type type) { - f.getParam(pos).getTypeRepr().(TypeMention).resolveTypeAt(path) = type + f = trait.getAssocItem(functionName) and + functionTypeAtPath(f, pos, path, tp) and + tp = trait.(TraitTypeAbstraction).getATypeParameter() } /** - * Holds if resolving the method `f` in `impl` with the name `methodName` + * Holds if resolving the function `f` in `impl` with the name `functionName` * requires inspecting the types of applied _arguments_ in order to determine * whether it is the correct resolution. */ pragma[nomagic] -private predicate methodResolutionDependsOnArgument( - Impl impl, string methodName, Function f, int pos, TypePath path, Type type +private predicate functionResolutionDependsOnArgument( + ImplItemNode impl, string functionName, Function f, int pos, TypePath path, Type type ) { /* * As seen in the example below, when an implementation has a sibling for a - * trait we find occurrences of a type parameter of the trait in a method + * trait we find occurrences of a type parameter of the trait in a function * signature in the trait. We then find the type given in the implementation * at the same position, which is a position that might disambiguate the - * method from its siblings. + * function from its siblings. * * ```rust * trait MyTrait { @@ -1442,9 +1464,10 @@ private predicate methodResolutionDependsOnArgument( exists(TraitItemNode trait | implHasSibling(impl, trait) and - traitTypeParameterOccurrence(trait, methodName, pos, path) and - methodTypeAtPath(getMethodSuccessor(impl, methodName), pos, path, type) and - f = getMethodSuccessor(impl, methodName) + traitTypeParameterOccurrence(trait, _, functionName, pos, path, _) and + functionTypeAtPath(f, pos, path, type) and + f = impl.getAssocItem(functionName) and + pos >= 0 ) } @@ -1484,11 +1507,12 @@ private Function getMethodFromImpl(MethodCall mc) { name = mc.getMethodName() and result = getMethodSuccessor(impl, name) | - not methodResolutionDependsOnArgument(impl, _, _, _, _, _) + not functionResolutionDependsOnArgument(impl, name, _, _, _, _) or exists(int pos, TypePath path, Type type | - methodResolutionDependsOnArgument(impl, name, result, pos, path, type) and - inferType(mc.getPositionalArgument(pos), path) = type + functionResolutionDependsOnArgument(impl, name, result, pos, pragma[only_bind_into](path), + type) and + inferType(mc.getPositionalArgument(pos), pragma[only_bind_into](path)) = type ) ) } @@ -1499,6 +1523,162 @@ private Function getTraitMethod(ImplTraitReturnType trait, string name) { result = getMethodSuccessor(trait.getImplTraitTypeRepr(), name) } +pragma[nomagic] +private Function resolveMethodCallTarget(MethodCall mc) { + // The method comes from an `impl` block targeting the type of the receiver. + result = getMethodFromImpl(mc) + or + // The type of the receiver is a type parameter and the method comes from a + // trait bound on the type parameter. + result = getTypeParameterMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName()) + or + // The type of the receiver is an `impl Trait` type. + result = getTraitMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName()) +} + +pragma[nomagic] +private predicate assocFuncResolutionDependsOnArgument(Function f, Impl impl, int pos) { + functionResolutionDependsOnArgument(impl, _, f, pos, _, _) and + not f.getParamList().hasSelfParam() +} + +private class FunctionCallExpr extends CallImpl::CallExprCall { + ItemNode getResolvedFunction() { result = CallExprImpl::getResolvedFunction(this) } + + /** + * Holds if the target of this call is ambigous, and type information is required + * to disambiguate. + */ + predicate isAmbigous() { + this.hasTrait() + or + assocFuncResolutionDependsOnArgument(this.getResolvedFunction(), _, _) + } + + /** + * Gets a target candidate of this ambigous call, which belongs to `impl`. + * + * In order for the candidate to be a match, the argument type at `pos` must be + * checked against the type of the function at the same position. + * + * `resolved` is the corresponding function resolved through path resolution. + */ + pragma[nomagic] + Function getAnAmbigousCandidate(ImplItemNode impl, int pos, Function resolved) { + resolved = this.getResolvedFunction() and + ( + exists(TraitItemNode trait | + trait = this.getTrait() and + result.implements(resolved) and + result = impl.getAnAssocItem() + | + assocFuncResolutionDependsOnArgument(result, impl, pos) + or + exists(TypeParameter tp | traitTypeParameterOccurrence(trait, resolved, _, pos, _, tp) | + pos >= 0 + or + // We only check that the context of the call provides relevant type information + // when no argument can + not traitTypeParameterOccurrence(trait, resolved, _, any(int pos0 | pos0 >= 0), _, tp) + ) + ) + or + result = resolved and + assocFuncResolutionDependsOnArgument(result, impl, pos) + ) + } + + /** + * Same as `getAnAmbigousCandidate`, ranks the positions to be checked. + */ + Function getAnAmbigousCandidateRanked(ImplItemNode impl, int pos, Function f, int rnk) { + pos = rank[rnk + 1](int pos0 | result = this.getAnAmbigousCandidate(impl, pos0, f) | pos0) + } +} + +private newtype TAmbigousAssocFunctionCallExpr = + MkAmbigousAssocFunctionCallExpr(FunctionCallExpr call, Function resolved, int pos) { + exists(call.getAnAmbigousCandidate(_, pos, resolved)) + } + +private class AmbigousAssocFunctionCallExpr extends MkAmbigousAssocFunctionCallExpr { + FunctionCallExpr call; + Function resolved; + int pos; + + AmbigousAssocFunctionCallExpr() { this = MkAmbigousAssocFunctionCallExpr(call, resolved, pos) } + + pragma[nomagic] + Type getTypeAt(TypePath path) { + result = inferType(call.(CallExpr).getArg(pos), path) + or + pos = -1 and + result = inferType(call, path) + } + + string toString() { result = call.toString() } + + Location getLocation() { result = call.getLocation() } +} + +private module AmbigousAssocFuncIsInstantiationOfInput implements + IsInstantiationOfInputSig +{ + pragma[nomagic] + predicate potentialInstantiationOf( + AmbigousAssocFunctionCallExpr ce, TypeAbstraction impl, TypeMention constraint + ) { + exists(FunctionCallExpr call, Function resolved, Function cand, int pos | + ce = MkAmbigousAssocFunctionCallExpr(call, resolved, pos) and + cand = call.getAnAmbigousCandidate(impl, pos, resolved) + | + constraint = cand.getParam(pos).getTypeRepr() + or + pos = -1 and + constraint = cand.getRetType().getTypeRepr() + ) + } +} + +/** + * Gets the target of `call`, where resolution does not rely on type inference. + */ +pragma[nomagic] +private ItemNode resolveUnambigousFunctionCallTarget(FunctionCallExpr call) { + result = call.getResolvedFunction() and + not call.isAmbigous() +} + +pragma[nomagic] +private Function resolveAmbigousFunctionCallTargetFromIndex(FunctionCallExpr call, int index) { + exists(Impl impl, int pos, Function resolved | + IsInstantiationOf::isInstantiationOf(MkAmbigousAssocFunctionCallExpr(call, + resolved, pos), impl, _) and + result = call.getAnAmbigousCandidateRanked(impl, pos, resolved, index) + | + index = 0 + or + result = resolveAmbigousFunctionCallTargetFromIndex(call, index - 1) + ) +} + +/** + * Gets the target of `call`, where resolution relies on type inference. + */ +pragma[nomagic] +private Function resolveAmbigousFunctionCallTarget(FunctionCallExpr call) { + result = + resolveAmbigousFunctionCallTargetFromIndex(call, + max(int index | result = call.getAnAmbigousCandidateRanked(_, _, _, index))) +} + +pragma[inline] +private ItemNode resolveFunctionCallTarget(FunctionCallExpr call) { + result = resolveUnambigousFunctionCallTarget(call) + or + result = resolveAmbigousFunctionCallTarget(call) +} + cached private module Cached { private import codeql.rust.internal.CachedStages @@ -1527,18 +1707,12 @@ private module Cached { ) } - /** Gets a method that the method call `mc` resolves to, if any. */ + /** Gets a function that `call` resolves to, if any. */ cached - Function resolveMethodCallTarget(MethodCall mc) { - // The method comes from an `impl` block targeting the type of the receiver. - result = getMethodFromImpl(mc) + Function resolveCallTarget(Call call) { + result = resolveMethodCallTarget(call) or - // The type of the receiver is a type parameter and the method comes from a - // trait bound on the type parameter. - result = getTypeParameterMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName()) - or - // The type of the receiver is an `impl Trait` type. - result = getTraitMethod(mc.getTypeAt(TypePath::nil()), mc.getMethodName()) + result = resolveFunctionCallTarget(call) } pragma[inline] @@ -1660,6 +1834,8 @@ private module Cached { result = inferIndexExprType(n, path) or result = inferForLoopExprType(n, path) + or + result = inferCastExprType(n, path) } } @@ -1685,9 +1861,9 @@ private module Debug { result = inferType(n, path) } - Function debugResolveMethodCallTarget(Call mce) { - mce = getRelevantLocatable() and - result = resolveMethodCallTarget(mce) + Function debugResolveCallTarget(Call c) { + c = getRelevantLocatable() and + result = resolveCallTarget(c) } predicate debugInferImplicitSelfType(SelfParam self, TypePath path, Type t) { @@ -1705,6 +1881,11 @@ private module Debug { tm.resolveTypeAt(path) = type } + Type debugInferAnnotatedType(AstNode n, TypePath path) { + n = getRelevantLocatable() and + result = inferAnnotatedType(n, path) + } + pragma[nomagic] private int countTypesAtPath(AstNode n, TypePath path, Type t) { t = inferType(n, path) and From c7d20eb98ada1409d6e966b52a279c6f5b0f7620 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Jul 2025 11:31:56 +0200 Subject: [PATCH 48/96] Rust: Update expected test output --- .../PathResolutionConsistency.expected | 9 ----- .../dataflow/global/inline-flow.expected | 31 +++++++++++++++ .../library-tests/dataflow/global/main.rs | 2 +- .../dataflow/global/viableCallable.expected | 1 + .../PathResolutionConsistency.expected | 3 -- .../test/library-tests/dataflow/local/main.rs | 2 +- .../PathResolutionConsistency.expected | 4 -- .../dataflow/sources/test_futures_io.rs | 8 ++-- .../PathResolutionConsistency.expected | 3 -- .../PathResolutionConsistency.expected | 5 --- .../test/library-tests/type-inference/main.rs | 20 +++++----- .../type-inference/type-inference.expected | 38 ------------------- .../PathResolutionConsistency.expected | 9 ----- .../security/CWE-022/TaintedPath.expected | 12 +++--- .../query-tests/security/CWE-022/src/main.rs | 4 +- 15 files changed, 56 insertions(+), 95 deletions(-) delete mode 100644 rust/ql/test/library-tests/dataflow/local/CONSISTENCY/PathResolutionConsistency.expected delete mode 100644 rust/ql/test/query-tests/security/CWE-022/CONSISTENCY/PathResolutionConsistency.expected diff --git a/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/PathResolutionConsistency.expected index a94f2c9cef5..675d607c9fd 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/PathResolutionConsistency.expected @@ -1,19 +1,10 @@ multipleCallTargets -| proc_macro.rs:6:18:6:61 | ...::from(...) | -| proc_macro.rs:7:15:7:58 | ...::from(...) | | proc_macro.rs:15:5:17:5 | ...::new(...) | -| proc_macro.rs:16:12:16:16 | ...::to_tokens(...) | -| proc_macro.rs:22:15:22:58 | ...::from(...) | | proc_macro.rs:25:5:28:5 | ...::new(...) | -| proc_macro.rs:26:10:26:12 | ...::to_tokens(...) | -| proc_macro.rs:27:10:27:16 | ...::to_tokens(...) | -| proc_macro.rs:38:15:38:64 | ...::from(...) | | proc_macro.rs:41:5:49:5 | ...::new(...) | | proc_macro.rs:41:5:49:5 | ...::new(...) | | proc_macro.rs:41:5:49:5 | ...::new(...) | | proc_macro.rs:41:5:49:5 | ...::new(...) | -| proc_macro.rs:42:16:42:26 | ...::to_tokens(...) | | proc_macro.rs:44:27:44:30 | ...::to_tokens(...) | -| proc_macro.rs:46:18:46:28 | ...::to_tokens(...) | multiplePathResolutions | macro_expansion.rs:1:5:1:14 | proc_macro | diff --git a/rust/ql/test/library-tests/dataflow/global/inline-flow.expected b/rust/ql/test/library-tests/dataflow/global/inline-flow.expected index da5840528f5..221e55fc137 100644 --- a/rust/ql/test/library-tests/dataflow/global/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/global/inline-flow.expected @@ -117,6 +117,11 @@ edges | main.rs:228:11:228:14 | [post] self [&ref, MyInt] | main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | provenance | | | main.rs:228:25:228:27 | rhs [MyInt] | main.rs:228:25:228:33 | rhs.value | provenance | | | main.rs:228:25:228:33 | rhs.value | main.rs:228:10:228:14 | [post] * ... [MyInt] | provenance | | +| main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | main.rs:236:12:236:15 | self [&ref, MyInt] | provenance | | +| main.rs:236:9:236:22 | &... [&ref] | main.rs:235:38:237:5 | { ... } [&ref] | provenance | | +| main.rs:236:10:236:22 | ... .value | main.rs:236:9:236:22 | &... [&ref] | provenance | | +| main.rs:236:11:236:15 | * ... [MyInt] | main.rs:236:10:236:22 | ... .value | provenance | | +| main.rs:236:12:236:15 | self [&ref, MyInt] | main.rs:236:11:236:15 | * ... [MyInt] | provenance | | | main.rs:242:9:242:9 | a [MyInt] | main.rs:244:13:244:13 | a [MyInt] | provenance | | | main.rs:242:13:242:38 | MyInt {...} [MyInt] | main.rs:242:9:242:9 | a [MyInt] | provenance | | | main.rs:242:28:242:36 | source(...) | main.rs:242:13:242:38 | MyInt {...} [MyInt] | provenance | | @@ -140,6 +145,15 @@ edges | main.rs:261:35:261:35 | b [MyInt] | main.rs:227:30:227:39 | ...: MyInt [MyInt] | provenance | | | main.rs:261:35:261:35 | b [MyInt] | main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] | provenance | | | main.rs:262:10:262:10 | a [MyInt] | main.rs:262:10:262:16 | a.value | provenance | | +| main.rs:270:9:270:9 | a [MyInt] | main.rs:272:28:272:28 | a [MyInt] | provenance | | +| main.rs:270:13:270:39 | MyInt {...} [MyInt] | main.rs:270:9:270:9 | a [MyInt] | provenance | | +| main.rs:270:28:270:37 | source(...) | main.rs:270:13:270:39 | MyInt {...} [MyInt] | provenance | | +| main.rs:272:9:272:9 | c | main.rs:273:10:273:10 | c | provenance | | +| main.rs:272:13:272:29 | * ... | main.rs:272:9:272:9 | c | provenance | | +| main.rs:272:14:272:29 | ...::deref(...) [&ref] | main.rs:272:13:272:29 | * ... | provenance | | +| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | provenance | | +| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:272:14:272:29 | ...::deref(...) [&ref] | provenance | | +| main.rs:272:28:272:28 | a [MyInt] | main.rs:272:27:272:28 | &a [&ref, MyInt] | provenance | | | main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | provenance | | | main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | provenance | | | main.rs:299:9:299:9 | a [MyInt] | main.rs:301:50:301:50 | a [MyInt] | provenance | | @@ -297,6 +311,12 @@ nodes | main.rs:228:11:228:14 | [post] self [&ref, MyInt] | semmle.label | [post] self [&ref, MyInt] | | main.rs:228:25:228:27 | rhs [MyInt] | semmle.label | rhs [MyInt] | | main.rs:228:25:228:33 | rhs.value | semmle.label | rhs.value | +| main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | semmle.label | SelfParam [&ref, MyInt] | +| main.rs:235:38:237:5 | { ... } [&ref] | semmle.label | { ... } [&ref] | +| main.rs:236:9:236:22 | &... [&ref] | semmle.label | &... [&ref] | +| main.rs:236:10:236:22 | ... .value | semmle.label | ... .value | +| main.rs:236:11:236:15 | * ... [MyInt] | semmle.label | * ... [MyInt] | +| main.rs:236:12:236:15 | self [&ref, MyInt] | semmle.label | self [&ref, MyInt] | | main.rs:242:9:242:9 | a [MyInt] | semmle.label | a [MyInt] | | main.rs:242:13:242:38 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] | | main.rs:242:28:242:36 | source(...) | semmle.label | source(...) | @@ -320,6 +340,15 @@ nodes | main.rs:261:35:261:35 | b [MyInt] | semmle.label | b [MyInt] | | main.rs:262:10:262:10 | a [MyInt] | semmle.label | a [MyInt] | | main.rs:262:10:262:16 | a.value | semmle.label | a.value | +| main.rs:270:9:270:9 | a [MyInt] | semmle.label | a [MyInt] | +| main.rs:270:13:270:39 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] | +| main.rs:270:28:270:37 | source(...) | semmle.label | source(...) | +| main.rs:272:9:272:9 | c | semmle.label | c | +| main.rs:272:13:272:29 | * ... | semmle.label | * ... | +| main.rs:272:14:272:29 | ...::deref(...) [&ref] | semmle.label | ...::deref(...) [&ref] | +| main.rs:272:27:272:28 | &a [&ref, MyInt] | semmle.label | &a [&ref, MyInt] | +| main.rs:272:28:272:28 | a [MyInt] | semmle.label | a [MyInt] | +| main.rs:273:10:273:10 | c | semmle.label | c | | main.rs:289:18:289:21 | SelfParam [MyInt] | semmle.label | SelfParam [MyInt] | | main.rs:289:48:291:5 | { ... } [MyInt] | semmle.label | { ... } [MyInt] | | main.rs:293:26:293:37 | ...: MyInt [MyInt] | semmle.label | ...: MyInt [MyInt] | @@ -367,6 +396,7 @@ subpaths | main.rs:244:13:244:13 | a [MyInt] | main.rs:220:12:220:15 | SelfParam [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | main.rs:244:13:244:17 | ... + ... [MyInt] | | main.rs:252:9:252:9 | a [MyInt] | main.rs:220:12:220:15 | SelfParam [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | main.rs:254:13:254:20 | a.add(...) [MyInt] | | main.rs:261:35:261:35 | b [MyInt] | main.rs:227:30:227:39 | ...: MyInt [MyInt] | main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] | +| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | main.rs:235:38:237:5 | { ... } [&ref] | main.rs:272:14:272:29 | ...::deref(...) [&ref] | | main.rs:301:50:301:50 | a [MyInt] | main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | main.rs:301:30:301:54 | ...::take_self(...) [MyInt] | | main.rs:306:55:306:55 | b [MyInt] | main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | main.rs:306:30:306:56 | ...::take_second(...) [MyInt] | testFailures @@ -393,6 +423,7 @@ testFailures | main.rs:245:10:245:16 | c.value | main.rs:242:28:242:36 | source(...) | main.rs:245:10:245:16 | c.value | $@ | main.rs:242:28:242:36 | source(...) | source(...) | | main.rs:255:10:255:16 | d.value | main.rs:252:28:252:36 | source(...) | main.rs:255:10:255:16 | d.value | $@ | main.rs:252:28:252:36 | source(...) | source(...) | | main.rs:262:10:262:16 | a.value | main.rs:259:28:259:37 | source(...) | main.rs:262:10:262:16 | a.value | $@ | main.rs:259:28:259:37 | source(...) | source(...) | +| main.rs:273:10:273:10 | c | main.rs:270:28:270:37 | source(...) | main.rs:273:10:273:10 | c | $@ | main.rs:270:28:270:37 | source(...) | source(...) | | main.rs:302:10:302:10 | c | main.rs:299:28:299:36 | source(...) | main.rs:302:10:302:10 | c | $@ | main.rs:299:28:299:36 | source(...) | source(...) | | main.rs:307:10:307:10 | c | main.rs:305:28:305:37 | source(...) | main.rs:307:10:307:10 | c | $@ | main.rs:305:28:305:37 | source(...) | source(...) | | main.rs:317:10:317:10 | a | main.rs:316:13:316:21 | source(...) | main.rs:317:10:317:10 | a | $@ | main.rs:316:13:316:21 | source(...) | source(...) | diff --git a/rust/ql/test/library-tests/dataflow/global/main.rs b/rust/ql/test/library-tests/dataflow/global/main.rs index b66ef27726b..e378f16b4de 100644 --- a/rust/ql/test/library-tests/dataflow/global/main.rs +++ b/rust/ql/test/library-tests/dataflow/global/main.rs @@ -270,7 +270,7 @@ fn test_operator_overloading() { let a = MyInt { value: source(27) }; // The line below is what the prefix `*` desugars to. let c = *Deref::deref(&a); - sink(c); // $ MISSING: hasValueFlow=27 + sink(c); // $ hasValueFlow=27 let a = MyInt { value: source(28) }; let c = *a; diff --git a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected index 9c7a9e19141..aab630af29f 100644 --- a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected +++ b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected @@ -77,6 +77,7 @@ | main.rs:266:5:266:10 | ... *= ... | main.rs:227:5:229:5 | fn mul_assign | | main.rs:267:5:267:17 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:270:28:270:37 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:272:14:272:29 | ...::deref(...) | main.rs:235:5:237:5 | fn deref | | main.rs:273:5:273:11 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:275:28:275:37 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:276:13:276:14 | * ... | main.rs:235:5:237:5 | fn deref | diff --git a/rust/ql/test/library-tests/dataflow/local/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/local/CONSISTENCY/PathResolutionConsistency.expected deleted file mode 100644 index 330c8673560..00000000000 --- a/rust/ql/test/library-tests/dataflow/local/CONSISTENCY/PathResolutionConsistency.expected +++ /dev/null @@ -1,3 +0,0 @@ -multipleCallTargets -| main.rs:532:10:532:21 | ...::from(...) | -| main.rs:538:10:538:21 | ...::from(...) | diff --git a/rust/ql/test/library-tests/dataflow/local/main.rs b/rust/ql/test/library-tests/dataflow/local/main.rs index 480154fd0a1..f7349eee6d8 100644 --- a/rust/ql/test/library-tests/dataflow/local/main.rs +++ b/rust/ql/test/library-tests/dataflow/local/main.rs @@ -529,7 +529,7 @@ fn conversions() { sink(a as i64); // $ hasTaintFlow=50 sink(a.into()); // $ MISSING: hasValueFlow=50 - sink(i64::from(a)); // $ hasTaintFlow=50 + sink(i64::from(a)); // $ MISSING: hasTaintFlow=50 -- we cannot resolve the `impl From for T` implementation let b: i32 = source(51) as i32; diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index adaeba79f61..94ccc8ababc 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -32,7 +32,6 @@ multipleCallTargets | test.rs:737:30:737:43 | ...::_print(...) | | test.rs:752:14:752:43 | ...::_print(...) | | test.rs:766:14:766:34 | ...::_print(...) | -| test.rs:777:23:777:80 | ...::try_from(...) | | test.rs:806:50:806:66 | ...::from(...) | | test.rs:806:50:806:66 | ...::from(...) | | test.rs:808:14:808:31 | ...::_print(...) | @@ -74,14 +73,11 @@ multipleCallTargets | test.rs:883:14:883:29 | ...::_print(...) | | test.rs:885:27:885:36 | ...::_print(...) | | test.rs:886:28:886:41 | ...::_print(...) | -| test_futures_io.rs:25:23:25:80 | ...::try_from(...) | | test_futures_io.rs:35:26:35:63 | pinned.poll_read(...) | | test_futures_io.rs:62:22:62:50 | pinned.poll_fill_buf(...) | | test_futures_io.rs:69:23:69:67 | ... .poll_fill_buf(...) | | test_futures_io.rs:93:26:93:63 | pinned.poll_read(...) | | test_futures_io.rs:116:22:116:50 | pinned.poll_fill_buf(...) | | test_futures_io.rs:145:26:145:49 | ...::with_capacity(...) | -| web_frameworks.rs:40:5:40:26 | ...::write_str(...) | -| web_frameworks.rs:40:5:40:26 | ...::write_str(...) | | web_frameworks.rs:101:14:101:23 | a.as_str() | | web_frameworks.rs:102:14:102:25 | a.as_bytes() | diff --git a/rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs b/rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs index 67dce4b21cc..5139568fe51 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs @@ -42,8 +42,8 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> { { // using the `AsyncReadExt::read` extension method (higher-level) let mut buffer1 = [0u8; 64]; - let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader, &mut buffer1).await?; - sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url + let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader, &mut buffer1).await?; // we cannot resolve the `read` call, which comes from `impl AsyncReadExt for R {}` in `async_read_ext.rs` + sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow=url let mut buffer2 = [0u8; 64]; let bytes_read2 = reader.read(&mut buffer2).await?; // we cannot resolve the `read` call, which comes from `impl AsyncReadExt for R {}` in `async_read_ext.rs` @@ -100,8 +100,8 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> { { // using the `AsyncReadExt::read` extension method (higher-level) let mut buffer1 = [0u8; 64]; - let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader2, &mut buffer1).await?; - sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url + let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader2, &mut buffer1).await?; // we cannot resolve the `read` call, which comes from `impl AsyncReadExt for R {}` in `async_read_ext.rs` + sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow=url let mut buffer2 = [0u8; 64]; let bytes_read2 = reader2.read(&mut buffer2).await?; // we cannot resolve the `read` call, which comes from `impl AsyncReadExt for R {}` in `async_read_ext.rs` diff --git a/rust/ql/test/library-tests/path-resolution/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/path-resolution/CONSISTENCY/PathResolutionConsistency.expected index 531fd231507..48d54f1589b 100644 --- a/rust/ql/test/library-tests/path-resolution/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/path-resolution/CONSISTENCY/PathResolutionConsistency.expected @@ -1,9 +1,6 @@ multipleCallTargets | main.rs:118:9:118:11 | f(...) | -| proc_macro.rs:6:16:6:59 | ...::from(...) | -| proc_macro.rs:7:19:7:62 | ...::from(...) | | proc_macro.rs:9:5:11:5 | ...::new(...) | -| proc_macro.rs:10:10:10:12 | ...::to_tokens(...) | multiplePathResolutions | main.rs:626:3:626:12 | proc_macro | | main.rs:632:7:632:16 | proc_macro | diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected index d94235e8e53..9ff363c2b5e 100644 --- a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected @@ -1,13 +1,8 @@ multipleCallTargets | dereference.rs:61:15:61:24 | e1.deref() | -| main.rs:2129:17:2129:35 | ...::my_from(...) | -| main.rs:2130:17:2130:34 | ...::my_from(...) | -| main.rs:2132:9:2132:34 | ...::my_from2(...) | -| main.rs:2133:9:2133:33 | ...::my_from2(...) | | main.rs:2186:13:2186:31 | ...::from(...) | | main.rs:2187:13:2187:31 | ...::from(...) | | main.rs:2188:13:2188:31 | ...::from(...) | | main.rs:2194:13:2194:31 | ...::from(...) | | main.rs:2195:13:2195:31 | ...::from(...) | | main.rs:2196:13:2196:31 | ...::from(...) | -| main.rs:2232:21:2232:43 | ...::from(...) | diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 5d947d41a37..dad278eaddc 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2126,21 +2126,21 @@ mod method_determined_by_argument_type { S(1i64).my_add(3i64); // $ MISSING: method=S::my_add2 S(1i64).my_add(&3i64); // $ method=S::my_add3 - let x = i64::my_from(73i64); // $ method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from - let y = i64::my_from(true); // $ method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from - let z: i64 = MyFrom::my_from(73i64); // $ MISSING: method=MyFrom::my_from $ SPURIOUS: method=MyFrom::my_from - i64::my_from2(73i64, 0i64); // $ method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 - i64::my_from2(true, 0i64); // $ method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 - MyFrom2::my_from2(73i64, 0i64); // $ MISSING: method=MyFrom2::my_from2 $ SPURIOUS: method=MyFrom2::my_from2 + let x = i64::my_from(73i64); // $ method=MyFrom::my_from + let y = i64::my_from(true); // $ method=MyFrom::my_from + let z: i64 = MyFrom::my_from(73i64); // $ method=MyFrom::my_from + i64::my_from2(73i64, 0i64); // $ method=MyFrom2::my_from2 + i64::my_from2(true, 0i64); // $ method=MyFrom2::my_from2 + MyFrom2::my_from2(73i64, 0i64); // $ method=MyFrom2::my_from2 i64::f1(73i64); // $ method=MySelfTrait::f1 i64::f2(73i64); // $ method=MySelfTrait::f2 bool::f1(true); // $ method=MySelfTrait::f1 bool::f2(true); // $ method=MySelfTrait::f2 - MySelfTrait::f1(73i64); // $ SPURIOUS method=MySelfTrait::f1 MISSING: method=MySelfTrait::f1 - MySelfTrait::f2(73i64); // $ SPURIOUS method=MySelfTrait::f2 MISSING: method=MySelfTrait::f2 - MySelfTrait::f1(true); // $ SPURIOUS method=MySelfTrait::f1 MISSING: method=MySelfTrait::f1 - MySelfTrait::f2(true); // $ SPURIOUS method=MySelfTrait::f2 MISSING: method=MySelfTrait::f2 + MySelfTrait::f1(73i64); // $ method=MySelfTrait::f1 + MySelfTrait::f2(73i64); // $ method=MySelfTrait::f2 + MySelfTrait::f1(true); // $ method=MySelfTrait::f1 + MySelfTrait::f2(true); // $ method=MySelfTrait::f2 } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 896b75eec04..d1119f6e71f 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -273,14 +273,11 @@ inferType | main.rs:117:17:117:17 | x | | main.rs:99:5:102:5 | MyThing | | main.rs:117:17:117:32 | x.trait_method() | | {EXTERNAL LOCATION} | bool | | main.rs:119:13:119:13 | y | | main.rs:99:5:102:5 | MyThing | -| main.rs:119:13:119:13 | y | | main.rs:104:5:106:5 | trait MyTrait | | main.rs:119:17:119:40 | MyThing {...} | | main.rs:99:5:102:5 | MyThing | -| main.rs:119:17:119:40 | MyThing {...} | | main.rs:104:5:106:5 | trait MyTrait | | main.rs:119:34:119:38 | false | | {EXTERNAL LOCATION} | bool | | main.rs:120:13:120:13 | b | | {EXTERNAL LOCATION} | bool | | main.rs:120:17:120:40 | ...::trait_method(...) | | {EXTERNAL LOCATION} | bool | | main.rs:120:39:120:39 | y | | main.rs:99:5:102:5 | MyThing | -| main.rs:120:39:120:39 | y | | main.rs:104:5:106:5 | trait MyTrait | | main.rs:137:15:137:18 | SelfParam | | main.rs:125:5:128:5 | MyThing | | main.rs:137:15:137:18 | SelfParam | A | main.rs:130:5:131:14 | S1 | | main.rs:137:27:139:9 | { ... } | | main.rs:130:5:131:14 | S1 | @@ -1988,18 +1985,13 @@ inferType | main.rs:1335:20:1335:24 | &true | | file://:0:0:0:0 | & | | main.rs:1335:20:1335:24 | &true | &T | {EXTERNAL LOCATION} | bool | | main.rs:1335:21:1335:24 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:1339:13:1339:20 | mut flag | | {EXTERNAL LOCATION} | trait Default | | main.rs:1339:13:1339:20 | mut flag | | main.rs:1298:5:1301:5 | MyFlag | -| main.rs:1339:24:1339:41 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | | main.rs:1339:24:1339:41 | ...::default(...) | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1340:22:1340:30 | &mut flag | | file://:0:0:0:0 | & | -| main.rs:1340:22:1340:30 | &mut flag | &T | {EXTERNAL LOCATION} | trait Default | | main.rs:1340:22:1340:30 | &mut flag | &T | main.rs:1298:5:1301:5 | MyFlag | -| main.rs:1340:27:1340:30 | flag | | {EXTERNAL LOCATION} | trait Default | | main.rs:1340:27:1340:30 | flag | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1341:18:1341:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1341:18:1341:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:1341:26:1341:29 | flag | | {EXTERNAL LOCATION} | trait Default | | main.rs:1341:26:1341:29 | flag | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1356:43:1359:5 | { ... } | | {EXTERNAL LOCATION} | Result | | main.rs:1356:43:1359:5 | { ... } | E | main.rs:1348:5:1349:14 | S1 | @@ -2856,9 +2848,7 @@ inferType | main.rs:1799:13:1799:20 | vec2_not | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1799:24:1799:26 | ! ... | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1799:25:1799:26 | v1 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1802:13:1802:24 | default_vec2 | | {EXTERNAL LOCATION} | trait Default | | main.rs:1802:13:1802:24 | default_vec2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1802:28:1802:45 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | | main.rs:1802:28:1802:45 | ...::default(...) | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1803:13:1803:26 | vec2_zero_plus | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1803:30:1803:48 | Vec2 {...} | | main.rs:1443:5:1448:5 | Vec2 | @@ -2867,11 +2857,8 @@ inferType | main.rs:1803:40:1803:40 | 0 | | {EXTERNAL LOCATION} | i64 | | main.rs:1803:46:1803:46 | 0 | | {EXTERNAL LOCATION} | i32 | | main.rs:1803:46:1803:46 | 0 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1803:52:1803:63 | default_vec2 | | {EXTERNAL LOCATION} | trait Default | | main.rs:1803:52:1803:63 | default_vec2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1807:13:1807:24 | default_vec2 | | {EXTERNAL LOCATION} | trait Default | | main.rs:1807:13:1807:24 | default_vec2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1807:28:1807:45 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | | main.rs:1807:28:1807:45 | ...::default(...) | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1808:13:1808:26 | vec2_zero_plus | | {EXTERNAL LOCATION} | bool | | main.rs:1808:30:1808:48 | Vec2 {...} | | main.rs:1443:5:1448:5 | Vec2 | @@ -2880,7 +2867,6 @@ inferType | main.rs:1808:40:1808:40 | 0 | | {EXTERNAL LOCATION} | i64 | | main.rs:1808:46:1808:46 | 0 | | {EXTERNAL LOCATION} | i32 | | main.rs:1808:46:1808:46 | 0 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1808:53:1808:64 | default_vec2 | | {EXTERNAL LOCATION} | trait Default | | main.rs:1808:53:1808:64 | default_vec2 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1818:18:1818:21 | SelfParam | | main.rs:1815:5:1815:14 | S1 | | main.rs:1821:25:1823:5 | { ... } | | main.rs:1815:5:1815:14 | S1 | @@ -3229,28 +3215,19 @@ inferType | main.rs:2127:25:2127:28 | 3i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2129:13:2129:13 | x | | {EXTERNAL LOCATION} | i64 | | main.rs:2129:17:2129:35 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2129:30:2129:34 | 73i64 | | {EXTERNAL LOCATION} | bool | | main.rs:2129:30:2129:34 | 73i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2130:13:2130:13 | y | | {EXTERNAL LOCATION} | i64 | | main.rs:2130:17:2130:34 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | | main.rs:2130:30:2130:33 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:2130:30:2130:33 | true | | {EXTERNAL LOCATION} | i64 | | main.rs:2131:13:2131:13 | z | | {EXTERNAL LOCATION} | i64 | -| main.rs:2131:13:2131:13 | z | | main.rs:2045:5:2048:5 | trait MyFrom | | main.rs:2131:22:2131:43 | ...::my_from(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2131:22:2131:43 | ...::my_from(...) | | main.rs:2045:5:2048:5 | trait MyFrom | -| main.rs:2131:38:2131:42 | 73i64 | | {EXTERNAL LOCATION} | bool | | main.rs:2131:38:2131:42 | 73i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2132:23:2132:27 | 73i64 | | {EXTERNAL LOCATION} | bool | | main.rs:2132:23:2132:27 | 73i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2132:30:2132:33 | 0i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2133:23:2133:26 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:2133:23:2133:26 | true | | {EXTERNAL LOCATION} | i64 | | main.rs:2133:29:2133:32 | 0i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2134:27:2134:31 | 73i64 | | {EXTERNAL LOCATION} | bool | | main.rs:2134:27:2134:31 | 73i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2134:34:2134:37 | 0i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2134:34:2134:37 | 0i64 | | main.rs:2064:5:2067:5 | trait MyFrom2 | | main.rs:2136:9:2136:22 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | | main.rs:2136:17:2136:21 | 73i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:2137:9:2137:22 | ...::f2(...) | | {EXTERNAL LOCATION} | i64 | @@ -3261,18 +3238,12 @@ inferType | main.rs:2139:18:2139:21 | true | | {EXTERNAL LOCATION} | bool | | main.rs:2140:9:2140:30 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | | main.rs:2140:25:2140:29 | 73i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2140:25:2140:29 | 73i64 | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2141:9:2141:30 | ...::f2(...) | | {EXTERNAL LOCATION} | i64 | -| main.rs:2141:9:2141:30 | ...::f2(...) | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2141:25:2141:29 | 73i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:2141:25:2141:29 | 73i64 | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2142:9:2142:29 | ...::f1(...) | | {EXTERNAL LOCATION} | i64 | | main.rs:2142:25:2142:28 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:2142:25:2142:28 | true | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2143:9:2143:29 | ...::f2(...) | | {EXTERNAL LOCATION} | bool | -| main.rs:2143:9:2143:29 | ...::f2(...) | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2143:25:2143:28 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:2143:25:2143:28 | true | | main.rs:2087:5:2093:5 | trait MySelfTrait | | main.rs:2151:26:2153:9 | { ... } | | main.rs:2148:5:2148:24 | MyCallable | | main.rs:2152:13:2152:25 | MyCallable {...} | | main.rs:2148:5:2148:24 | MyCallable | | main.rs:2155:17:2155:21 | SelfParam | | file://:0:0:0:0 | & | @@ -3526,10 +3497,8 @@ inferType | main.rs:2229:32:2229:32 | 3 | | {EXTERNAL LOCATION} | u16 | | main.rs:2232:13:2232:17 | vals5 | | {EXTERNAL LOCATION} | Vec | | main.rs:2232:13:2232:17 | vals5 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2232:13:2232:17 | vals5 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2232:21:2232:43 | ...::from(...) | | {EXTERNAL LOCATION} | Vec | | main.rs:2232:21:2232:43 | ...::from(...) | A | {EXTERNAL LOCATION} | Global | -| main.rs:2232:21:2232:43 | ...::from(...) | T | {EXTERNAL LOCATION} | u8 | | main.rs:2232:31:2232:42 | [...] | | file://:0:0:0:0 | [] | | main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | | main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | @@ -3540,13 +3509,10 @@ inferType | main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | i32 | | main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | u32 | | main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | Vec | -| main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | u8 | | main.rs:2233:13:2233:13 | u | | file://:0:0:0:0 | & | | main.rs:2233:13:2233:13 | u | A | {EXTERNAL LOCATION} | Global | -| main.rs:2233:13:2233:13 | u | T | {EXTERNAL LOCATION} | u8 | | main.rs:2233:18:2233:22 | vals5 | | {EXTERNAL LOCATION} | Vec | | main.rs:2233:18:2233:22 | vals5 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2233:18:2233:22 | vals5 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2235:13:2235:17 | vals6 | | {EXTERNAL LOCATION} | Vec | | main.rs:2235:13:2235:17 | vals6 | A | {EXTERNAL LOCATION} | Global | | main.rs:2235:13:2235:17 | vals6 | T | file://:0:0:0:0 | & | @@ -3693,7 +3659,6 @@ inferType | main.rs:2304:13:2304:14 | x6 | T4 | main.rs:2273:5:2274:14 | S2 | | main.rs:2304:18:2304:45 | S4::<...>(...) | | main.rs:2292:5:2292:27 | S4 | | main.rs:2304:18:2304:45 | S4::<...>(...) | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2304:27:2304:44 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | | main.rs:2304:27:2304:44 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | | main.rs:2305:13:2305:14 | x7 | | main.rs:2292:5:2292:27 | S4 | | main.rs:2305:13:2305:14 | x7 | T4 | main.rs:2273:5:2274:14 | S2 | @@ -3711,12 +3676,9 @@ inferType | main.rs:2307:18:2307:34 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | | main.rs:2307:21:2307:33 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | | main.rs:2308:13:2308:15 | x10 | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2308:13:2308:15 | x10 | T5 | {EXTERNAL LOCATION} | trait Default | | main.rs:2308:13:2308:15 | x10 | T5 | main.rs:2273:5:2274:14 | S2 | | main.rs:2308:19:2311:9 | S5::<...> {...} | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2308:19:2311:9 | S5::<...> {...} | T5 | {EXTERNAL LOCATION} | trait Default | | main.rs:2308:19:2311:9 | S5::<...> {...} | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2310:20:2310:37 | ...::default(...) | | {EXTERNAL LOCATION} | trait Default | | main.rs:2310:20:2310:37 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | | main.rs:2312:13:2312:15 | x11 | | main.rs:2294:5:2296:5 | S5 | | main.rs:2312:13:2312:15 | x11 | T5 | main.rs:2273:5:2274:14 | S2 | diff --git a/rust/ql/test/query-tests/security/CWE-022/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-022/CONSISTENCY/PathResolutionConsistency.expected deleted file mode 100644 index 6ad645852f2..00000000000 --- a/rust/ql/test/query-tests/security/CWE-022/CONSISTENCY/PathResolutionConsistency.expected +++ /dev/null @@ -1,9 +0,0 @@ -multipleCallTargets -| src/main.rs:8:21:8:44 | ...::from(...) | -| src/main.rs:19:21:19:44 | ...::from(...) | -| src/main.rs:25:23:25:59 | ...::from(...) | -| src/main.rs:26:38:26:61 | ...::from(...) | -| src/main.rs:39:23:39:59 | ...::from(...) | -| src/main.rs:40:38:40:61 | ...::from(...) | -| src/main.rs:52:23:52:59 | ...::from(...) | -| src/main.rs:53:38:53:61 | ...::from(...) | diff --git a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected index 60847b71b79..ecc607f7b3d 100644 --- a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected +++ b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected @@ -1,11 +1,11 @@ #select | src/main.rs:10:5:10:22 | ...::read_to_string | src/main.rs:6:11:6:19 | file_name | src/main.rs:10:5:10:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:6:11:6:19 | file_name | user-provided value | edges -| src/main.rs:6:11:6:19 | file_name | src/main.rs:8:35:8:43 | file_name | provenance | | +| src/main.rs:6:11:6:19 | file_name | src/main.rs:8:35:8:53 | file_name as String | provenance | | | src/main.rs:8:9:8:17 | file_path | src/main.rs:10:24:10:32 | file_path | provenance | | -| src/main.rs:8:21:8:44 | ...::from(...) | src/main.rs:8:9:8:17 | file_path | provenance | | -| src/main.rs:8:35:8:43 | file_name | src/main.rs:8:21:8:44 | ...::from(...) | provenance | MaD:2 | -| src/main.rs:8:35:8:43 | file_name | src/main.rs:8:21:8:44 | ...::from(...) | provenance | MaD:2 | +| src/main.rs:8:21:8:54 | ...::from(...) | src/main.rs:8:9:8:17 | file_path | provenance | | +| src/main.rs:8:35:8:53 | file_name as String | src/main.rs:8:21:8:54 | ...::from(...) | provenance | MaD:2 | +| src/main.rs:8:35:8:53 | file_name as String | src/main.rs:8:21:8:54 | ...::from(...) | provenance | MaD:2 | | src/main.rs:10:24:10:32 | file_path | src/main.rs:10:5:10:22 | ...::read_to_string | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: std::fs::read_to_string; Argument[0]; path-injection | @@ -13,8 +13,8 @@ models nodes | src/main.rs:6:11:6:19 | file_name | semmle.label | file_name | | src/main.rs:8:9:8:17 | file_path | semmle.label | file_path | -| src/main.rs:8:21:8:44 | ...::from(...) | semmle.label | ...::from(...) | -| src/main.rs:8:35:8:43 | file_name | semmle.label | file_name | +| src/main.rs:8:21:8:54 | ...::from(...) | semmle.label | ...::from(...) | +| src/main.rs:8:35:8:53 | file_name as String | semmle.label | file_name as String | | src/main.rs:10:5:10:22 | ...::read_to_string | semmle.label | ...::read_to_string | | src/main.rs:10:24:10:32 | file_path | semmle.label | file_path | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-022/src/main.rs b/rust/ql/test/query-tests/security/CWE-022/src/main.rs index 972ac8e7b6a..42ed08e3086 100644 --- a/rust/ql/test/query-tests/security/CWE-022/src/main.rs +++ b/rust/ql/test/query-tests/security/CWE-022/src/main.rs @@ -5,8 +5,8 @@ use std::{fs, path::Path, path::PathBuf}; fn tainted_path_handler_bad( Query(file_name): Query, // $ Source=remote1 ) -> Result { - let file_path = PathBuf::from(file_name); - // BAD: This could read any file on the filesystem. + let file_path = PathBuf::from(file_name as String); // TODO: Remove `as String` when type inference handles patterns + // BAD: This could read any file on the filesystem. fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink Alert[rust/path-injection]=remote1 } From b547dc46215429c1aedce8e043c9a0d5c06583a5 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 12:52:55 +0100 Subject: [PATCH 49/96] C++: Add change note. --- cpp/ql/src/change-notes/2025-07-10-pthread-and-std-thread.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/src/change-notes/2025-07-10-pthread-and-std-thread.md diff --git a/cpp/ql/src/change-notes/2025-07-10-pthread-and-std-thread.md b/cpp/ql/src/change-notes/2025-07-10-pthread-and-std-thread.md new file mode 100644 index 00000000000..8e8d0659fa6 --- /dev/null +++ b/cpp/ql/src/change-notes/2025-07-10-pthread-and-std-thread.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added flow models for `pthread_create` and `std::thread`. \ No newline at end of file From dda4a970806ed9fd83942cf3ce98b42a3cd54a5a Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 13:00:43 +0100 Subject: [PATCH 50/96] Update cpp/ql/test/library-tests/dataflow/external-models/test.cpp Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com> --- cpp/ql/test/library-tests/dataflow/external-models/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index 2e2c9ab41f5..d40ee556a63 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -45,7 +45,7 @@ using pthread_attr_t = void*; void *myThreadFunction(void *arg) { S* s = (S *)arg; - ymlSink(s->x); // $ ir + ymlSink(s->x); // $ ir return nullptr; } From 7ddc909d4edc72f5533c85d6e7b926e3cd2184fd Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 13:29:19 +0100 Subject: [PATCH 51/96] C++: Accept test changes after review. --- .../library-tests/dataflow/external-models/flow.expected | 8 ++++---- .../library-tests/dataflow/external-models/sinks.expected | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index 2db5d6bf1d2..bf306c28a99 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -65,8 +65,8 @@ edges | test.cpp:32:41:32:41 | x | test.cpp:7:47:7:52 | value2 | provenance | | | test.cpp:32:41:32:41 | x | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | | | test.cpp:46:30:46:32 | *arg [x] | test.cpp:47:12:47:19 | *arg [x] | provenance | | -| test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:11:48:11 | *s [x] | provenance | | -| test.cpp:48:11:48:11 | *s [x] | test.cpp:48:14:48:14 | x | provenance | Sink:MaD:1 | +| test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:13:48:13 | *s [x] | provenance | | +| test.cpp:48:13:48:13 | *s [x] | test.cpp:48:16:48:16 | x | provenance | Sink:MaD:1 | | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:23 | | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | test.cpp:46:30:46:32 | *arg [x] | provenance | | | test.cpp:56:2:56:2 | *s [post update] [x] | test.cpp:59:55:59:64 | *& ... [x] | provenance | | @@ -201,8 +201,8 @@ nodes | test.cpp:33:10:33:11 | z2 | semmle.label | z2 | | test.cpp:46:30:46:32 | *arg [x] | semmle.label | *arg [x] | | test.cpp:47:12:47:19 | *arg [x] | semmle.label | *arg [x] | -| test.cpp:48:11:48:11 | *s [x] | semmle.label | *s [x] | -| test.cpp:48:14:48:14 | x | semmle.label | x | +| test.cpp:48:13:48:13 | *s [x] | semmle.label | *s [x] | +| test.cpp:48:16:48:16 | x | semmle.label | x | | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | semmle.label | [summary param] *3 in pthread_create [x] | | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | semmle.label | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | | test.cpp:56:2:56:2 | *s [post update] [x] | semmle.label | *s [post update] [x] | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected index bf84f93fa04..7e5b714765b 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected @@ -8,4 +8,4 @@ | test.cpp:29:10:29:11 | y3 | test-sink | | test.cpp:33:10:33:11 | z2 | test-sink | | test.cpp:36:10:36:11 | z3 | test-sink | -| test.cpp:48:14:48:14 | x | test-sink | +| test.cpp:48:16:48:16 | x | test-sink | From 70476c0e14e7e89372eea3373a3b13ae497295f8 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 10 Jul 2025 14:36:44 +0200 Subject: [PATCH 52/96] Add change note --- .../lib/change-notes/2025-07-10-assoc-func-disambiguation.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rust/ql/lib/change-notes/2025-07-10-assoc-func-disambiguation.md diff --git a/rust/ql/lib/change-notes/2025-07-10-assoc-func-disambiguation.md b/rust/ql/lib/change-notes/2025-07-10-assoc-func-disambiguation.md new file mode 100644 index 00000000000..af3587612e8 --- /dev/null +++ b/rust/ql/lib/change-notes/2025-07-10-assoc-func-disambiguation.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Call resolution for calls to associated functions has been improved, so it now disambiguates the targets based on type information at the call sites (either type information about the arguments or about the expected return types). \ No newline at end of file From 0c075abe3fee768bb258fb04b94aa4ea3f4fa1e8 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:59:10 +0100 Subject: [PATCH 53/96] Rust: Fix merge (I picked the wrong version). --- .../rust/frameworks/stdlib/io.model.yml | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index 0f66ec2a04f..41f1348879f 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -8,32 +8,32 @@ extensions: pack: codeql/rust-all extensible: summaryModel data: - - ["lang:std", "::new", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::fill_buf", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["lang:std", "::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::Read::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::split", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::BufRead::lines", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::chain", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::chain", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["lang:std", "crate::io::Read::take", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::lock", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:std", "::next", "Argument[self]", "ReturnValue.Field[core::option::Option::Some(0)].Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::new", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["::fill_buf", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::Read>::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] + - ["<_ as std::io::BufRead>::split", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::BufRead>::lines", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::chain", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::chain", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["<_ as std::io::Read>::take", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::lock", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::next", "Argument[self]", "ReturnValue.Field[core::option::Option::Some(0)].Field[core::result::Result::Ok(0)]", "taint", "manual"] From 990b7f0b7034ac5cc08bdb0e19d45adc5658d946 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 15:13:15 +0200 Subject: [PATCH 54/96] C++: Add change note --- cpp/ql/src/change-notes/2025-07-10-wchar-fp.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/src/change-notes/2025-07-10-wchar-fp.md diff --git a/cpp/ql/src/change-notes/2025-07-10-wchar-fp.md b/cpp/ql/src/change-notes/2025-07-10-wchar-fp.md new file mode 100644 index 00000000000..db940f18286 --- /dev/null +++ b/cpp/ql/src/change-notes/2025-07-10-wchar-fp.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The `cpp/incorrect-string-type-conversion` query no longer alerts on incorrect type conversions that occur in unreachable code. From b32a8c2489671b9bd23b221eda3ecda54a832f06 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 15:47:23 +0200 Subject: [PATCH 55/96] C++: Add dataflow predicate for checking if a node is the final value of a parameter --- .../cpp/ir/dataflow/internal/DataFlowUtil.qll | 21 ++++++++++++++++++- .../dataflow-tests/has-parameter-flow-out.ql | 9 ++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll index c72614ac5c3..635fe68c308 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll @@ -488,6 +488,25 @@ class Node extends TIRDataFlowNode { result = this.(IndirectParameterNode).getParameter() } + /** + * Holds of this node represents the `indirectionIndex`'th indirection of + * the value of an output parameter `p` just before reaching the end of a function. + */ + predicate isFinalValueOfParameter(Parameter p, int indirectionIndex) { + exists(FinalParameterNode n | n = this | + p = n.getParameter() and + indirectionIndex = n.getIndirectionIndex() + ) + } + + /** + * Holds of this node represents the value of an output parameter `p` + * just before reaching the end of a function. + */ + predicate isFinalValueOfParameter(Parameter p) { + this.isFinalValueOfParameter(p, _) + } + /** * Gets the variable corresponding to this node, if any. This can be used for * modeling flow in and out of global variables. @@ -1225,7 +1244,7 @@ import RawIndirectNodes /** * INTERNAL: do not use. * - * A node representing the value of an update parameter + * A node representing the value of an output parameter * just before reaching the end of a function. */ class FinalParameterNode extends Node, TFinalParameterNode { diff --git a/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql b/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql index 34afffd8e58..8f534be558d 100644 --- a/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql +++ b/cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql @@ -24,10 +24,9 @@ module AstTest { module IRTest { private import semmle.code.cpp.ir.dataflow.DataFlow - private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil private string stars(int k) { - k = [0 .. max(FinalParameterNode n | | n.getIndirectionIndex())] and + k = [0 .. max(DataFlow::Node n, int i | n.isFinalValueOfParameter(_, i) | i)] and (if k = 0 then result = "" else result = "*" + stars(k - 1)) } @@ -35,14 +34,14 @@ module IRTest { string getARelevantTag() { result = "ir-def" } predicate hasActualResult(Location location, string element, string tag, string value) { - exists(Function f, Parameter p, FinalParameterNode n | + exists(Function f, Parameter p, DataFlow::Node n, int i | p.isNamed() and - n.getParameter() = p and + n.isFinalValueOfParameter(p, i) and n.getFunction() = f and location = f.getLocation() and element = p.toString() and tag = "ir-def" and - value = stars(n.getIndirectionIndex()) + p.getName() + value = stars(i) + p.getName() ) } } From 214969feaf02cd44c738d72407c0e04d6ea58300 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 15:52:27 +0200 Subject: [PATCH 56/96] C++: Add change note --- cpp/ql/lib/change-notes/2025-07-10-final.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-07-10-final.md diff --git a/cpp/ql/lib/change-notes/2025-07-10-final.md b/cpp/ql/lib/change-notes/2025-07-10-final.md new file mode 100644 index 00000000000..8e6b3dba266 --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-07-10-final.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added a `isFinalValueOfParameter` predicate to DataFlow::Node which holds when a dataflow node represents the final value of an output parameter of a function. From 96c379a076e92e9793bf2b4c1942672719207ba6 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 10 Jul 2025 15:56:11 +0200 Subject: [PATCH 57/96] C++: Fix formatting and typo --- .../semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll index 635fe68c308..38a4d827a4d 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll @@ -489,7 +489,7 @@ class Node extends TIRDataFlowNode { } /** - * Holds of this node represents the `indirectionIndex`'th indirection of + * Holds if this node represents the `indirectionIndex`'th indirection of * the value of an output parameter `p` just before reaching the end of a function. */ predicate isFinalValueOfParameter(Parameter p, int indirectionIndex) { @@ -500,12 +500,10 @@ class Node extends TIRDataFlowNode { } /** - * Holds of this node represents the value of an output parameter `p` + * Holds if this node represents the value of an output parameter `p` * just before reaching the end of a function. */ - predicate isFinalValueOfParameter(Parameter p) { - this.isFinalValueOfParameter(p, _) - } + predicate isFinalValueOfParameter(Parameter p) { this.isFinalValueOfParameter(p, _) } /** * Gets the variable corresponding to this node, if any. This can be used for From 75078346c0c2f7f4e350a4b598b433d903d0cc60 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:04:41 +0100 Subject: [PATCH 58/96] Rust: Accept .expected changes (mostly renumberings). --- .../dataflow/local/inline-flow.expected | 44 +-- .../dataflow/modeled/inline-flow.expected | 52 +-- .../PathResolutionConsistency.expected | 146 +++++---- .../strings/inline-taint-flow.expected | 38 +-- .../frameworks/rusqlite/Rusqlite.expected | 6 + .../security/CWE-020/RegexInjection.expected | 8 +- .../security/CWE-089/SqlInjection.expected | 44 +-- .../CWE-311/CleartextTransmission.expected | 28 +- .../CWE-312/CleartextLogging.expected | 16 +- .../UncontrolledAllocationSize.expected | 295 +++++++++--------- .../CWE-825/AccessInvalidPointer.expected | 40 ++- 11 files changed, 359 insertions(+), 358 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected index 2ce9725fb38..ba98607e4d7 100644 --- a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected @@ -1,14 +1,14 @@ models -| 1 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 2 | Summary: ::unwrap_or; Argument[0]; ReturnValue; value | -| 3 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 4 | Summary: ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 5 | Summary: ::unwrap_or_else; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 6 | Summary: ::err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 7 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 8 | Summary: ::expect_err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue; value | -| 9 | Summary: ::ok; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 10 | Summary: lang:alloc; ::new; Argument[0]; ReturnValue.Reference; value | +| 1 | Summary: ::new; Argument[0]; ReturnValue.Reference; value | +| 2 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 3 | Summary: ::unwrap_or; Argument[0]; ReturnValue; value | +| 4 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 5 | Summary: ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 6 | Summary: ::unwrap_or_else; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 7 | Summary: ::err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 8 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 9 | Summary: ::expect_err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue; value | +| 10 | Summary: ::ok; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | edges | main.rs:22:9:22:9 | s | main.rs:23:10:23:10 | s | provenance | | | main.rs:22:13:22:21 | source(...) | main.rs:22:9:22:9 | s | provenance | | @@ -24,7 +24,7 @@ edges | main.rs:56:9:56:17 | source(...) | main.rs:56:5:56:5 | i | provenance | | | main.rs:89:9:89:9 | i [&ref] | main.rs:90:11:90:11 | i [&ref] | provenance | | | main.rs:89:13:89:31 | ...::new(...) [&ref] | main.rs:89:9:89:9 | i [&ref] | provenance | | -| main.rs:89:22:89:30 | source(...) | main.rs:89:13:89:31 | ...::new(...) [&ref] | provenance | MaD:10 | +| main.rs:89:22:89:30 | source(...) | main.rs:89:13:89:31 | ...::new(...) [&ref] | provenance | MaD:1 | | main.rs:90:11:90:11 | i [&ref] | main.rs:90:10:90:11 | * ... | provenance | | | main.rs:97:9:97:9 | a [tuple.0] | main.rs:98:10:98:10 | a [tuple.0] | provenance | | | main.rs:97:13:97:26 | TupleExpr [tuple.0] | main.rs:97:9:97:9 | a [tuple.0] | provenance | | @@ -99,32 +99,32 @@ edges | main.rs:229:11:229:12 | s1 [Some] | main.rs:230:9:230:15 | Some(...) [Some] | provenance | | | main.rs:230:9:230:15 | Some(...) [Some] | main.rs:230:14:230:14 | n | provenance | | | main.rs:230:14:230:14 | n | main.rs:230:25:230:25 | n | provenance | | -| main.rs:240:9:240:10 | s1 [Some] | main.rs:241:10:241:20 | s1.unwrap() | provenance | MaD:1 | +| main.rs:240:9:240:10 | s1 [Some] | main.rs:241:10:241:20 | s1.unwrap() | provenance | MaD:2 | | main.rs:240:14:240:29 | Some(...) [Some] | main.rs:240:9:240:10 | s1 [Some] | provenance | | | main.rs:240:19:240:28 | source(...) | main.rs:240:14:240:29 | Some(...) [Some] | provenance | | -| main.rs:245:9:245:10 | s1 [Some] | main.rs:246:10:246:24 | s1.unwrap_or(...) | provenance | MaD:3 | +| main.rs:245:9:245:10 | s1 [Some] | main.rs:246:10:246:24 | s1.unwrap_or(...) | provenance | MaD:4 | | main.rs:245:14:245:29 | Some(...) [Some] | main.rs:245:9:245:10 | s1 [Some] | provenance | | | main.rs:245:19:245:28 | source(...) | main.rs:245:14:245:29 | Some(...) [Some] | provenance | | -| main.rs:249:23:249:32 | source(...) | main.rs:249:10:249:33 | s2.unwrap_or(...) | provenance | MaD:2 | -| main.rs:253:9:253:10 | s1 [Some] | main.rs:254:10:254:32 | s1.unwrap_or_else(...) | provenance | MaD:5 | +| main.rs:249:23:249:32 | source(...) | main.rs:249:10:249:33 | s2.unwrap_or(...) | provenance | MaD:3 | +| main.rs:253:9:253:10 | s1 [Some] | main.rs:254:10:254:32 | s1.unwrap_or_else(...) | provenance | MaD:6 | | main.rs:253:14:253:29 | Some(...) [Some] | main.rs:253:9:253:10 | s1 [Some] | provenance | | | main.rs:253:19:253:28 | source(...) | main.rs:253:14:253:29 | Some(...) [Some] | provenance | | -| main.rs:257:31:257:40 | source(...) | main.rs:257:10:257:41 | s2.unwrap_or_else(...) | provenance | MaD:4 | +| main.rs:257:31:257:40 | source(...) | main.rs:257:10:257:41 | s2.unwrap_or_else(...) | provenance | MaD:5 | | main.rs:261:9:261:10 | s1 [Some] | main.rs:263:14:263:15 | s1 [Some] | provenance | | | main.rs:261:14:261:29 | Some(...) [Some] | main.rs:261:9:261:10 | s1 [Some] | provenance | | | main.rs:261:19:261:28 | source(...) | main.rs:261:14:261:29 | Some(...) [Some] | provenance | | | main.rs:263:9:263:10 | i1 | main.rs:264:10:264:11 | i1 | provenance | | | main.rs:263:14:263:15 | s1 [Some] | main.rs:263:14:263:16 | TryExpr | provenance | | | main.rs:263:14:263:16 | TryExpr | main.rs:263:9:263:10 | i1 | provenance | | -| main.rs:270:9:270:10 | r1 [Ok] | main.rs:271:28:271:34 | r1.ok() [Some] | provenance | MaD:9 | +| main.rs:270:9:270:10 | r1 [Ok] | main.rs:271:28:271:34 | r1.ok() [Some] | provenance | MaD:10 | | main.rs:270:32:270:45 | Ok(...) [Ok] | main.rs:270:9:270:10 | r1 [Ok] | provenance | | | main.rs:270:35:270:44 | source(...) | main.rs:270:32:270:45 | Ok(...) [Ok] | provenance | | -| main.rs:271:9:271:11 | o1a [Some] | main.rs:273:10:273:21 | o1a.unwrap() | provenance | MaD:1 | +| main.rs:271:9:271:11 | o1a [Some] | main.rs:273:10:273:21 | o1a.unwrap() | provenance | MaD:2 | | main.rs:271:28:271:34 | r1.ok() [Some] | main.rs:271:9:271:11 | o1a [Some] | provenance | | -| main.rs:276:9:276:10 | r2 [Err] | main.rs:278:28:278:35 | r2.err() [Some] | provenance | MaD:6 | +| main.rs:276:9:276:10 | r2 [Err] | main.rs:278:28:278:35 | r2.err() [Some] | provenance | MaD:7 | | main.rs:276:32:276:46 | Err(...) [Err] | main.rs:276:9:276:10 | r2 [Err] | provenance | | | main.rs:276:36:276:45 | source(...) | main.rs:276:32:276:46 | Err(...) [Err] | provenance | | -| main.rs:278:9:278:11 | o2b [Some] | main.rs:280:10:280:21 | o2b.unwrap() | provenance | MaD:1 | +| main.rs:278:9:278:11 | o2b [Some] | main.rs:280:10:280:21 | o2b.unwrap() | provenance | MaD:2 | | main.rs:278:28:278:35 | r2.err() [Some] | main.rs:278:9:278:11 | o2b [Some] | provenance | | | main.rs:284:9:284:10 | s1 [Ok] | main.rs:287:14:287:15 | s1 [Ok] | provenance | | | main.rs:284:32:284:45 | Ok(...) [Ok] | main.rs:284:9:284:10 | s1 [Ok] | provenance | | @@ -132,10 +132,10 @@ edges | main.rs:287:9:287:10 | i1 | main.rs:289:10:289:11 | i1 | provenance | | | main.rs:287:14:287:15 | s1 [Ok] | main.rs:287:14:287:16 | TryExpr | provenance | | | main.rs:287:14:287:16 | TryExpr | main.rs:287:9:287:10 | i1 | provenance | | -| main.rs:297:9:297:10 | s1 [Ok] | main.rs:298:10:298:22 | s1.expect(...) | provenance | MaD:7 | +| main.rs:297:9:297:10 | s1 [Ok] | main.rs:298:10:298:22 | s1.expect(...) | provenance | MaD:8 | | main.rs:297:32:297:45 | Ok(...) [Ok] | main.rs:297:9:297:10 | s1 [Ok] | provenance | | | main.rs:297:35:297:44 | source(...) | main.rs:297:32:297:45 | Ok(...) [Ok] | provenance | | -| main.rs:301:9:301:10 | s2 [Err] | main.rs:303:10:303:26 | s2.expect_err(...) | provenance | MaD:8 | +| main.rs:301:9:301:10 | s2 [Err] | main.rs:303:10:303:26 | s2.expect_err(...) | provenance | MaD:9 | | main.rs:301:32:301:46 | Err(...) [Err] | main.rs:301:9:301:10 | s2 [Err] | provenance | | | main.rs:301:36:301:45 | source(...) | main.rs:301:32:301:46 | Err(...) [Err] | provenance | | | main.rs:312:9:312:10 | s1 [A] | main.rs:314:11:314:12 | s1 [A] | provenance | | diff --git a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected index cce06005edc..c9415f5adab 100644 --- a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected @@ -1,37 +1,37 @@ models -| 1 | Summary: ::clone; Argument[self].Reference; ReturnValue; value | -| 2 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 3 | Summary: ::zip; Argument[0].Field[core::option::Option::Some(0)]; ReturnValue.Field[core::option::Option::Some(0)].Field[1]; value | -| 4 | Summary: ::into_inner; Argument[0].Field[core::pin::Pin::__pointer]; ReturnValue; value | -| 5 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::__pointer]; value | -| 6 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 7 | Summary: lang:alloc; ::into_pin; Argument[0]; ReturnValue; value | -| 8 | Summary: lang:alloc; ::new; Argument[0]; ReturnValue.Reference; value | -| 9 | Summary: lang:alloc; ::pin; Argument[0]; ReturnValue.Reference; value | -| 10 | Summary: lang:core; ::into_inner; Argument[0]; ReturnValue; value | -| 11 | Summary: lang:core; ::new; Argument[0]; ReturnValue; value | -| 12 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 13 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | +| 1 | Summary: ::into_pin; Argument[0]; ReturnValue; value | +| 2 | Summary: ::new; Argument[0]; ReturnValue.Reference; value | +| 3 | Summary: ::pin; Argument[0]; ReturnValue.Reference; value | +| 4 | Summary: ::clone; Argument[self].Reference; ReturnValue; value | +| 5 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 6 | Summary: ::zip; Argument[0].Field[core::option::Option::Some(0)]; ReturnValue.Field[core::option::Option::Some(0)].Field[1]; value | +| 7 | Summary: ::into_inner; Argument[0].Field[core::pin::Pin::__pointer]; ReturnValue; value | +| 8 | Summary: ::into_inner; Argument[0]; ReturnValue; value | +| 9 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::__pointer]; value | +| 10 | Summary: ::new; Argument[0]; ReturnValue; value | +| 11 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 12 | Summary: core::ptr::read; Argument[0].Reference; ReturnValue; value | +| 13 | Summary: core::ptr::write; Argument[1]; Argument[0].Reference; value | edges -| main.rs:12:9:12:9 | a [Some] | main.rs:13:10:13:19 | a.unwrap() | provenance | MaD:2 | +| main.rs:12:9:12:9 | a [Some] | main.rs:13:10:13:19 | a.unwrap() | provenance | MaD:5 | | main.rs:12:9:12:9 | a [Some] | main.rs:14:13:14:13 | a [Some] | provenance | | | main.rs:12:13:12:28 | Some(...) [Some] | main.rs:12:9:12:9 | a [Some] | provenance | | | main.rs:12:18:12:27 | source(...) | main.rs:12:13:12:28 | Some(...) [Some] | provenance | | -| main.rs:14:9:14:9 | b [Some] | main.rs:15:10:15:19 | b.unwrap() | provenance | MaD:2 | +| main.rs:14:9:14:9 | b [Some] | main.rs:15:10:15:19 | b.unwrap() | provenance | MaD:5 | | main.rs:14:13:14:13 | a [Some] | main.rs:14:13:14:21 | a.clone() [Some] | provenance | generated | | main.rs:14:13:14:21 | a.clone() [Some] | main.rs:14:9:14:9 | b [Some] | provenance | | -| main.rs:19:9:19:9 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:6 | +| main.rs:19:9:19:9 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:11 | | main.rs:19:9:19:9 | a [Ok] | main.rs:21:13:21:13 | a [Ok] | provenance | | | main.rs:19:31:19:44 | Ok(...) [Ok] | main.rs:19:9:19:9 | a [Ok] | provenance | | | main.rs:19:34:19:43 | source(...) | main.rs:19:31:19:44 | Ok(...) [Ok] | provenance | | -| main.rs:21:9:21:9 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:6 | +| main.rs:21:9:21:9 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:11 | | main.rs:21:13:21:13 | a [Ok] | main.rs:21:13:21:21 | a.clone() [Ok] | provenance | generated | | main.rs:21:13:21:21 | a.clone() [Ok] | main.rs:21:9:21:9 | b [Ok] | provenance | | | main.rs:26:9:26:9 | a | main.rs:27:10:27:10 | a | provenance | | | main.rs:26:9:26:9 | a | main.rs:28:13:28:13 | a | provenance | | | main.rs:26:13:26:22 | source(...) | main.rs:26:9:26:9 | a | provenance | | | main.rs:28:9:28:9 | b | main.rs:29:10:29:10 | b | provenance | | -| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:1 | +| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:4 | | main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | generated | | main.rs:28:13:28:21 | a.clone() | main.rs:28:9:28:9 | b | provenance | | | main.rs:43:18:43:22 | SelfParam [Wrapper] | main.rs:44:26:44:29 | self [Wrapper] | provenance | | @@ -58,7 +58,7 @@ edges | main.rs:66:22:66:31 | source(...) | main.rs:66:17:66:32 | Some(...) [Some] | provenance | | | main.rs:67:13:67:13 | z [Some, tuple.1] | main.rs:68:15:68:15 | z [Some, tuple.1] | provenance | | | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | main.rs:67:13:67:13 | z [Some, tuple.1] | provenance | | -| main.rs:67:23:67:23 | b [Some] | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | provenance | MaD:3 | +| main.rs:67:23:67:23 | b [Some] | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | provenance | MaD:6 | | main.rs:68:15:68:15 | z [Some, tuple.1] | main.rs:69:13:69:24 | Some(...) [Some, tuple.1] | provenance | | | main.rs:69:13:69:24 | Some(...) [Some, tuple.1] | main.rs:69:18:69:23 | TuplePat [tuple.1] | provenance | | | main.rs:69:18:69:23 | TuplePat [tuple.1] | main.rs:69:22:69:22 | m | provenance | | @@ -76,20 +76,20 @@ edges | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | main.rs:115:31:115:34 | pin1 [Pin, &ref] | provenance | | | main.rs:109:24:109:35 | ...::new(...) [&ref] | main.rs:109:13:109:20 | mut pin1 [&ref] | provenance | | | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | provenance | | -| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [&ref] | provenance | MaD:11 | -| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:5 | +| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [&ref] | provenance | MaD:10 | +| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:9 | | main.rs:109:34:109:34 | i | main.rs:109:33:109:34 | &i [&ref] | provenance | | | main.rs:110:13:110:20 | mut pin2 [&ref] | main.rs:116:15:116:18 | pin2 [&ref] | provenance | | | main.rs:110:24:110:34 | ...::pin(...) [&ref] | main.rs:110:13:110:20 | mut pin2 [&ref] | provenance | | -| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [&ref] | provenance | MaD:9 | +| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [&ref] | provenance | MaD:3 | | main.rs:111:13:111:20 | mut pin3 [&ref] | main.rs:117:15:117:18 | pin3 [&ref] | provenance | | | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | main.rs:111:13:111:20 | mut pin3 [&ref] | provenance | | -| main.rs:111:38:111:48 | ...::new(...) [&ref] | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | provenance | MaD:7 | -| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [&ref] | provenance | MaD:8 | +| main.rs:111:38:111:48 | ...::new(...) [&ref] | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | provenance | MaD:1 | +| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [&ref] | provenance | MaD:2 | | main.rs:114:15:114:18 | pin1 [&ref] | main.rs:114:14:114:18 | * ... | provenance | | | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | main.rs:115:14:115:35 | * ... | provenance | | -| main.rs:115:31:115:34 | pin1 [&ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:10 | -| main.rs:115:31:115:34 | pin1 [Pin, &ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:4 | +| main.rs:115:31:115:34 | pin1 [&ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:8 | +| main.rs:115:31:115:34 | pin1 [Pin, &ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:7 | | main.rs:116:15:116:18 | pin2 [&ref] | main.rs:116:14:116:18 | * ... | provenance | | | main.rs:117:15:117:18 | pin3 [&ref] | main.rs:117:14:117:18 | * ... | provenance | | | main.rs:122:13:122:18 | mut ms [MyStruct] | main.rs:127:14:127:15 | ms [MyStruct] | provenance | | diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index adaeba79f61..a0ab407feb6 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -1,79 +1,77 @@ multipleCallTargets | test.rs:98:14:98:43 | ...::_print(...) | -| test.rs:109:14:109:33 | ...::_print(...) | -| test.rs:112:62:112:77 | ...::from(...) | -| test.rs:119:58:119:73 | ...::from(...) | -| test.rs:135:22:135:43 | ...::_print(...) | -| test.rs:140:22:140:43 | ...::_print(...) | -| test.rs:144:22:144:44 | ...::_print(...) | -| test.rs:160:26:160:110 | ...::_print(...) | -| test.rs:168:26:168:111 | ...::_print(...) | -| test.rs:178:30:178:68 | ...::_print(...) | -| test.rs:187:26:187:105 | ...::_print(...) | -| test.rs:228:22:228:72 | ... .read_to_string(...) | -| test.rs:482:22:482:50 | file.read_to_end(...) | -| test.rs:488:22:488:53 | file.read_to_string(...) | -| test.rs:609:18:609:38 | ...::_print(...) | -| test.rs:614:18:614:45 | ...::_print(...) | -| test.rs:618:25:618:49 | address.to_socket_addrs() | -| test.rs:632:38:632:42 | ...::_print(...) | -| test.rs:636:38:636:54 | ...::_print(...) | -| test.rs:641:38:641:51 | ...::_print(...) | -| test.rs:651:34:651:52 | ...::_print(...) | -| test.rs:670:14:670:43 | ...::_print(...) | -| test.rs:685:18:685:42 | ...::_print(...) | -| test.rs:689:18:689:42 | ...::_print(...) | -| test.rs:694:18:694:45 | ...::_print(...) | -| test.rs:701:30:701:34 | ...::_print(...) | -| test.rs:705:30:705:52 | ...::_print(...) | -| test.rs:714:30:714:43 | ...::_print(...) | -| test.rs:724:30:724:34 | ...::_print(...) | -| test.rs:728:30:728:52 | ...::_print(...) | -| test.rs:737:30:737:43 | ...::_print(...) | -| test.rs:752:14:752:43 | ...::_print(...) | -| test.rs:766:14:766:34 | ...::_print(...) | -| test.rs:777:23:777:80 | ...::try_from(...) | -| test.rs:806:50:806:66 | ...::from(...) | -| test.rs:806:50:806:66 | ...::from(...) | -| test.rs:808:14:808:31 | ...::_print(...) | -| test.rs:811:14:811:31 | ...::_print(...) | -| test.rs:814:14:814:31 | ...::_print(...) | -| test.rs:817:14:817:30 | ...::_print(...) | -| test.rs:819:27:819:36 | ...::_print(...) | -| test.rs:820:28:820:41 | ...::_print(...) | -| test.rs:823:14:823:33 | ...::_print(...) | -| test.rs:825:27:825:36 | ...::_print(...) | -| test.rs:826:28:826:41 | ...::_print(...) | -| test.rs:829:14:829:31 | ...::_print(...) | -| test.rs:831:27:831:36 | ...::_print(...) | -| test.rs:832:28:832:41 | ...::_print(...) | -| test.rs:835:14:835:34 | ...::_print(...) | -| test.rs:837:27:837:36 | ...::_print(...) | -| test.rs:838:28:838:41 | ...::_print(...) | -| test.rs:841:14:841:25 | ...::_print(...) | -| test.rs:843:27:843:36 | ...::_print(...) | -| test.rs:844:28:844:41 | ...::_print(...) | -| test.rs:847:14:847:31 | ...::_print(...) | -| test.rs:849:27:849:36 | ...::_print(...) | -| test.rs:850:28:850:41 | ...::_print(...) | -| test.rs:853:14:853:30 | ...::_print(...) | -| test.rs:855:27:855:36 | ...::_print(...) | -| test.rs:856:28:856:41 | ...::_print(...) | -| test.rs:859:14:859:33 | ...::_print(...) | -| test.rs:861:27:861:36 | ...::_print(...) | -| test.rs:862:28:862:41 | ...::_print(...) | -| test.rs:865:14:865:36 | ...::_print(...) | -| test.rs:867:27:867:36 | ...::_print(...) | -| test.rs:868:28:868:41 | ...::_print(...) | -| test.rs:871:14:871:38 | ...::_print(...) | -| test.rs:873:27:873:36 | ...::_print(...) | -| test.rs:874:28:874:41 | ...::_print(...) | -| test.rs:877:14:877:45 | ...::_print(...) | -| test.rs:879:27:879:36 | ...::_print(...) | -| test.rs:880:28:880:41 | ...::_print(...) | -| test.rs:883:14:883:29 | ...::_print(...) | -| test.rs:885:27:885:36 | ...::_print(...) | -| test.rs:886:28:886:41 | ...::_print(...) | +| test.rs:110:14:110:33 | ...::_print(...) | +| test.rs:113:62:113:77 | ...::from(...) | +| test.rs:120:58:120:73 | ...::from(...) | +| test.rs:136:22:136:43 | ...::_print(...) | +| test.rs:141:22:141:43 | ...::_print(...) | +| test.rs:145:22:145:44 | ...::_print(...) | +| test.rs:161:26:161:110 | ...::_print(...) | +| test.rs:169:26:169:111 | ...::_print(...) | +| test.rs:179:30:179:68 | ...::_print(...) | +| test.rs:188:26:188:105 | ...::_print(...) | +| test.rs:229:22:229:72 | ... .read_to_string(...) | +| test.rs:610:18:610:38 | ...::_print(...) | +| test.rs:615:18:615:45 | ...::_print(...) | +| test.rs:619:25:619:49 | address.to_socket_addrs() | +| test.rs:633:38:633:42 | ...::_print(...) | +| test.rs:637:38:637:54 | ...::_print(...) | +| test.rs:642:38:642:51 | ...::_print(...) | +| test.rs:652:34:652:52 | ...::_print(...) | +| test.rs:671:14:671:43 | ...::_print(...) | +| test.rs:686:18:686:42 | ...::_print(...) | +| test.rs:690:18:690:42 | ...::_print(...) | +| test.rs:695:18:695:45 | ...::_print(...) | +| test.rs:702:30:702:34 | ...::_print(...) | +| test.rs:706:30:706:52 | ...::_print(...) | +| test.rs:715:30:715:43 | ...::_print(...) | +| test.rs:725:30:725:34 | ...::_print(...) | +| test.rs:729:30:729:52 | ...::_print(...) | +| test.rs:738:30:738:43 | ...::_print(...) | +| test.rs:753:14:753:43 | ...::_print(...) | +| test.rs:767:14:767:34 | ...::_print(...) | +| test.rs:778:23:778:80 | ...::try_from(...) | +| test.rs:807:50:807:66 | ...::from(...) | +| test.rs:807:50:807:66 | ...::from(...) | +| test.rs:809:14:809:31 | ...::_print(...) | +| test.rs:812:14:812:31 | ...::_print(...) | +| test.rs:815:14:815:31 | ...::_print(...) | +| test.rs:818:14:818:30 | ...::_print(...) | +| test.rs:820:27:820:36 | ...::_print(...) | +| test.rs:821:28:821:41 | ...::_print(...) | +| test.rs:824:14:824:33 | ...::_print(...) | +| test.rs:826:27:826:36 | ...::_print(...) | +| test.rs:827:28:827:41 | ...::_print(...) | +| test.rs:830:14:830:31 | ...::_print(...) | +| test.rs:832:27:832:36 | ...::_print(...) | +| test.rs:833:28:833:41 | ...::_print(...) | +| test.rs:836:14:836:34 | ...::_print(...) | +| test.rs:838:27:838:36 | ...::_print(...) | +| test.rs:839:28:839:41 | ...::_print(...) | +| test.rs:842:14:842:25 | ...::_print(...) | +| test.rs:844:27:844:36 | ...::_print(...) | +| test.rs:845:28:845:41 | ...::_print(...) | +| test.rs:848:14:848:31 | ...::_print(...) | +| test.rs:850:27:850:36 | ...::_print(...) | +| test.rs:851:28:851:41 | ...::_print(...) | +| test.rs:854:14:854:30 | ...::_print(...) | +| test.rs:856:27:856:36 | ...::_print(...) | +| test.rs:857:28:857:41 | ...::_print(...) | +| test.rs:860:14:860:33 | ...::_print(...) | +| test.rs:862:27:862:36 | ...::_print(...) | +| test.rs:863:28:863:41 | ...::_print(...) | +| test.rs:866:14:866:36 | ...::_print(...) | +| test.rs:868:27:868:36 | ...::_print(...) | +| test.rs:869:28:869:41 | ...::_print(...) | +| test.rs:872:14:872:38 | ...::_print(...) | +| test.rs:874:27:874:36 | ...::_print(...) | +| test.rs:875:28:875:41 | ...::_print(...) | +| test.rs:878:14:878:45 | ...::_print(...) | +| test.rs:880:27:880:36 | ...::_print(...) | +| test.rs:881:28:881:41 | ...::_print(...) | +| test.rs:884:14:884:29 | ...::_print(...) | +| test.rs:886:27:886:36 | ...::_print(...) | +| test.rs:887:28:887:41 | ...::_print(...) | | test_futures_io.rs:25:23:25:80 | ...::try_from(...) | | test_futures_io.rs:35:26:35:63 | pinned.poll_read(...) | | test_futures_io.rs:62:22:62:50 | pinned.poll_fill_buf(...) | diff --git a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected index cd15c991628..a58a013816d 100644 --- a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected +++ b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected @@ -1,10 +1,10 @@ models -| 1 | Summary: ::add; Argument[self]; ReturnValue; value | -| 2 | Summary: ::as_str; Argument[self]; ReturnValue; value | -| 3 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | -| 4 | Summary: lang:alloc; ::from; Argument[0]; ReturnValue; value | -| 5 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | -| 6 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 1 | Summary: ::from; Argument[0]; ReturnValue; value | +| 2 | Summary: ::add; Argument[self]; ReturnValue; value | +| 3 | Summary: ::as_str; Argument[self]; ReturnValue; value | +| 4 | Summary: ::as_str; Argument[self]; ReturnValue; value | +| 5 | Summary: alloc::fmt::format; Argument[0]; ReturnValue; taint | +| 6 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | edges | main.rs:26:9:26:9 | s | main.rs:27:19:27:25 | s[...] | provenance | | | main.rs:26:13:26:22 | source(...) | main.rs:26:9:26:9 | s | provenance | | @@ -15,46 +15,46 @@ edges | main.rs:32:9:32:10 | s1 | main.rs:35:14:35:15 | s1 | provenance | | | main.rs:32:14:32:23 | source(...) | main.rs:32:9:32:10 | s1 | provenance | | | main.rs:35:9:35:10 | s4 | main.rs:38:10:38:11 | s4 | provenance | | -| main.rs:35:14:35:15 | s1 | main.rs:35:14:35:20 | ... + ... | provenance | MaD:1 | +| main.rs:35:14:35:15 | s1 | main.rs:35:14:35:20 | ... + ... | provenance | MaD:2 | | main.rs:35:14:35:20 | ... + ... | main.rs:35:9:35:10 | s4 | provenance | | | main.rs:51:9:51:10 | s1 | main.rs:52:27:52:28 | s1 | provenance | | | main.rs:51:14:51:29 | source_slice(...) | main.rs:51:9:51:10 | s1 | provenance | | | main.rs:52:9:52:10 | s2 | main.rs:53:10:53:11 | s2 | provenance | | | main.rs:52:14:52:29 | ...::from(...) | main.rs:52:9:52:10 | s2 | provenance | | -| main.rs:52:27:52:28 | s1 | main.rs:52:14:52:29 | ...::from(...) | provenance | MaD:4 | +| main.rs:52:27:52:28 | s1 | main.rs:52:14:52:29 | ...::from(...) | provenance | MaD:1 | | main.rs:63:9:63:9 | s | main.rs:64:16:64:16 | s | provenance | | -| main.rs:63:9:63:9 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:2 | -| main.rs:63:9:63:9 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:5 | +| main.rs:63:9:63:9 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:3 | +| main.rs:63:9:63:9 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:4 | | main.rs:63:13:63:22 | source(...) | main.rs:63:9:63:9 | s | provenance | | -| main.rs:64:16:64:16 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:2 | -| main.rs:64:16:64:16 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:5 | +| main.rs:64:16:64:16 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:3 | +| main.rs:64:16:64:16 | s | main.rs:64:16:64:25 | s.as_str() | provenance | MaD:4 | | main.rs:68:9:68:9 | s | main.rs:70:34:70:61 | MacroExpr | provenance | | | main.rs:68:9:68:9 | s | main.rs:73:34:73:59 | MacroExpr | provenance | | | main.rs:68:13:68:22 | source(...) | main.rs:68:9:68:9 | s | provenance | | | main.rs:70:9:70:18 | formatted1 | main.rs:71:10:71:19 | formatted1 | provenance | | | main.rs:70:22:70:62 | ...::format(...) | main.rs:70:9:70:18 | formatted1 | provenance | | -| main.rs:70:34:70:61 | MacroExpr | main.rs:70:22:70:62 | ...::format(...) | provenance | MaD:6 | +| main.rs:70:34:70:61 | MacroExpr | main.rs:70:22:70:62 | ...::format(...) | provenance | MaD:5 | | main.rs:73:9:73:18 | formatted2 | main.rs:74:10:74:19 | formatted2 | provenance | | | main.rs:73:22:73:60 | ...::format(...) | main.rs:73:9:73:18 | formatted2 | provenance | | -| main.rs:73:34:73:59 | MacroExpr | main.rs:73:22:73:60 | ...::format(...) | provenance | MaD:6 | +| main.rs:73:34:73:59 | MacroExpr | main.rs:73:22:73:60 | ...::format(...) | provenance | MaD:5 | | main.rs:76:9:76:13 | width | main.rs:77:34:77:74 | MacroExpr | provenance | | | main.rs:76:17:76:32 | source_usize(...) | main.rs:76:9:76:13 | width | provenance | | | main.rs:77:9:77:18 | formatted3 | main.rs:78:10:78:19 | formatted3 | provenance | | | main.rs:77:22:77:75 | ...::format(...) | main.rs:77:9:77:18 | formatted3 | provenance | | -| main.rs:77:34:77:74 | MacroExpr | main.rs:77:22:77:75 | ...::format(...) | provenance | MaD:6 | +| main.rs:77:34:77:74 | MacroExpr | main.rs:77:22:77:75 | ...::format(...) | provenance | MaD:5 | | main.rs:82:9:82:10 | s1 | main.rs:86:18:86:25 | MacroExpr | provenance | | | main.rs:82:9:82:10 | s1 | main.rs:87:18:87:32 | MacroExpr | provenance | | | main.rs:82:14:82:23 | source(...) | main.rs:82:9:82:10 | s1 | provenance | | | main.rs:86:10:86:26 | res | main.rs:86:18:86:25 | { ... } | provenance | | | main.rs:86:18:86:25 | ...::format(...) | main.rs:86:10:86:26 | res | provenance | | | main.rs:86:18:86:25 | ...::must_use(...) | main.rs:86:10:86:26 | MacroExpr | provenance | | -| main.rs:86:18:86:25 | MacroExpr | main.rs:86:18:86:25 | ...::format(...) | provenance | MaD:6 | -| main.rs:86:18:86:25 | { ... } | main.rs:86:18:86:25 | ...::must_use(...) | provenance | MaD:3 | +| main.rs:86:18:86:25 | MacroExpr | main.rs:86:18:86:25 | ...::format(...) | provenance | MaD:5 | +| main.rs:86:18:86:25 | { ... } | main.rs:86:18:86:25 | ...::must_use(...) | provenance | MaD:6 | | main.rs:87:10:87:33 | res | main.rs:87:18:87:32 | { ... } | provenance | | | main.rs:87:18:87:32 | ...::format(...) | main.rs:87:10:87:33 | res | provenance | | | main.rs:87:18:87:32 | ...::must_use(...) | main.rs:87:10:87:33 | MacroExpr | provenance | | -| main.rs:87:18:87:32 | MacroExpr | main.rs:87:18:87:32 | ...::format(...) | provenance | MaD:6 | -| main.rs:87:18:87:32 | { ... } | main.rs:87:18:87:32 | ...::must_use(...) | provenance | MaD:3 | +| main.rs:87:18:87:32 | MacroExpr | main.rs:87:18:87:32 | ...::format(...) | provenance | MaD:5 | +| main.rs:87:18:87:32 | { ... } | main.rs:87:18:87:32 | ...::must_use(...) | provenance | MaD:6 | nodes | main.rs:26:9:26:9 | s | semmle.label | s | | main.rs:26:13:26:22 | source(...) | semmle.label | source(...) | diff --git a/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected b/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected index e69de29bb2d..847878c4db9 100644 --- a/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected +++ b/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected @@ -0,0 +1,6 @@ +| main.rs:34:37:34:54 | //... | Missing result: database-read | +| main.rs:35:37:35:54 | //... | Missing result: database-read | +| main.rs:36:37:36:54 | //... | Missing result: database-read | +| main.rs:43:41:43:58 | //... | Missing result: database-read | +| main.rs:44:41:44:58 | //... | Missing result: database-read | +| main.rs:45:41:45:58 | //... | Missing result: database-read | diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected index 5b0c7744a31..08e88a3039a 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected @@ -9,14 +9,14 @@ edges | main.rs:5:17:5:45 | res | main.rs:5:25:5:44 | { ... } | provenance | | | main.rs:5:25:5:44 | ...::format(...) | main.rs:5:17:5:45 | res | provenance | | | main.rs:5:25:5:44 | ...::must_use(...) | main.rs:5:9:5:13 | regex | provenance | | -| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:4 | -| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:3 | +| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:3 | +| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:4 | | main.rs:6:26:6:30 | regex | main.rs:6:25:6:30 | ®ex | provenance | | models | 1 | Source: std::env::var; ReturnValue.Field[core::result::Result::Ok(0)]; environment | | 2 | Summary: ::unwrap_or; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 3 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | -| 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 3 | Summary: alloc::fmt::format; Argument[0]; ReturnValue; taint | +| 4 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | nodes | main.rs:4:9:4:16 | username | semmle.label | username | | main.rs:4:20:4:32 | ...::var | semmle.label | ...::var | diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index ff203271aba..c151359d1cb 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -6,37 +6,41 @@ edges | sqlx.rs:47:9:47:18 | arg_string | sqlx.rs:53:27:53:36 | arg_string | provenance | | | sqlx.rs:47:22:47:35 | ...::args | sqlx.rs:47:22:47:37 | ...::args(...) [element] | provenance | Src:MaD:2 | -| sqlx.rs:47:22:47:37 | ...::args(...) [element] | sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | provenance | MaD:8 | -| sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | sqlx.rs:47:22:47:77 | ... .unwrap_or(...) | provenance | MaD:3 | +| sqlx.rs:47:22:47:37 | ...::args(...) [element] | sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | provenance | MaD:3 | +| sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | sqlx.rs:47:22:47:77 | ... .unwrap_or(...) | provenance | MaD:5 | | sqlx.rs:47:22:47:77 | ... .unwrap_or(...) | sqlx.rs:47:9:47:18 | arg_string | provenance | | | sqlx.rs:48:9:48:21 | remote_string | sqlx.rs:54:27:54:39 | remote_string | provenance | | | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:48:25:48:69 | ...::get(...) [Ok] | provenance | Src:MaD:1 | -| sqlx.rs:48:25:48:69 | ...::get(...) [Ok] | sqlx.rs:48:25:48:78 | ... .unwrap() | provenance | MaD:4 | +| sqlx.rs:48:25:48:69 | ...::get(...) [Ok] | sqlx.rs:48:25:48:78 | ... .unwrap() | provenance | MaD:6 | | sqlx.rs:48:25:48:78 | ... .unwrap() | sqlx.rs:48:25:48:85 | ... .text() [Ok] | provenance | MaD:9 | -| sqlx.rs:48:25:48:85 | ... .text() [Ok] | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | provenance | MaD:5 | +| sqlx.rs:48:25:48:85 | ... .text() [Ok] | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | provenance | MaD:7 | | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | sqlx.rs:48:9:48:21 | remote_string | provenance | | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:7 | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:6 | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:7 | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:6 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:8 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:4 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:8 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:8 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:4 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:8 | | sqlx.rs:53:26:53:36 | &arg_string [&ref] | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | provenance | | | sqlx.rs:53:27:53:36 | arg_string | sqlx.rs:53:26:53:36 | &arg_string [&ref] | provenance | | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:7 | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:6 | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:7 | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:6 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:8 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:4 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:8 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:8 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:4 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:8 | | sqlx.rs:54:26:54:39 | &remote_string [&ref] | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | provenance | | | sqlx.rs:54:27:54:39 | remote_string | sqlx.rs:54:26:54:39 | &remote_string [&ref] | provenance | | models -| 1 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; ReturnValue.Field[core::result::Result::Ok(0)]; remote | +| 1 | Source: reqwest::blocking::get; ReturnValue.Field[core::result::Result::Ok(0)]; remote | | 2 | Source: std::env::args; ReturnValue.Element; commandargs | -| 3 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 4 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 5 | Summary: ::unwrap_or; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 6 | Summary: ::as_str; Argument[self]; ReturnValue; value | -| 7 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | -| 8 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 9 | Summary: repo:https://github.com/seanmonstar/reqwest:reqwest; ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 3 | Summary: <_ as core::iter::traits::iterator::Iterator>::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 4 | Summary: ::as_str; Argument[self]; ReturnValue; value | +| 5 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 6 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 7 | Summary: ::unwrap_or; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 8 | Summary: ::as_str; Argument[self]; ReturnValue; value | +| 9 | Summary: ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | nodes | sqlx.rs:47:9:47:18 | arg_string | semmle.label | arg_string | | sqlx.rs:47:22:47:35 | ...::args | semmle.label | ...::args | diff --git a/rust/ql/test/query-tests/security/CWE-311/CleartextTransmission.expected b/rust/ql/test/query-tests/security/CWE-311/CleartextTransmission.expected index c52d7fe6d43..5f5ddd261b6 100644 --- a/rust/ql/test/query-tests/security/CWE-311/CleartextTransmission.expected +++ b/rust/ql/test/query-tests/security/CWE-311/CleartextTransmission.expected @@ -9,16 +9,16 @@ edges | main.rs:6:15:6:58 | res | main.rs:6:23:6:57 | { ... } | provenance | | | main.rs:6:23:6:57 | ...::format(...) | main.rs:6:15:6:58 | res | provenance | | | main.rs:6:23:6:57 | ...::must_use(...) | main.rs:6:9:6:11 | url | provenance | | -| main.rs:6:23:6:57 | MacroExpr | main.rs:6:23:6:57 | ...::format(...) | provenance | MaD:8 | -| main.rs:6:23:6:57 | { ... } | main.rs:6:23:6:57 | ...::must_use(...) | provenance | MaD:7 | +| main.rs:6:23:6:57 | MacroExpr | main.rs:6:23:6:57 | ...::format(...) | provenance | MaD:7 | +| main.rs:6:23:6:57 | { ... } | main.rs:6:23:6:57 | ...::must_use(...) | provenance | MaD:8 | | main.rs:6:50:6:57 | password | main.rs:6:23:6:57 | MacroExpr | provenance | | | main.rs:7:28:7:30 | url | main.rs:7:5:7:26 | ...::get | provenance | MaD:4 Sink:MaD:4 | | main.rs:12:9:12:15 | address | main.rs:13:27:13:33 | address | provenance | | | main.rs:12:19:12:60 | res | main.rs:12:27:12:59 | { ... } | provenance | | | main.rs:12:27:12:59 | ...::format(...) | main.rs:12:19:12:60 | res | provenance | | | main.rs:12:27:12:59 | ...::must_use(...) | main.rs:12:9:12:15 | address | provenance | | -| main.rs:12:27:12:59 | MacroExpr | main.rs:12:27:12:59 | ...::format(...) | provenance | MaD:8 | -| main.rs:12:27:12:59 | { ... } | main.rs:12:27:12:59 | ...::must_use(...) | provenance | MaD:7 | +| main.rs:12:27:12:59 | MacroExpr | main.rs:12:27:12:59 | ...::format(...) | provenance | MaD:7 | +| main.rs:12:27:12:59 | { ... } | main.rs:12:27:12:59 | ...::must_use(...) | provenance | MaD:8 | | main.rs:12:50:12:57 | password | main.rs:12:27:12:59 | MacroExpr | provenance | | | main.rs:13:9:13:11 | url | main.rs:14:28:14:30 | url | provenance | | | main.rs:13:15:13:34 | ...::parse(...) [Ok] | main.rs:13:15:13:43 | ... .unwrap() | provenance | MaD:5 | @@ -30,35 +30,35 @@ edges | main.rs:19:15:19:58 | res | main.rs:19:23:19:57 | { ... } | provenance | | | main.rs:19:23:19:57 | ...::format(...) | main.rs:19:15:19:58 | res | provenance | | | main.rs:19:23:19:57 | ...::must_use(...) | main.rs:19:9:19:11 | url | provenance | | -| main.rs:19:23:19:57 | MacroExpr | main.rs:19:23:19:57 | ...::format(...) | provenance | MaD:8 | -| main.rs:19:23:19:57 | { ... } | main.rs:19:23:19:57 | ...::must_use(...) | provenance | MaD:7 | +| main.rs:19:23:19:57 | MacroExpr | main.rs:19:23:19:57 | ...::format(...) | provenance | MaD:7 | +| main.rs:19:23:19:57 | { ... } | main.rs:19:23:19:57 | ...::must_use(...) | provenance | MaD:8 | | main.rs:19:50:19:57 | password | main.rs:19:23:19:57 | MacroExpr | provenance | | | main.rs:21:17:21:19 | url | main.rs:21:12:21:15 | post | provenance | MaD:1 Sink:MaD:1 | | main.rs:26:9:26:11 | url | main.rs:28:33:28:35 | url | provenance | | | main.rs:26:15:26:58 | res | main.rs:26:23:26:57 | { ... } | provenance | | | main.rs:26:23:26:57 | ...::format(...) | main.rs:26:15:26:58 | res | provenance | | | main.rs:26:23:26:57 | ...::must_use(...) | main.rs:26:9:26:11 | url | provenance | | -| main.rs:26:23:26:57 | MacroExpr | main.rs:26:23:26:57 | ...::format(...) | provenance | MaD:8 | -| main.rs:26:23:26:57 | { ... } | main.rs:26:23:26:57 | ...::must_use(...) | provenance | MaD:7 | +| main.rs:26:23:26:57 | MacroExpr | main.rs:26:23:26:57 | ...::format(...) | provenance | MaD:7 | +| main.rs:26:23:26:57 | { ... } | main.rs:26:23:26:57 | ...::must_use(...) | provenance | MaD:8 | | main.rs:26:50:26:57 | password | main.rs:26:23:26:57 | MacroExpr | provenance | | | main.rs:28:33:28:35 | url | main.rs:28:12:28:18 | request | provenance | MaD:3 Sink:MaD:3 | | main.rs:33:9:33:11 | url | main.rs:35:33:35:35 | url | provenance | | | main.rs:33:15:33:58 | res | main.rs:33:23:33:57 | { ... } | provenance | | | main.rs:33:23:33:57 | ...::format(...) | main.rs:33:15:33:58 | res | provenance | | | main.rs:33:23:33:57 | ...::must_use(...) | main.rs:33:9:33:11 | url | provenance | | -| main.rs:33:23:33:57 | MacroExpr | main.rs:33:23:33:57 | ...::format(...) | provenance | MaD:8 | -| main.rs:33:23:33:57 | { ... } | main.rs:33:23:33:57 | ...::must_use(...) | provenance | MaD:7 | +| main.rs:33:23:33:57 | MacroExpr | main.rs:33:23:33:57 | ...::format(...) | provenance | MaD:7 | +| main.rs:33:23:33:57 | { ... } | main.rs:33:23:33:57 | ...::must_use(...) | provenance | MaD:8 | | main.rs:33:50:33:57 | password | main.rs:33:23:33:57 | MacroExpr | provenance | | | main.rs:35:33:35:35 | url | main.rs:35:12:35:18 | request | provenance | MaD:2 Sink:MaD:2 | models | 1 | Sink: ::post; Argument[0]; transmission | -| 2 | Sink: repo:https://github.com/seanmonstar/reqwest:reqwest; ::request; Argument[1]; transmission | -| 3 | Sink: repo:https://github.com/seanmonstar/reqwest:reqwest; ::request; Argument[1]; transmission | +| 2 | Sink: ::request; Argument[1]; transmission | +| 3 | Sink: ::request; Argument[1]; transmission | | 4 | Sink: reqwest::blocking::get; Argument[0]; transmission | | 5 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | | 6 | Summary: ::parse; Argument[0].Reference; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 7 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | -| 8 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 7 | Summary: alloc::fmt::format; Argument[0]; ReturnValue; taint | +| 8 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | nodes | main.rs:6:9:6:11 | url | semmle.label | url | | main.rs:6:15:6:58 | res | semmle.label | res | diff --git a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected index 8506a58effb..f70c0068e1e 100644 --- a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected +++ b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected @@ -137,8 +137,8 @@ edges | test_logging.rs:99:14:99:46 | res | test_logging.rs:99:22:99:45 | { ... } | provenance | | | test_logging.rs:99:22:99:45 | ...::format(...) | test_logging.rs:99:14:99:46 | res | provenance | | | test_logging.rs:99:22:99:45 | ...::must_use(...) | test_logging.rs:99:9:99:10 | m3 | provenance | | -| test_logging.rs:99:22:99:45 | MacroExpr | test_logging.rs:99:22:99:45 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:99:22:99:45 | { ... } | test_logging.rs:99:22:99:45 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:99:22:99:45 | MacroExpr | test_logging.rs:99:22:99:45 | ...::format(...) | provenance | MaD:12 | +| test_logging.rs:99:22:99:45 | { ... } | test_logging.rs:99:22:99:45 | ...::must_use(...) | provenance | MaD:13 | | test_logging.rs:99:38:99:45 | password | test_logging.rs:99:22:99:45 | MacroExpr | provenance | | | test_logging.rs:100:11:100:18 | MacroExpr | test_logging.rs:100:5:100:19 | ...::log | provenance | MaD:8 Sink:MaD:8 | | test_logging.rs:118:12:118:41 | MacroExpr | test_logging.rs:118:5:118:42 | ...::log | provenance | MaD:8 Sink:MaD:8 | @@ -160,8 +160,8 @@ edges | test_logging.rs:176:34:176:79 | res | test_logging.rs:176:42:176:78 | { ... } | provenance | | | test_logging.rs:176:42:176:78 | ...::format(...) | test_logging.rs:176:34:176:79 | res | provenance | | | test_logging.rs:176:42:176:78 | ...::must_use(...) | test_logging.rs:176:34:176:79 | MacroExpr | provenance | | -| test_logging.rs:176:42:176:78 | MacroExpr | test_logging.rs:176:42:176:78 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:176:42:176:78 | { ... } | test_logging.rs:176:42:176:78 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:176:42:176:78 | MacroExpr | test_logging.rs:176:42:176:78 | ...::format(...) | provenance | MaD:12 | +| test_logging.rs:176:42:176:78 | { ... } | test_logging.rs:176:42:176:78 | ...::must_use(...) | provenance | MaD:13 | | test_logging.rs:176:70:176:78 | password2 | test_logging.rs:176:42:176:78 | MacroExpr | provenance | | | test_logging.rs:180:35:180:81 | &... | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:2 Sink:MaD:2 | | test_logging.rs:180:35:180:81 | &... [&ref] | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:2 Sink:MaD:2 | @@ -170,8 +170,8 @@ edges | test_logging.rs:180:36:180:81 | res | test_logging.rs:180:44:180:80 | { ... } | provenance | | | test_logging.rs:180:44:180:80 | ...::format(...) | test_logging.rs:180:36:180:81 | res | provenance | | | test_logging.rs:180:44:180:80 | ...::must_use(...) | test_logging.rs:180:36:180:81 | MacroExpr | provenance | | -| test_logging.rs:180:44:180:80 | MacroExpr | test_logging.rs:180:44:180:80 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:180:44:180:80 | { ... } | test_logging.rs:180:44:180:80 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:180:44:180:80 | MacroExpr | test_logging.rs:180:44:180:80 | ...::format(...) | provenance | MaD:12 | +| test_logging.rs:180:44:180:80 | { ... } | test_logging.rs:180:44:180:80 | ...::must_use(...) | provenance | MaD:13 | | test_logging.rs:180:72:180:80 | password2 | test_logging.rs:180:44:180:80 | MacroExpr | provenance | | | test_logging.rs:183:9:183:19 | err_result2 [Err] | test_logging.rs:184:13:184:23 | err_result2 [Err] | provenance | | | test_logging.rs:183:47:183:68 | Err(...) [Err] | test_logging.rs:183:9:183:19 | err_result2 [Err] | provenance | | @@ -234,8 +234,8 @@ models | 9 | Sink: log::__private_api::log; Argument[3]; log-injection | | 10 | Sink: std::io::stdio::_eprint; Argument[0]; log-injection | | 11 | Sink: std::io::stdio::_print; Argument[0]; log-injection | -| 12 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | -| 13 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 12 | Summary: alloc::fmt::format; Argument[0]; ReturnValue; taint | +| 13 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | nodes | test_logging.rs:42:5:42:36 | ...::log | semmle.label | ...::log | | test_logging.rs:42:12:42:35 | MacroExpr | semmle.label | MacroExpr | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 5e99e62b9d2..e2bcccede68 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -59,7 +59,7 @@ | main.rs:284:22:284:38 | ...::alloc | main.rs:308:25:308:38 | ...::args | main.rs:284:22:284:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:308:25:308:38 | ...::args | user-provided value | edges | main.rs:12:36:12:43 | ...: usize | main.rs:18:41:18:41 | v | provenance | | -| main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:19 Sink:MaD:19 | +| main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:18 Sink:MaD:18 | | main.rs:18:41:18:41 | v | main.rs:20:50:20:50 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:29:60:29:60 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:32:60:32:60 | v | provenance | | @@ -67,92 +67,92 @@ edges | main.rs:18:41:18:41 | v | main.rs:35:9:35:10 | s6 | provenance | | | main.rs:18:41:18:41 | v | main.rs:35:49:35:49 | v | provenance | | | main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | -| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:35 | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:39 | | main.rs:20:14:20:63 | ... .unwrap() | main.rs:20:9:20:10 | l2 | provenance | | -| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | -| main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:21:31:21:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:40 | -| main.rs:21:31:21:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:40 | +| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:29 | +| main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:21:31:21:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:25 | +| main.rs:21:31:21:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:25 | | main.rs:21:31:21:32 | l2 | main.rs:24:38:24:39 | l2 | provenance | | -| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:35 | -| main.rs:22:31:22:53 | ... .unwrap() | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:35 | -| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:46 | -| main.rs:23:31:23:68 | ... .pad_to_align() | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:18 Sink:MaD:18 | +| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:39 | +| main.rs:22:31:22:53 | ... .unwrap() | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:39 | +| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:32 | +| main.rs:23:31:23:68 | ... .pad_to_align() | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:17 Sink:MaD:17 | | main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | -| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | -| main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:31 | +| main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:32:9:32:10 | l5 | main.rs:33:31:33:32 | l5 | provenance | | | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | main.rs:32:9:32:10 | l5 | provenance | | -| main.rs:32:60:32:60 | v | main.rs:32:60:32:89 | ... * ... | provenance | MaD:37 | -| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | -| main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:32:60:32:60 | v | main.rs:32:60:32:89 | ... * ... | provenance | MaD:42 | +| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:31 | +| main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:35:9:35:10 | s6 | main.rs:36:60:36:61 | s6 | provenance | | | main.rs:35:15:35:49 | ... * ... | main.rs:35:9:35:10 | s6 | provenance | | -| main.rs:35:49:35:49 | v | main.rs:35:15:35:49 | ... * ... | provenance | MaD:36 | +| main.rs:35:49:35:49 | v | main.rs:35:15:35:49 | ... * ... | provenance | MaD:41 | | main.rs:36:9:36:10 | l6 | main.rs:37:31:37:32 | l6 | provenance | | | main.rs:36:9:36:10 | l6 [Layout.size] | main.rs:37:31:37:32 | l6 [Layout.size] | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) [Layout.size] | main.rs:36:9:36:10 | l6 [Layout.size] | provenance | | -| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | -| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) [Layout.size] | provenance | MaD:31 | -| main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:49 | -| main.rs:37:31:37:32 | l6 [Layout.size] | main.rs:39:60:39:68 | l6.size() | provenance | MaD:32 | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:31 | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) [Layout.size] | provenance | MaD:30 | +| main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:36 | +| main.rs:37:31:37:32 | l6 [Layout.size] | main.rs:39:60:39:68 | l6.size() | provenance | MaD:35 | | main.rs:39:9:39:10 | l7 | main.rs:40:31:40:32 | l7 | provenance | | | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | main.rs:39:9:39:10 | l7 | provenance | | -| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | -| main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:31 | +| main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:45 | ... + ... | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:53:48:53:48 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:54:48:54:53 | ... * ... | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:58:34:58:34 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:67:46:67:46 | v | provenance | | -| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:35 | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:39 | | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | -| main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | -| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:35 | +| main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:33 | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:39 | | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | -| main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | -| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:35 | -| main.rs:53:31:53:58 | ... .unwrap() | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:48 | -| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:35 | -| main.rs:54:31:54:63 | ... .unwrap() | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:48 | +| main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:33 | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:39 | +| main.rs:53:31:53:58 | ... .unwrap() | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:34 | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:39 | +| main.rs:54:31:54:63 | ... .unwrap() | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:34 | | main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | | main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | -| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:34 | +| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:38 | | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | main.rs:58:9:58:20 | TuplePat [tuple.0] | provenance | | -| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | -| main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:33 | +| main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:59:31:59:32 | k1 | main.rs:60:34:60:35 | k1 | provenance | | | main.rs:59:31:59:32 | k1 | main.rs:64:48:64:49 | k1 | provenance | | | main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | | main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | -| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:35 | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:39 | | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | -| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:42 | -| main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:35 | -| main.rs:64:31:64:59 | ... .unwrap() | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:43 | +| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:27 | +| main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:39 | +| main.rs:64:31:64:59 | ... .unwrap() | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:28 | | main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | -| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:35 | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:39 | | main.rs:67:14:67:56 | ... .unwrap() | main.rs:67:9:67:10 | l4 | provenance | | -| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | | main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | -| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:35 | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:39 | | main.rs:87:18:87:67 | ... .unwrap() | main.rs:87:9:87:14 | layout | provenance | | -| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | -| main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:29 | +| main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | | main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | | main.rs:91:38:91:45 | ...: usize | main.rs:105:33:105:33 | v | provenance | | @@ -162,114 +162,115 @@ edges | main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | -| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap() | provenance | MaD:35 | +| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap() | provenance | MaD:39 | | main.rs:92:14:92:57 | ... .unwrap() | main.rs:92:9:92:10 | l1 | provenance | | -| main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | | main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | -| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap() | provenance | MaD:35 | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap() | provenance | MaD:39 | | main.rs:101:18:101:61 | ... .unwrap() | main.rs:101:13:101:14 | l3 | provenance | | -| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:102:35:102:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | -| main.rs:103:35:103:36 | l3 | main.rs:103:17:103:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:103:35:103:36 | l3 | main.rs:103:17:103:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:105:33:105:33 | v | main.rs:86:35:86:42 | ...: usize | provenance | | -| main.rs:109:35:109:36 | l1 | main.rs:109:17:109:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:109:35:109:36 | l1 | main.rs:109:17:109:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:109:35:109:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | -| main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | | main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | -| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap() | provenance | MaD:35 | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap() | provenance | MaD:39 | | main.rs:145:18:145:61 | ... .unwrap() | main.rs:145:13:145:14 | l9 | provenance | | -| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | -| main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | -| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap() | provenance | MaD:35 | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap() | provenance | MaD:39 | | main.rs:151:15:151:78 | ... .unwrap() | main.rs:151:9:151:11 | l10 | provenance | | -| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:39 | -| main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:44 | +| main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | -| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap() | provenance | MaD:35 | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap() | provenance | MaD:39 | | main.rs:154:15:154:78 | ... .unwrap() | main.rs:154:9:154:11 | l11 | provenance | | -| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:38 | -| main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | +| main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:43 | +| main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | -| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:35 | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:39 | | main.rs:161:19:161:68 | ... .unwrap() | main.rs:161:13:161:15 | l13 | provenance | | -| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | -| main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:29 | +| main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | -| main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | | main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | | main.rs:183:29:183:36 | ...: usize | main.rs:202:48:202:48 | v | provenance | | | main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | -| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap() | provenance | MaD:35 | +| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap() | provenance | MaD:39 | | main.rs:192:14:192:56 | ... .unwrap() | main.rs:192:9:192:10 | l2 | provenance | | -| main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:41 | -| main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:24 Sink:MaD:24 | +| main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:26 | | main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:10 Sink:MaD:10 | +| main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:11 Sink:MaD:11 | | main.rs:193:38:193:39 | l2 | main.rs:194:45:194:46 | l2 | provenance | | -| main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:25 Sink:MaD:25 | -| main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | | main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:12 Sink:MaD:12 | +| main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:12 Sink:MaD:12 | +| main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:13 Sink:MaD:13 | | main.rs:194:45:194:46 | l2 | main.rs:195:41:195:42 | l2 | provenance | | -| main.rs:195:41:195:42 | l2 | main.rs:195:32:195:39 | allocate | provenance | MaD:20 Sink:MaD:20 | +| main.rs:195:41:195:42 | l2 | main.rs:195:32:195:39 | allocate | provenance | MaD:5 Sink:MaD:5 | | main.rs:195:41:195:42 | l2 | main.rs:195:32:195:39 | allocate | provenance | MaD:5 Sink:MaD:5 | | main.rs:195:41:195:42 | l2 | main.rs:196:48:196:49 | l2 | provenance | | -| main.rs:196:48:196:49 | l2 | main.rs:196:32:196:46 | allocate_zeroed | provenance | MaD:21 Sink:MaD:21 | +| main.rs:196:48:196:49 | l2 | main.rs:196:32:196:46 | allocate_zeroed | provenance | MaD:6 Sink:MaD:6 | | main.rs:196:48:196:49 | l2 | main.rs:196:32:196:46 | allocate_zeroed | provenance | MaD:6 Sink:MaD:6 | | main.rs:196:48:196:49 | l2 | main.rs:197:41:197:42 | l2 | provenance | | -| main.rs:197:41:197:42 | l2 | main.rs:197:32:197:39 | allocate | provenance | MaD:15 Sink:MaD:15 | +| main.rs:197:41:197:42 | l2 | main.rs:197:32:197:39 | allocate | provenance | MaD:1 Sink:MaD:1 | | main.rs:197:41:197:42 | l2 | main.rs:197:32:197:39 | allocate | provenance | MaD:1 Sink:MaD:1 | | main.rs:197:41:197:42 | l2 | main.rs:198:48:198:49 | l2 | provenance | | -| main.rs:198:48:198:49 | l2 | main.rs:198:32:198:46 | allocate_zeroed | provenance | MaD:16 Sink:MaD:16 | +| main.rs:198:48:198:49 | l2 | main.rs:198:32:198:46 | allocate_zeroed | provenance | MaD:2 Sink:MaD:2 | | main.rs:198:48:198:49 | l2 | main.rs:198:32:198:46 | allocate_zeroed | provenance | MaD:2 Sink:MaD:2 | | main.rs:198:48:198:49 | l2 | main.rs:208:53:208:54 | l2 | provenance | | | main.rs:198:48:198:49 | l2 | main.rs:210:60:210:61 | l2 | provenance | | | main.rs:198:48:198:49 | l2 | main.rs:213:51:213:52 | l2 | provenance | | -| main.rs:202:48:202:48 | v | main.rs:202:32:202:38 | realloc | provenance | MaD:13 Sink:MaD:13 | | main.rs:202:48:202:48 | v | main.rs:202:32:202:38 | realloc | provenance | MaD:14 Sink:MaD:14 | -| main.rs:208:53:208:54 | l2 | main.rs:208:40:208:43 | grow | provenance | MaD:22 Sink:MaD:22 | +| main.rs:202:48:202:48 | v | main.rs:202:32:202:38 | realloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:208:53:208:54 | l2 | main.rs:208:40:208:43 | grow | provenance | MaD:7 Sink:MaD:7 | -| main.rs:210:60:210:61 | l2 | main.rs:210:40:210:50 | grow_zeroed | provenance | MaD:23 Sink:MaD:23 | +| main.rs:208:53:208:54 | l2 | main.rs:208:40:208:43 | grow | provenance | MaD:7 Sink:MaD:7 | +| main.rs:210:60:210:61 | l2 | main.rs:210:40:210:50 | grow_zeroed | provenance | MaD:8 Sink:MaD:8 | | main.rs:210:60:210:61 | l2 | main.rs:210:40:210:50 | grow_zeroed | provenance | MaD:8 Sink:MaD:8 | | main.rs:213:51:213:52 | l2 | main.rs:213:36:213:41 | shrink | provenance | MaD:9 Sink:MaD:9 | | main.rs:217:27:217:34 | ...: usize | main.rs:219:26:219:26 | v | provenance | | -| main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:28 Sink:MaD:28 | +| main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:21 Sink:MaD:21 | | main.rs:219:26:219:26 | v | main.rs:220:36:220:36 | v | provenance | | -| main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:26 Sink:MaD:26 | +| main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:19 Sink:MaD:19 | | main.rs:220:36:220:36 | v | main.rs:222:30:222:30 | v | provenance | | -| main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:27 Sink:MaD:27 | +| main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:20 Sink:MaD:20 | | main.rs:222:30:222:30 | v | main.rs:223:26:223:26 | v | provenance | | -| main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:27 Sink:MaD:27 | +| main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:20 Sink:MaD:20 | | main.rs:223:26:223:26 | v | main.rs:224:31:224:31 | v | provenance | | -| main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:29 Sink:MaD:29 | +| main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:22 Sink:MaD:22 | | main.rs:227:24:227:31 | ...: usize | main.rs:230:46:230:46 | v | provenance | | | main.rs:230:46:230:46 | v | main.rs:230:13:230:44 | ...::try_with_capacity_in | provenance | MaD:3 Sink:MaD:3 | | main.rs:230:46:230:46 | v | main.rs:231:42:231:42 | v | provenance | | | main.rs:231:42:231:42 | v | main.rs:231:13:231:40 | ...::with_capacity_in | provenance | MaD:4 Sink:MaD:4 | -| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:50 | +| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:40 | +| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:40 | | main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | | main.rs:280:21:280:47 | user_input.parse() [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | | main.rs:280:21:280:48 | TryExpr | main.rs:280:9:280:17 | num_bytes | provenance | | -| main.rs:280:21:280:48 | TryExpr | main.rs:280:21:280:77 | ... * ... | provenance | MaD:37 | +| main.rs:280:21:280:48 | TryExpr | main.rs:280:21:280:77 | ... * ... | provenance | MaD:42 | | main.rs:280:21:280:77 | ... * ... | main.rs:280:9:280:17 | num_bytes | provenance | | | main.rs:282:9:282:14 | layout | main.rs:284:40:284:45 | layout | provenance | | -| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:35 | +| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:39 | | main.rs:282:18:282:75 | ... .unwrap() | main.rs:282:9:282:14 | layout | provenance | | -| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | -| main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:30 | -| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:51 | -| main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:33 | +| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:29 | +| main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:16 Sink:MaD:16 | +| main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:23 | +| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:24 | +| main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:37 | | main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | | main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:321:42:321:42 | v | provenance | | @@ -277,11 +278,12 @@ edges | main.rs:317:9:317:9 | v | main.rs:323:27:323:27 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:324:25:324:25 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:325:22:325:22 | v | provenance | | -| main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:30 | -| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:51 | -| main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:33 | -| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:50 | -| main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:35 | +| main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:23 | +| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:24 | +| main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:37 | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:40 | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:40 | +| main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:39 | | main.rs:317:13:317:91 | ... .unwrap() | main.rs:317:9:317:9 | v | provenance | | | main.rs:320:34:320:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | | main.rs:321:42:321:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | @@ -299,48 +301,41 @@ models | 7 | Sink: ::grow; Argument[2]; alloc-layout | | 8 | Sink: ::grow_zeroed; Argument[2]; alloc-layout | | 9 | Sink: ::shrink; Argument[2]; alloc-layout | -| 10 | Sink: ::alloc; Argument[0]; alloc-size | -| 11 | Sink: ::alloc_zeroed; Argument[0]; alloc-layout | -| 12 | Sink: ::alloc_zeroed; Argument[0]; alloc-size | -| 13 | Sink: ::realloc; Argument[2]; alloc-layout | -| 14 | Sink: ::realloc; Argument[2]; alloc-size | -| 15 | Sink: lang:alloc; ::allocate; Argument[0]; alloc-layout | -| 16 | Sink: lang:alloc; ::allocate_zeroed; Argument[0]; alloc-layout | -| 17 | Sink: lang:alloc; crate::alloc::alloc; Argument[0]; alloc-layout | -| 18 | Sink: lang:alloc; crate::alloc::alloc_zeroed; Argument[0]; alloc-layout | -| 19 | Sink: lang:alloc; crate::alloc::realloc; Argument[2]; alloc-size | -| 20 | Sink: lang:std; ::allocate; Argument[0]; alloc-layout | -| 21 | Sink: lang:std; ::allocate_zeroed; Argument[0]; alloc-layout | -| 22 | Sink: lang:std; ::grow; Argument[2]; alloc-layout | -| 23 | Sink: lang:std; ::grow_zeroed; Argument[2]; alloc-layout | -| 24 | Sink: lang:std; ::alloc; Argument[0]; alloc-layout | -| 25 | Sink: lang:std; ::alloc_zeroed; Argument[0]; alloc-layout | -| 26 | Sink: libc::unix::aligned_alloc; Argument[1]; alloc-size | -| 27 | Sink: libc::unix::calloc; Argument[0,1]; alloc-size | -| 28 | Sink: libc::unix::malloc; Argument[0]; alloc-size | -| 29 | Sink: libc::unix::realloc; Argument[1]; alloc-size | -| 30 | Source: std::env::args; ReturnValue.Element; commandargs | -| 31 | Summary: ::from_size_align_unchecked; Argument[0]; ReturnValue.Field[core::alloc::layout::Layout::size]; value | -| 32 | Summary: ::size; Argument[self].Field[core::alloc::layout::Layout::size]; ReturnValue; value | -| 33 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 34 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 35 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 36 | Summary: ::mul; Argument[0]; ReturnValue; taint | -| 37 | Summary: ::mul; Argument[self]; ReturnValue; taint | -| 38 | Summary: core::cmp::max; Argument[0]; ReturnValue; value | -| 39 | Summary: core::cmp::min; Argument[0]; ReturnValue; value | -| 40 | Summary: lang:core; ::align_to; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 41 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 42 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 43 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 44 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 45 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | -| 46 | Summary: lang:core; ::pad_to_align; Argument[self]; ReturnValue; taint | -| 47 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 48 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 49 | Summary: lang:core; ::size; Argument[self]; ReturnValue; taint | -| 50 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 51 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 10 | Sink: ::alloc; Argument[0]; alloc-layout | +| 11 | Sink: ::alloc; Argument[0]; alloc-size | +| 12 | Sink: ::alloc_zeroed; Argument[0]; alloc-layout | +| 13 | Sink: ::alloc_zeroed; Argument[0]; alloc-size | +| 14 | Sink: ::realloc; Argument[2]; alloc-layout | +| 15 | Sink: ::realloc; Argument[2]; alloc-size | +| 16 | Sink: alloc::alloc::alloc; Argument[0]; alloc-layout | +| 17 | Sink: alloc::alloc::alloc_zeroed; Argument[0]; alloc-layout | +| 18 | Sink: alloc::alloc::realloc; Argument[2]; alloc-size | +| 19 | Sink: libc::unix::aligned_alloc; Argument[1]; alloc-size | +| 20 | Sink: libc::unix::calloc; Argument[0,1]; alloc-size | +| 21 | Sink: libc::unix::malloc; Argument[0]; alloc-size | +| 22 | Sink: libc::unix::realloc; Argument[1]; alloc-size | +| 23 | Source: std::env::args; ReturnValue.Element; commandargs | +| 24 | Summary: <_ as core::iter::traits::iterator::Iterator>::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 25 | Summary: ::align_to; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 26 | Summary: ::array; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 27 | Summary: ::extend; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 28 | Summary: ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 29 | Summary: ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 30 | Summary: ::from_size_align_unchecked; Argument[0]; ReturnValue.Field[core::alloc::layout::Layout::size]; value | +| 31 | Summary: ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | +| 32 | Summary: ::pad_to_align; Argument[self]; ReturnValue; taint | +| 33 | Summary: ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 34 | Summary: ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 35 | Summary: ::size; Argument[self].Field[core::alloc::layout::Layout::size]; ReturnValue; value | +| 36 | Summary: ::size; Argument[self]; ReturnValue; taint | +| 37 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 38 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 39 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 40 | Summary: ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 41 | Summary: ::mul; Argument[0]; ReturnValue; taint | +| 42 | Summary: ::mul; Argument[self]; ReturnValue; taint | +| 43 | Summary: core::cmp::max; Argument[0]; ReturnValue; value | +| 44 | Summary: core::cmp::min; Argument[0]; ReturnValue; value | nodes | main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | | main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | diff --git a/rust/ql/test/query-tests/security/CWE-825/AccessInvalidPointer.expected b/rust/ql/test/query-tests/security/CWE-825/AccessInvalidPointer.expected index 2bd8de26923..1e9bdb3c8bb 100644 --- a/rust/ql/test/query-tests/security/CWE-825/AccessInvalidPointer.expected +++ b/rust/ql/test/query-tests/security/CWE-825/AccessInvalidPointer.expected @@ -18,49 +18,47 @@ | deallocation.rs:248:18:248:20 | ptr | deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:248:18:248:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:242:3:242:25 | ...::drop_in_place | invalid | | deallocation.rs:248:18:248:20 | ptr | deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:248:18:248:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:242:3:242:25 | ...::drop_in_place | invalid | edges -| deallocation.rs:20:3:20:21 | ...::dealloc | deallocation.rs:20:23:20:24 | [post] m1 | provenance | Src:MaD:5 MaD:5 | +| deallocation.rs:20:3:20:21 | ...::dealloc | deallocation.rs:20:23:20:24 | [post] m1 | provenance | Src:MaD:3 MaD:3 | | deallocation.rs:20:23:20:24 | [post] m1 | deallocation.rs:26:15:26:16 | m1 | provenance | | | deallocation.rs:20:23:20:24 | [post] m1 | deallocation.rs:37:35:37:36 | m1 | provenance | | | deallocation.rs:20:23:20:24 | [post] m1 | deallocation.rs:44:6:44:7 | m1 | provenance | | | deallocation.rs:20:23:20:24 | [post] m1 | deallocation.rs:49:27:49:28 | m1 | provenance | | | deallocation.rs:37:35:37:36 | m1 | deallocation.rs:37:14:37:33 | ...::read::<...> | provenance | MaD:1 Sink:MaD:1 | | deallocation.rs:49:27:49:28 | m1 | deallocation.rs:49:5:49:25 | ...::write::<...> | provenance | MaD:2 Sink:MaD:2 | -| deallocation.rs:70:3:70:21 | ...::dealloc | deallocation.rs:70:23:70:35 | [post] m2 as ... | provenance | Src:MaD:5 MaD:5 | +| deallocation.rs:70:3:70:21 | ...::dealloc | deallocation.rs:70:23:70:35 | [post] m2 as ... | provenance | Src:MaD:3 MaD:3 | | deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:76:16:76:17 | m2 | provenance | | | deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:81:16:81:17 | m2 | provenance | | | deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:86:7:86:8 | m2 | provenance | | | deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:90:7:90:8 | m2 | provenance | | | deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:95:33:95:34 | m2 | provenance | | | deallocation.rs:95:33:95:34 | m2 | deallocation.rs:95:5:95:31 | ...::write::<...> | provenance | MaD:2 Sink:MaD:2 | -| deallocation.rs:112:3:112:12 | ...::free | deallocation.rs:112:14:112:40 | [post] my_ptr as ... | provenance | Src:MaD:10 MaD:10 | +| deallocation.rs:112:3:112:12 | ...::free | deallocation.rs:112:14:112:40 | [post] my_ptr as ... | provenance | Src:MaD:8 MaD:8 | | deallocation.rs:112:14:112:40 | [post] my_ptr as ... | deallocation.rs:115:13:115:18 | my_ptr | provenance | | | deallocation.rs:123:6:123:7 | p1 | deallocation.rs:130:14:130:15 | p1 | provenance | | -| deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:123:23:123:42 | ...::dangling(...) | provenance | Src:MaD:6 MaD:6 | -| deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:123:23:123:42 | ...::dangling(...) | provenance | Src:MaD:3 MaD:3 | +| deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:123:23:123:42 | ...::dangling(...) | provenance | Src:MaD:4 MaD:4 | +| deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:123:23:123:42 | ...::dangling(...) | provenance | Src:MaD:4 MaD:4 | | deallocation.rs:123:23:123:42 | ...::dangling(...) | deallocation.rs:123:6:123:7 | p1 | provenance | | | deallocation.rs:124:6:124:7 | p2 | deallocation.rs:131:14:131:15 | p2 | provenance | | -| deallocation.rs:124:21:124:42 | ...::dangling_mut | deallocation.rs:124:21:124:44 | ...::dangling_mut(...) | provenance | Src:MaD:7 MaD:7 | +| deallocation.rs:124:21:124:42 | ...::dangling_mut | deallocation.rs:124:21:124:44 | ...::dangling_mut(...) | provenance | Src:MaD:5 MaD:5 | | deallocation.rs:124:21:124:44 | ...::dangling_mut(...) | deallocation.rs:124:6:124:7 | p2 | provenance | | | deallocation.rs:125:6:125:7 | p3 | deallocation.rs:132:14:132:15 | p3 | provenance | | -| deallocation.rs:125:23:125:36 | ...::null | deallocation.rs:125:23:125:38 | ...::null(...) | provenance | Src:MaD:9 MaD:9 | +| deallocation.rs:125:23:125:36 | ...::null | deallocation.rs:125:23:125:38 | ...::null(...) | provenance | Src:MaD:7 MaD:7 | | deallocation.rs:125:23:125:38 | ...::null(...) | deallocation.rs:125:6:125:7 | p3 | provenance | | -| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:8 MaD:8 | -| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:4 MaD:4 | +| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 | +| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 | | deallocation.rs:176:27:176:28 | [post] p1 | deallocation.rs:180:15:180:16 | p1 | provenance | | -| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:8 MaD:8 | -| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:4 MaD:4 | +| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 | +| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 | | deallocation.rs:242:27:242:29 | [post] ptr | deallocation.rs:248:18:248:20 | ptr | provenance | | models -| 1 | Sink: lang:core; crate::ptr::read; Argument[0]; pointer-access | -| 2 | Sink: lang:core; crate::ptr::write; Argument[0]; pointer-access | -| 3 | Source: core::ptr::dangling; ReturnValue; pointer-invalidate | -| 4 | Source: core::ptr::drop_in_place; Argument[0]; pointer-invalidate | -| 5 | Source: lang:alloc; crate::alloc::dealloc; Argument[0]; pointer-invalidate | -| 6 | Source: lang:core; crate::ptr::dangling; ReturnValue; pointer-invalidate | -| 7 | Source: lang:core; crate::ptr::dangling_mut; ReturnValue; pointer-invalidate | -| 8 | Source: lang:core; crate::ptr::drop_in_place; Argument[0]; pointer-invalidate | -| 9 | Source: lang:core; crate::ptr::null; ReturnValue; pointer-invalidate | -| 10 | Source: libc::unix::free; Argument[0]; pointer-invalidate | +| 1 | Sink: core::ptr::read; Argument[0]; pointer-access | +| 2 | Sink: core::ptr::write; Argument[0]; pointer-access | +| 3 | Source: alloc::alloc::dealloc; Argument[0]; pointer-invalidate | +| 4 | Source: core::ptr::dangling; ReturnValue; pointer-invalidate | +| 5 | Source: core::ptr::dangling_mut; ReturnValue; pointer-invalidate | +| 6 | Source: core::ptr::drop_in_place; Argument[0]; pointer-invalidate | +| 7 | Source: core::ptr::null; ReturnValue; pointer-invalidate | +| 8 | Source: libc::unix::free; Argument[0]; pointer-invalidate | nodes | deallocation.rs:20:3:20:21 | ...::dealloc | semmle.label | ...::dealloc | | deallocation.rs:20:23:20:24 | [post] m1 | semmle.label | [post] m1 | From 7be938c6c390eec61400733b93b7d86e09773441 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Thu, 10 Jul 2025 12:22:14 -0400 Subject: [PATCH 59/96] Handle multiple whitespaces in runner temp regex. Co-authored-by: Napalys Klicius --- .../ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll index 778263f2ef2..f0649bb8174 100644 --- a/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll +++ b/actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll @@ -264,7 +264,7 @@ class ArtifactPoisoningSink extends DataFlow::Node { download.getAFollowingStep() = poisonable and // excluding artifacts downloaded to the temporary directory not download.getPath().regexpMatch("^/tmp.*") and - not download.getPath().regexpMatch("^\\$\\{\\{\\s?runner\\.temp\\s?}}.*") and + not download.getPath().regexpMatch("^\\$\\{\\{\\s*runner\\.temp\\s*}}.*") and not download.getPath().regexpMatch("^\\$RUNNER_TEMP.*") and ( poisonable.(Run).getScript() = this.asExpr() and From 1b794e056af9947e6af39855e2040ed3bb1806f8 Mon Sep 17 00:00:00 2001 From: AdnaneKhan Date: Thu, 10 Jul 2025 12:24:36 -0400 Subject: [PATCH 60/96] Add extra test suggested by @Napalys --- .../.github/workflows/artifactpoisoning97.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning97.yml diff --git a/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning97.yml b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning97.yml new file mode 100644 index 00000000000..1bd28bafdd6 --- /dev/null +++ b/actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoisoning97.yml @@ -0,0 +1,19 @@ +on: + workflow_run: + workflows: + - Benchmark + types: + - completed + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download From PR + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: ${{ runner.temp }}/artifacts/ + - run: npm install From 01c75e38f7dfde618577fb8ec5ea5dcb7931f964 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:31:37 +0100 Subject: [PATCH 61/96] Rust: The rusqlite row.get() calls are missing a canonical path. --- .../frameworks/rusqlite/Rusqlite.expected | 6 ------ .../library-tests/frameworks/rusqlite/main.rs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected b/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected index 847878c4db9..e69de29bb2d 100644 --- a/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected +++ b/rust/ql/test/library-tests/frameworks/rusqlite/Rusqlite.expected @@ -1,6 +0,0 @@ -| main.rs:34:37:34:54 | //... | Missing result: database-read | -| main.rs:35:37:35:54 | //... | Missing result: database-read | -| main.rs:36:37:36:54 | //... | Missing result: database-read | -| main.rs:43:41:43:58 | //... | Missing result: database-read | -| main.rs:44:41:44:58 | //... | Missing result: database-read | -| main.rs:45:41:45:58 | //... | Missing result: database-read | diff --git a/rust/ql/test/library-tests/frameworks/rusqlite/main.rs b/rust/ql/test/library-tests/frameworks/rusqlite/main.rs index 438e55920ec..e5c975e0ac8 100644 --- a/rust/ql/test/library-tests/frameworks/rusqlite/main.rs +++ b/rust/ql/test/library-tests/frameworks/rusqlite/main.rs @@ -24,27 +24,27 @@ fn main() -> Result<(), Box> { )", (), )?; - + let query = format!("INSERT INTO person (name, age) VALUES ('{}', '{}')", name, age); connection.execute(&query, ())?; // $ sql-sink let person = connection.query_row(&query, (), |row| { // $ sql-sink Ok(Person { - id: row.get(0)?, // $ database-read - name: row.get(1)?, // $ database-read - age: row.get(2)?, // $ database-read + id: row.get(0)?, // $ MISSING: database-read + name: row.get(1)?, // $ MISSING: database-read + age: row.get(2)?, // $ MISSING: database-read }) })?; let mut stmt = connection.prepare("SELECT id, name, age FROM person")?; // $ sql-sink let people = stmt.query_map([], |row| { Ok(Person { - id: row.get_unwrap(0), // $ database-read - name: row.get_unwrap(1), // $ database-read - age: row.get_unwrap(2), // $ database-read + id: row.get_unwrap(0), // $ MISSING: database-read + name: row.get_unwrap(1), // $ MISSING: database-read + age: row.get_unwrap(2), // $ MISSING: database-read }) })?; Ok(()) -} \ No newline at end of file +} From 6de5a618f370a7d547bdb89711c1d7ba95f9a795 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Jul 2025 18:03:12 +0100 Subject: [PATCH 62/96] Rust: Accept consistency changes as well. --- .../sources/CONSISTENCY/PathResolutionConsistency.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index a0ab407feb6..20db1411b2c 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -11,6 +11,8 @@ multipleCallTargets | test.rs:179:30:179:68 | ...::_print(...) | | test.rs:188:26:188:105 | ...::_print(...) | | test.rs:229:22:229:72 | ... .read_to_string(...) | +| test.rs:483:22:483:50 | file.read_to_end(...) | +| test.rs:489:22:489:53 | file.read_to_string(...) | | test.rs:610:18:610:38 | ...::_print(...) | | test.rs:615:18:615:45 | ...::_print(...) | | test.rs:619:25:619:49 | address.to_socket_addrs() | From 8cd357a8a0c09fd2813c55e919e55f1a756fd21d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Jul 2025 10:58:09 +0200 Subject: [PATCH 63/96] Rust: Fix type inference for library parameters --- rust/ql/lib/codeql/rust/internal/TypeInference.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index a08cc8137be..0bb6da4e48f 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -654,7 +654,7 @@ private module CallExprBaseMatchingInput implements MatchingInputSig { exists(Param p, int i | paramPos(this.getParamList(), p, i) and i = dpos.asPosition() and - result = inferAnnotatedType(p.getPat(), path) + result = p.getTypeRepr().(TypeMention).resolveTypeAt(path) ) or exists(SelfParam self | From 1d7d45e16b9cac5e8126c31015ce4eec5e7048e1 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Jul 2025 11:15:35 +0200 Subject: [PATCH 64/96] Rust: Update expected test output --- .../dataflow/modeled/inline-flow.expected | 76 +++-- .../library-tests/dataflow/modeled/main.rs | 6 +- .../PathResolutionConsistency.expected | 7 + .../test/library-tests/type-inference/main.rs | 12 +- .../type-inference/type-inference.expected | 319 ++++++++++++++++++ .../PathResolutionConsistency.expected | 2 + .../security/CWE-089/SqlInjection.expected | 55 ++- .../test/query-tests/security/CWE-089/sqlx.rs | 4 +- .../PathResolutionConsistency.expected | 5 + .../CWE-312/CleartextLogging.expected | 284 +++++++++++----- .../security/CWE-312/test_logging.rs | 10 +- .../PathResolutionConsistency.expected | 3 + .../UncontrolledAllocationSize.expected | 80 +++-- .../test/query-tests/security/CWE-770/main.rs | 4 +- 14 files changed, 709 insertions(+), 158 deletions(-) create mode 100644 rust/ql/test/library-tests/frameworks/postgres/CONSISTENCY/PathResolutionConsistency.expected create mode 100644 rust/ql/test/query-tests/security/CWE-328/CONSISTENCY/PathResolutionConsistency.expected diff --git a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected index cce06005edc..d3eddedf983 100644 --- a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected @@ -3,15 +3,18 @@ models | 2 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | | 3 | Summary: ::zip; Argument[0].Field[core::option::Option::Some(0)]; ReturnValue.Field[core::option::Option::Some(0)].Field[1]; value | | 4 | Summary: ::into_inner; Argument[0].Field[core::pin::Pin::__pointer]; ReturnValue; value | -| 5 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::__pointer]; value | -| 6 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 7 | Summary: lang:alloc; ::into_pin; Argument[0]; ReturnValue; value | -| 8 | Summary: lang:alloc; ::new; Argument[0]; ReturnValue.Reference; value | -| 9 | Summary: lang:alloc; ::pin; Argument[0]; ReturnValue.Reference; value | -| 10 | Summary: lang:core; ::into_inner; Argument[0]; ReturnValue; value | -| 11 | Summary: lang:core; ::new; Argument[0]; ReturnValue; value | -| 12 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 13 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | +| 5 | Summary: ::new; Argument[0].Reference; ReturnValue; value | +| 6 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::__pointer]; value | +| 7 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 8 | Summary: lang:alloc; ::into_pin; Argument[0]; ReturnValue; value | +| 9 | Summary: lang:alloc; ::new; Argument[0]; ReturnValue.Reference; value | +| 10 | Summary: lang:alloc; ::pin; Argument[0]; ReturnValue.Reference; value | +| 11 | Summary: lang:core; ::into_inner; Argument[0]; ReturnValue; value | +| 12 | Summary: lang:core; ::into_inner_unchecked; Argument[0]; ReturnValue; value | +| 13 | Summary: lang:core; ::new; Argument[0]; ReturnValue; value | +| 14 | Summary: lang:core; ::new_unchecked; Argument[0].Reference; ReturnValue; value | +| 15 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | +| 16 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | edges | main.rs:12:9:12:9 | a [Some] | main.rs:13:10:13:19 | a.unwrap() | provenance | MaD:2 | | main.rs:12:9:12:9 | a [Some] | main.rs:14:13:14:13 | a [Some] | provenance | | @@ -20,11 +23,11 @@ edges | main.rs:14:9:14:9 | b [Some] | main.rs:15:10:15:19 | b.unwrap() | provenance | MaD:2 | | main.rs:14:13:14:13 | a [Some] | main.rs:14:13:14:21 | a.clone() [Some] | provenance | generated | | main.rs:14:13:14:21 | a.clone() [Some] | main.rs:14:9:14:9 | b [Some] | provenance | | -| main.rs:19:9:19:9 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:6 | +| main.rs:19:9:19:9 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:7 | | main.rs:19:9:19:9 | a [Ok] | main.rs:21:13:21:13 | a [Ok] | provenance | | | main.rs:19:31:19:44 | Ok(...) [Ok] | main.rs:19:9:19:9 | a [Ok] | provenance | | | main.rs:19:34:19:43 | source(...) | main.rs:19:31:19:44 | Ok(...) [Ok] | provenance | | -| main.rs:21:9:21:9 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:6 | +| main.rs:21:9:21:9 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:7 | | main.rs:21:13:21:13 | a [Ok] | main.rs:21:13:21:21 | a.clone() [Ok] | provenance | generated | | main.rs:21:13:21:21 | a.clone() [Ok] | main.rs:21:9:21:9 | b [Ok] | provenance | | | main.rs:26:9:26:9 | a | main.rs:27:10:27:10 | a | provenance | | @@ -64,8 +67,8 @@ edges | main.rs:69:18:69:23 | TuplePat [tuple.1] | main.rs:69:22:69:22 | m | provenance | | | main.rs:69:22:69:22 | m | main.rs:71:22:71:22 | m | provenance | | | main.rs:92:29:92:29 | [post] y [&ref] | main.rs:93:33:93:33 | y [&ref] | provenance | | -| main.rs:92:32:92:41 | source(...) | main.rs:92:29:92:29 | [post] y [&ref] | provenance | MaD:13 | -| main.rs:93:33:93:33 | y [&ref] | main.rs:93:18:93:34 | ...::read(...) | provenance | MaD:12 | +| main.rs:92:32:92:41 | source(...) | main.rs:92:29:92:29 | [post] y [&ref] | provenance | MaD:16 | +| main.rs:93:33:93:33 | y [&ref] | main.rs:93:18:93:34 | ...::read(...) | provenance | MaD:15 | | main.rs:108:13:108:17 | mut i | main.rs:109:34:109:34 | i | provenance | | | main.rs:108:13:108:17 | mut i | main.rs:110:33:110:33 | i | provenance | | | main.rs:108:13:108:17 | mut i | main.rs:111:47:111:47 | i | provenance | | @@ -76,26 +79,42 @@ edges | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | main.rs:115:31:115:34 | pin1 [Pin, &ref] | provenance | | | main.rs:109:24:109:35 | ...::new(...) [&ref] | main.rs:109:13:109:20 | mut pin1 [&ref] | provenance | | | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | provenance | | -| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [&ref] | provenance | MaD:11 | -| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:5 | +| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [&ref] | provenance | MaD:13 | +| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:6 | | main.rs:109:34:109:34 | i | main.rs:109:33:109:34 | &i [&ref] | provenance | | | main.rs:110:13:110:20 | mut pin2 [&ref] | main.rs:116:15:116:18 | pin2 [&ref] | provenance | | | main.rs:110:24:110:34 | ...::pin(...) [&ref] | main.rs:110:13:110:20 | mut pin2 [&ref] | provenance | | -| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [&ref] | provenance | MaD:9 | +| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [&ref] | provenance | MaD:10 | | main.rs:111:13:111:20 | mut pin3 [&ref] | main.rs:117:15:117:18 | pin3 [&ref] | provenance | | | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | main.rs:111:13:111:20 | mut pin3 [&ref] | provenance | | -| main.rs:111:38:111:48 | ...::new(...) [&ref] | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | provenance | MaD:7 | -| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [&ref] | provenance | MaD:8 | +| main.rs:111:38:111:48 | ...::new(...) [&ref] | main.rs:111:24:111:49 | ...::into_pin(...) [&ref] | provenance | MaD:8 | +| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [&ref] | provenance | MaD:9 | | main.rs:114:15:114:18 | pin1 [&ref] | main.rs:114:14:114:18 | * ... | provenance | | | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | main.rs:115:14:115:35 | * ... | provenance | | -| main.rs:115:31:115:34 | pin1 [&ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:10 | +| main.rs:115:31:115:34 | pin1 [&ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:11 | | main.rs:115:31:115:34 | pin1 [Pin, &ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:4 | | main.rs:116:15:116:18 | pin2 [&ref] | main.rs:116:14:116:18 | * ... | provenance | | | main.rs:117:15:117:18 | pin3 [&ref] | main.rs:117:14:117:18 | * ... | provenance | | +| main.rs:122:13:122:18 | mut ms [MyStruct] | main.rs:123:34:123:35 | ms [MyStruct] | provenance | | | main.rs:122:13:122:18 | mut ms [MyStruct] | main.rs:127:14:127:15 | ms [MyStruct] | provenance | | | main.rs:122:22:122:49 | MyStruct {...} [MyStruct] | main.rs:122:13:122:18 | mut ms [MyStruct] | provenance | | | main.rs:122:38:122:47 | source(...) | main.rs:122:22:122:49 | MyStruct {...} [MyStruct] | provenance | | +| main.rs:123:13:123:20 | mut pin1 [MyStruct] | main.rs:129:30:129:33 | pin1 [MyStruct] | provenance | | +| main.rs:123:24:123:36 | ...::new(...) [MyStruct] | main.rs:123:13:123:20 | mut pin1 [MyStruct] | provenance | | +| main.rs:123:33:123:35 | &ms [&ref, MyStruct] | main.rs:123:24:123:36 | ...::new(...) [MyStruct] | provenance | MaD:5 | +| main.rs:123:34:123:35 | ms [MyStruct] | main.rs:123:33:123:35 | &ms [&ref, MyStruct] | provenance | | | main.rs:127:14:127:15 | ms [MyStruct] | main.rs:127:14:127:19 | ms.val | provenance | | +| main.rs:129:14:129:34 | ...::into_inner(...) [MyStruct] | main.rs:129:14:129:38 | ... .val | provenance | | +| main.rs:129:30:129:33 | pin1 [MyStruct] | main.rs:129:14:129:34 | ...::into_inner(...) [MyStruct] | provenance | MaD:11 | +| main.rs:136:13:136:18 | mut ms [MyStruct] | main.rs:137:44:137:45 | ms [MyStruct] | provenance | | +| main.rs:136:22:136:49 | MyStruct {...} [MyStruct] | main.rs:136:13:136:18 | mut ms [MyStruct] | provenance | | +| main.rs:136:38:136:47 | source(...) | main.rs:136:22:136:49 | MyStruct {...} [MyStruct] | provenance | | +| main.rs:137:13:137:20 | mut pin5 [MyStruct] | main.rs:139:40:139:43 | pin5 [MyStruct] | provenance | | +| main.rs:137:24:137:46 | ...::new_unchecked(...) [MyStruct] | main.rs:137:13:137:20 | mut pin5 [MyStruct] | provenance | | +| main.rs:137:43:137:45 | &ms [&ref, MyStruct] | main.rs:137:24:137:46 | ...::new_unchecked(...) [MyStruct] | provenance | MaD:14 | +| main.rs:137:44:137:45 | ms [MyStruct] | main.rs:137:43:137:45 | &ms [&ref, MyStruct] | provenance | | +| main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [MyStruct] | main.rs:139:14:139:48 | ... .val | provenance | | +| main.rs:139:40:139:43 | pin5 [MyStruct] | main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [MyStruct] | provenance | MaD:12 | nodes | main.rs:12:9:12:9 | a [Some] | semmle.label | a [Some] | | main.rs:12:13:12:28 | Some(...) [Some] | semmle.label | Some(...) [Some] | @@ -183,8 +202,25 @@ nodes | main.rs:122:13:122:18 | mut ms [MyStruct] | semmle.label | mut ms [MyStruct] | | main.rs:122:22:122:49 | MyStruct {...} [MyStruct] | semmle.label | MyStruct {...} [MyStruct] | | main.rs:122:38:122:47 | source(...) | semmle.label | source(...) | +| main.rs:123:13:123:20 | mut pin1 [MyStruct] | semmle.label | mut pin1 [MyStruct] | +| main.rs:123:24:123:36 | ...::new(...) [MyStruct] | semmle.label | ...::new(...) [MyStruct] | +| main.rs:123:33:123:35 | &ms [&ref, MyStruct] | semmle.label | &ms [&ref, MyStruct] | +| main.rs:123:34:123:35 | ms [MyStruct] | semmle.label | ms [MyStruct] | | main.rs:127:14:127:15 | ms [MyStruct] | semmle.label | ms [MyStruct] | | main.rs:127:14:127:19 | ms.val | semmle.label | ms.val | +| main.rs:129:14:129:34 | ...::into_inner(...) [MyStruct] | semmle.label | ...::into_inner(...) [MyStruct] | +| main.rs:129:14:129:38 | ... .val | semmle.label | ... .val | +| main.rs:129:30:129:33 | pin1 [MyStruct] | semmle.label | pin1 [MyStruct] | +| main.rs:136:13:136:18 | mut ms [MyStruct] | semmle.label | mut ms [MyStruct] | +| main.rs:136:22:136:49 | MyStruct {...} [MyStruct] | semmle.label | MyStruct {...} [MyStruct] | +| main.rs:136:38:136:47 | source(...) | semmle.label | source(...) | +| main.rs:137:13:137:20 | mut pin5 [MyStruct] | semmle.label | mut pin5 [MyStruct] | +| main.rs:137:24:137:46 | ...::new_unchecked(...) [MyStruct] | semmle.label | ...::new_unchecked(...) [MyStruct] | +| main.rs:137:43:137:45 | &ms [&ref, MyStruct] | semmle.label | &ms [&ref, MyStruct] | +| main.rs:137:44:137:45 | ms [MyStruct] | semmle.label | ms [MyStruct] | +| main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [MyStruct] | semmle.label | ...::into_inner_unchecked(...) [MyStruct] | +| main.rs:139:14:139:48 | ... .val | semmle.label | ... .val | +| main.rs:139:40:139:43 | pin5 [MyStruct] | semmle.label | pin5 [MyStruct] | subpaths | main.rs:50:15:50:15 | w [Wrapper] | main.rs:43:18:43:22 | SelfParam [Wrapper] | main.rs:43:33:45:9 | { ... } [Wrapper] | main.rs:53:17:53:25 | w.clone() [Wrapper] | testFailures @@ -205,3 +241,5 @@ testFailures | main.rs:116:14:116:18 | * ... | main.rs:108:21:108:30 | source(...) | main.rs:116:14:116:18 | * ... | $@ | main.rs:108:21:108:30 | source(...) | source(...) | | main.rs:117:14:117:18 | * ... | main.rs:108:21:108:30 | source(...) | main.rs:117:14:117:18 | * ... | $@ | main.rs:108:21:108:30 | source(...) | source(...) | | main.rs:127:14:127:19 | ms.val | main.rs:122:38:122:47 | source(...) | main.rs:127:14:127:19 | ms.val | $@ | main.rs:122:38:122:47 | source(...) | source(...) | +| main.rs:129:14:129:38 | ... .val | main.rs:122:38:122:47 | source(...) | main.rs:129:14:129:38 | ... .val | $@ | main.rs:122:38:122:47 | source(...) | source(...) | +| main.rs:139:14:139:48 | ... .val | main.rs:136:38:136:47 | source(...) | main.rs:139:14:139:48 | ... .val | $@ | main.rs:136:38:136:47 | source(...) | source(...) | diff --git a/rust/ql/test/library-tests/dataflow/modeled/main.rs b/rust/ql/test/library-tests/dataflow/modeled/main.rs index 567fe9c59c7..66a92878226 100644 --- a/rust/ql/test/library-tests/dataflow/modeled/main.rs +++ b/rust/ql/test/library-tests/dataflow/modeled/main.rs @@ -95,8 +95,8 @@ mod ptr { } } -use std::pin::Pin; use std::pin::pin; +use std::pin::Pin; #[derive(Clone)] struct MyStruct { @@ -126,7 +126,7 @@ fn test_pin() { let mut pin4 = pin!(&ms); sink(ms.val); // $ hasValueFlow=41 sink(pin1.val); // $ MISSING: hasValueFlow=41 - sink(Pin::into_inner(pin1).val); // $ MISSING: hasValueFlow=41 + sink(Pin::into_inner(pin1).val); // $ hasValueFlow=41 sink(pin2.val); // $ MISSING: hasValueFlow=41 sink(pin3.val); // $ MISSING: hasValueFlow=41 sink(pin4.val); // $ MISSING: hasValueFlow=41 @@ -136,7 +136,7 @@ fn test_pin() { let mut ms = MyStruct { val: source(42) }; let mut pin5 = Pin::new_unchecked(&ms); sink(pin5.val); // $ MISSING: hasValueFlow=42 - sink(Pin::into_inner_unchecked(pin5).val); // $ MISSING: hasValueFlow=42 + sink(Pin::into_inner_unchecked(pin5).val); // $ hasValueFlow=42 } { diff --git a/rust/ql/test/library-tests/frameworks/postgres/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/frameworks/postgres/CONSISTENCY/PathResolutionConsistency.expected new file mode 100644 index 00000000000..8c8a9767934 --- /dev/null +++ b/rust/ql/test/library-tests/frameworks/postgres/CONSISTENCY/PathResolutionConsistency.expected @@ -0,0 +1,7 @@ +multipleCallTargets +| main.rs:22:18:22:31 | query.as_str() | +| main.rs:23:24:23:37 | query.as_str() | +| main.rs:25:18:25:31 | query.as_str() | +| main.rs:28:16:28:29 | query.as_str() | +| main.rs:29:20:29:33 | query.as_str() | +| main.rs:30:20:30:33 | query.as_str() | diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index dad278eaddc..a9cc146bc09 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -1971,7 +1971,7 @@ mod indexers { mod macros { pub fn f() { - let x = format!("Hello, {}", "World!"); // $ MISSING: type=x:String -- needs https://github.com/github/codeql/pull/19658 + let x = format!("Hello, {}", "World!"); // $ type=x:String } } @@ -2229,15 +2229,15 @@ mod loops { let vals4b = [1u16, 2, 3].to_vec(); // $ MISSING: type=vals4b:Vec type=vals4b:T.u16 for u in vals4b {} // $ MISSING: type=u:u16 - let vals5 = Vec::from([1u32, 2, 3]); // $ type=vals5:Vec method=from MISSING: type=vals5:T.u32 - for u in vals5 {} // $ MISSING: type=u:u32 + let vals5 = Vec::from([1u32, 2, 3]); // $ type=vals5:Vec method=from type=vals5:T.u32 + for u in vals5 {} // $ type=u:u32 let vals6: Vec<&u64> = [1u64, 2, 3].iter().collect(); // $ type=vals6:Vec type=vals6:T.&T.u64 for u in vals6 {} // $ type=u:&T.u64 - let mut vals7 = Vec::new(); // $ method=new type=vals7:Vec MISSING: type=vals7:T.u8 + let mut vals7 = Vec::new(); // $ method=new type=vals7:Vec type=vals7:T.u8 vals7.push(1u8); // $ method=push - for u in vals7 {} // $ MISSING: type=u:u8 + for u in vals7 {} // $ type=u:u8 let matrix1 = vec![vec![1, 2], vec![3, 4]]; // $ MISSING: type=matrix1:Vec type=matrix1:T.Vec type=matrix1:T.T.i32 #[rustfmt::skip] @@ -2246,7 +2246,7 @@ mod loops { } }; - let mut map1 = std::collections::HashMap::new(); // $ method=new $ MISSING: type=map1:Hashmap type=map1:K.i32 type=map1:V.Box type1=map1:V.T.&T.str + let mut map1 = std::collections::HashMap::new(); // $ method=new type=map1:K.i32 type=map1:V.Box $ MISSING: type=map1:Hashmap type1=map1:V.T.&T.str map1.insert(1, Box::new("one")); // $ method=insert method=new map1.insert(2, Box::new("two")); // $ method=insert method=new for key in map1.keys() {} // $ method=keys MISSING: type=key:i32 diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index d1119f6e71f..21cb6d0f785 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -164,6 +164,8 @@ inferType | main.rs:26:30:26:30 | S | | main.rs:2:5:3:13 | S | | main.rs:27:18:27:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:27:18:27:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:27:18:27:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:27:18:27:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:27:26:27:26 | x | | main.rs:5:5:8:5 | MyThing | | main.rs:27:26:27:28 | x.a | | main.rs:2:5:3:13 | S | | main.rs:30:29:30:29 | x | | main.rs:16:5:19:5 | GenericThing | @@ -174,6 +176,8 @@ inferType | main.rs:31:17:31:19 | x.a | | {EXTERNAL LOCATION} | bool | | main.rs:32:18:32:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:32:18:32:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:32:18:32:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:32:18:32:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:32:26:32:26 | a | | {EXTERNAL LOCATION} | bool | | main.rs:37:13:37:13 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:37:13:37:13 | x | A | main.rs:2:5:3:13 | S | @@ -182,6 +186,8 @@ inferType | main.rs:37:40:37:40 | S | | main.rs:2:5:3:13 | S | | main.rs:38:18:38:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:38:18:38:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:38:18:38:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:38:18:38:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:38:26:38:26 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:38:26:38:26 | x | A | main.rs:2:5:3:13 | S | | main.rs:38:26:38:28 | x.a | | main.rs:2:5:3:13 | S | @@ -192,6 +198,8 @@ inferType | main.rs:41:35:41:35 | S | | main.rs:2:5:3:13 | S | | main.rs:42:18:42:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:42:18:42:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:42:18:42:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:42:18:42:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:42:26:42:26 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:42:26:42:26 | x | A | main.rs:2:5:3:13 | S | | main.rs:42:26:42:28 | x.a | | main.rs:2:5:3:13 | S | @@ -201,6 +209,8 @@ inferType | main.rs:47:16:47:33 | ...::MyNone(...) | T | main.rs:2:5:3:13 | S | | main.rs:49:18:49:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:49:18:49:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:49:18:49:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:49:18:49:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:49:26:49:26 | x | | main.rs:21:5:23:5 | OptionS | | main.rs:49:26:49:28 | x.a | | main.rs:10:5:14:5 | MyOption | | main.rs:49:26:49:28 | x.a | T | main.rs:2:5:3:13 | S | @@ -214,6 +224,8 @@ inferType | main.rs:53:16:53:33 | ...::MyNone(...) | T | main.rs:2:5:3:13 | S | | main.rs:55:18:55:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:55:18:55:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:55:18:55:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:55:18:55:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:55:26:55:26 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:55:26:55:26 | x | A | main.rs:10:5:14:5 | MyOption | | main.rs:55:26:55:26 | x | A.T | main.rs:2:5:3:13 | S | @@ -236,6 +248,8 @@ inferType | main.rs:61:30:61:32 | x.a | T | main.rs:2:5:3:13 | S | | main.rs:62:18:62:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:62:18:62:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:62:18:62:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:62:18:62:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:62:26:62:26 | a | | main.rs:10:5:14:5 | MyOption | | main.rs:62:26:62:26 | a | T | main.rs:2:5:3:13 | S | | main.rs:75:19:75:22 | SelfParam | | main.rs:72:5:72:21 | Foo | @@ -247,6 +261,8 @@ inferType | main.rs:84:23:89:5 | { ... } | | main.rs:72:5:72:21 | Foo | | main.rs:85:18:85:33 | "main.rs::m1::f\\n" | | file://:0:0:0:0 | & | | main.rs:85:18:85:33 | "main.rs::m1::f\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:85:18:85:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:85:18:85:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:86:13:86:13 | x | | main.rs:72:5:72:21 | Foo | | main.rs:86:17:86:22 | Foo {...} | | main.rs:72:5:72:21 | Foo | | main.rs:87:13:87:13 | y | | main.rs:72:5:72:21 | Foo | @@ -257,6 +273,8 @@ inferType | main.rs:91:37:95:5 | { ... } | | main.rs:72:5:72:21 | Foo | | main.rs:92:18:92:33 | "main.rs::m1::g\\n" | | file://:0:0:0:0 | & | | main.rs:92:18:92:33 | "main.rs::m1::g\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:92:18:92:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:92:18:92:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:93:9:93:9 | x | | main.rs:72:5:72:21 | Foo | | main.rs:93:9:93:14 | x.m1() | | main.rs:72:5:72:21 | Foo | | main.rs:94:9:94:9 | y | | main.rs:72:5:72:21 | Foo | @@ -311,21 +329,29 @@ inferType | main.rs:157:30:157:31 | S2 | | main.rs:132:5:133:14 | S2 | | main.rs:160:18:160:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:160:18:160:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:160:18:160:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:160:18:160:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:160:26:160:26 | x | | main.rs:125:5:128:5 | MyThing | | main.rs:160:26:160:26 | x | A | main.rs:130:5:131:14 | S1 | | main.rs:160:26:160:28 | x.a | | main.rs:130:5:131:14 | S1 | | main.rs:161:18:161:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:161:18:161:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:161:18:161:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:161:18:161:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:161:26:161:26 | y | | main.rs:125:5:128:5 | MyThing | | main.rs:161:26:161:26 | y | A | main.rs:132:5:133:14 | S2 | | main.rs:161:26:161:28 | y.a | | main.rs:132:5:133:14 | S2 | | main.rs:163:18:163:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:163:18:163:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:163:18:163:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:163:18:163:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:163:26:163:26 | x | | main.rs:125:5:128:5 | MyThing | | main.rs:163:26:163:26 | x | A | main.rs:130:5:131:14 | S1 | | main.rs:163:26:163:31 | x.m1() | | main.rs:130:5:131:14 | S1 | | main.rs:164:18:164:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:164:18:164:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:164:18:164:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:164:18:164:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:164:26:164:26 | y | | main.rs:125:5:128:5 | MyThing | | main.rs:164:26:164:26 | y | A | main.rs:132:5:133:14 | S2 | | main.rs:164:26:164:31 | y.m1() | | main.rs:125:5:128:5 | MyThing | @@ -343,11 +369,15 @@ inferType | main.rs:167:30:167:31 | S2 | | main.rs:132:5:133:14 | S2 | | main.rs:169:18:169:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:169:18:169:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:169:18:169:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:169:18:169:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:169:26:169:26 | x | | main.rs:125:5:128:5 | MyThing | | main.rs:169:26:169:26 | x | A | main.rs:130:5:131:14 | S1 | | main.rs:169:26:169:31 | x.m2() | | main.rs:130:5:131:14 | S1 | | main.rs:170:18:170:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:170:18:170:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:170:18:170:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:170:18:170:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:170:26:170:26 | y | | main.rs:125:5:128:5 | MyThing | | main.rs:170:26:170:26 | y | A | main.rs:132:5:133:14 | S2 | | main.rs:170:26:170:31 | y.m2() | | main.rs:132:5:133:14 | S2 | @@ -488,11 +518,15 @@ inferType | main.rs:325:37:325:38 | S3 | | main.rs:190:5:191:14 | S3 | | main.rs:329:18:329:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:329:18:329:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:329:18:329:38 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:329:18:329:38 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:329:26:329:33 | thing_s1 | | main.rs:175:5:178:5 | MyThing | | main.rs:329:26:329:33 | thing_s1 | A | main.rs:186:5:187:14 | S1 | | main.rs:329:26:329:38 | thing_s1.m1() | | main.rs:186:5:187:14 | S1 | | main.rs:330:18:330:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:330:18:330:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:330:18:330:40 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:330:18:330:40 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:330:26:330:33 | thing_s2 | | main.rs:175:5:178:5 | MyThing | | main.rs:330:26:330:33 | thing_s2 | A | main.rs:188:5:189:14 | S2 | | main.rs:330:26:330:38 | thing_s2.m1() | | main.rs:175:5:178:5 | MyThing | @@ -504,6 +538,8 @@ inferType | main.rs:331:22:331:34 | thing_s3.m1() | | main.rs:190:5:191:14 | S3 | | main.rs:332:18:332:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:332:18:332:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:332:18:332:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:332:18:332:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:332:26:332:27 | s3 | | main.rs:190:5:191:14 | S3 | | main.rs:334:13:334:14 | p1 | | main.rs:180:5:184:5 | MyPair | | main.rs:334:13:334:14 | p1 | P1 | main.rs:186:5:187:14 | S1 | @@ -515,6 +551,8 @@ inferType | main.rs:334:39:334:40 | S1 | | main.rs:186:5:187:14 | S1 | | main.rs:335:18:335:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:335:18:335:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:335:18:335:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:335:18:335:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:335:26:335:27 | p1 | | main.rs:180:5:184:5 | MyPair | | main.rs:335:26:335:27 | p1 | P1 | main.rs:186:5:187:14 | S1 | | main.rs:335:26:335:27 | p1 | P2 | main.rs:186:5:187:14 | S1 | @@ -529,6 +567,8 @@ inferType | main.rs:337:39:337:40 | S2 | | main.rs:188:5:189:14 | S2 | | main.rs:338:18:338:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:338:18:338:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:338:18:338:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:338:18:338:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:338:26:338:27 | p2 | | main.rs:180:5:184:5 | MyPair | | main.rs:338:26:338:27 | p2 | P1 | main.rs:186:5:187:14 | S1 | | main.rs:338:26:338:27 | p2 | P2 | main.rs:188:5:189:14 | S2 | @@ -547,6 +587,8 @@ inferType | main.rs:342:17:342:18 | S3 | | main.rs:190:5:191:14 | S3 | | main.rs:344:18:344:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:344:18:344:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:344:18:344:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:344:18:344:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:344:26:344:27 | p3 | | main.rs:180:5:184:5 | MyPair | | main.rs:344:26:344:27 | p3 | P1 | main.rs:175:5:178:5 | MyThing | | main.rs:344:26:344:27 | p3 | P1.A | main.rs:186:5:187:14 | S1 | @@ -567,6 +609,8 @@ inferType | main.rs:348:17:348:23 | a.fst() | | main.rs:186:5:187:14 | S1 | | main.rs:349:18:349:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:349:18:349:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:349:18:349:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:349:18:349:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:349:26:349:26 | x | | main.rs:186:5:187:14 | S1 | | main.rs:350:13:350:13 | y | | main.rs:186:5:187:14 | S1 | | main.rs:350:17:350:17 | a | | main.rs:180:5:184:5 | MyPair | @@ -575,6 +619,8 @@ inferType | main.rs:350:17:350:23 | a.snd() | | main.rs:186:5:187:14 | S1 | | main.rs:351:18:351:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:351:18:351:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:351:18:351:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:351:18:351:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:351:26:351:26 | y | | main.rs:186:5:187:14 | S1 | | main.rs:357:13:357:13 | b | | main.rs:180:5:184:5 | MyPair | | main.rs:357:13:357:13 | b | P1 | main.rs:188:5:189:14 | S2 | @@ -591,6 +637,8 @@ inferType | main.rs:358:17:358:23 | b.fst() | | main.rs:186:5:187:14 | S1 | | main.rs:359:18:359:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:359:18:359:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:359:18:359:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:359:18:359:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:359:26:359:26 | x | | main.rs:186:5:187:14 | S1 | | main.rs:360:13:360:13 | y | | main.rs:188:5:189:14 | S2 | | main.rs:360:17:360:17 | b | | main.rs:180:5:184:5 | MyPair | @@ -599,6 +647,8 @@ inferType | main.rs:360:17:360:23 | b.snd() | | main.rs:188:5:189:14 | S2 | | main.rs:361:18:361:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:361:18:361:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:361:18:361:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:361:18:361:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:361:26:361:26 | y | | main.rs:188:5:189:14 | S2 | | main.rs:365:13:365:13 | x | | main.rs:186:5:187:14 | S1 | | main.rs:365:17:365:39 | call_trait_m1(...) | | main.rs:186:5:187:14 | S1 | @@ -606,6 +656,8 @@ inferType | main.rs:365:31:365:38 | thing_s1 | A | main.rs:186:5:187:14 | S1 | | main.rs:366:18:366:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:366:18:366:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:366:18:366:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:366:18:366:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:366:26:366:26 | x | | main.rs:186:5:187:14 | S1 | | main.rs:367:13:367:13 | y | | main.rs:175:5:178:5 | MyThing | | main.rs:367:13:367:13 | y | A | main.rs:188:5:189:14 | S2 | @@ -615,6 +667,8 @@ inferType | main.rs:367:31:367:38 | thing_s2 | A | main.rs:188:5:189:14 | S2 | | main.rs:368:18:368:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:368:18:368:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:368:18:368:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:368:18:368:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:368:26:368:26 | y | | main.rs:175:5:178:5 | MyThing | | main.rs:368:26:368:26 | y | A | main.rs:188:5:189:14 | S2 | | main.rs:368:26:368:28 | y.a | | main.rs:188:5:189:14 | S2 | @@ -633,6 +687,8 @@ inferType | main.rs:372:25:372:25 | a | P2 | main.rs:186:5:187:14 | S1 | | main.rs:373:18:373:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:373:18:373:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:373:18:373:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:373:18:373:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:373:26:373:26 | x | | main.rs:186:5:187:14 | S1 | | main.rs:374:13:374:13 | y | | main.rs:186:5:187:14 | S1 | | main.rs:374:17:374:26 | get_snd(...) | | main.rs:186:5:187:14 | S1 | @@ -641,6 +697,8 @@ inferType | main.rs:374:25:374:25 | a | P2 | main.rs:186:5:187:14 | S1 | | main.rs:375:18:375:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:375:18:375:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:375:18:375:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:375:18:375:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:375:26:375:26 | y | | main.rs:186:5:187:14 | S1 | | main.rs:378:13:378:13 | b | | main.rs:180:5:184:5 | MyPair | | main.rs:378:13:378:13 | b | P1 | main.rs:188:5:189:14 | S2 | @@ -657,6 +715,8 @@ inferType | main.rs:379:25:379:25 | b | P2 | main.rs:186:5:187:14 | S1 | | main.rs:380:18:380:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:380:18:380:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:380:18:380:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:380:18:380:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:380:26:380:26 | x | | main.rs:186:5:187:14 | S1 | | main.rs:381:13:381:13 | y | | main.rs:188:5:189:14 | S2 | | main.rs:381:17:381:26 | get_snd(...) | | main.rs:188:5:189:14 | S2 | @@ -665,6 +725,8 @@ inferType | main.rs:381:25:381:25 | b | P2 | main.rs:186:5:187:14 | S1 | | main.rs:382:18:382:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:382:18:382:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:382:18:382:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:382:18:382:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:382:26:382:26 | y | | main.rs:188:5:189:14 | S2 | | main.rs:384:13:384:13 | c | | main.rs:180:5:184:5 | MyPair | | main.rs:384:13:384:13 | c | P1 | main.rs:190:5:191:14 | S3 | @@ -771,10 +833,14 @@ inferType | main.rs:490:17:490:18 | S1 | | main.rs:397:5:398:14 | S1 | | main.rs:491:18:491:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:491:18:491:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:491:18:491:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:491:18:491:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:491:26:491:26 | x | | main.rs:397:5:398:14 | S1 | | main.rs:491:26:491:42 | x.common_method() | | main.rs:397:5:398:14 | S1 | | main.rs:492:18:492:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:492:18:492:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:492:18:492:44 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:492:18:492:44 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:492:26:492:26 | x | | main.rs:397:5:398:14 | S1 | | main.rs:492:26:492:44 | x.common_method_2() | | main.rs:397:5:398:14 | S1 | | main.rs:494:13:494:13 | y | | main.rs:430:5:430:22 | S2 | @@ -784,6 +850,8 @@ inferType | main.rs:494:20:494:21 | S1 | | main.rs:397:5:398:14 | S1 | | main.rs:495:18:495:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:495:18:495:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:495:18:495:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:495:18:495:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:495:26:495:26 | y | | main.rs:430:5:430:22 | S2 | | main.rs:495:26:495:26 | y | T2 | main.rs:397:5:398:14 | S1 | | main.rs:495:26:495:42 | y.common_method() | | main.rs:397:5:398:14 | S1 | @@ -794,6 +862,8 @@ inferType | main.rs:497:20:497:20 | 0 | | {EXTERNAL LOCATION} | i32 | | main.rs:498:18:498:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:498:18:498:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:498:18:498:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:498:18:498:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:498:26:498:26 | z | | main.rs:430:5:430:22 | S2 | | main.rs:498:26:498:26 | z | T2 | {EXTERNAL LOCATION} | i32 | | main.rs:498:26:498:42 | z.common_method() | | main.rs:397:5:398:14 | S1 | @@ -804,6 +874,8 @@ inferType | main.rs:500:20:500:21 | S1 | | main.rs:397:5:398:14 | S1 | | main.rs:501:18:501:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:501:18:501:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:501:18:501:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:501:18:501:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:501:26:501:26 | w | | main.rs:468:5:469:22 | S3 | | main.rs:501:26:501:26 | w | T3 | main.rs:397:5:398:14 | S1 | | main.rs:501:26:501:31 | w.m(...) | | file://:0:0:0:0 | & | @@ -818,6 +890,8 @@ inferType | main.rs:528:18:528:27 | x.method() | | main.rs:526:35:526:42 | I | | main.rs:529:18:529:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:529:18:529:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:529:18:529:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:529:18:529:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:529:26:529:27 | s1 | | main.rs:526:35:526:42 | I | | main.rs:532:65:532:65 | x | | main.rs:532:46:532:62 | T | | main.rs:534:13:534:14 | s2 | | main.rs:532:36:532:43 | I | @@ -825,6 +899,8 @@ inferType | main.rs:534:18:534:27 | x.method() | | main.rs:532:36:532:43 | I | | main.rs:535:18:535:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:535:18:535:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:535:18:535:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:535:18:535:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:535:26:535:27 | s2 | | main.rs:532:36:532:43 | I | | main.rs:538:49:538:49 | x | | main.rs:538:30:538:46 | T | | main.rs:539:13:539:13 | s | | main.rs:508:5:509:14 | S1 | @@ -832,6 +908,8 @@ inferType | main.rs:539:17:539:26 | x.method() | | main.rs:508:5:509:14 | S1 | | main.rs:540:18:540:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:540:18:540:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:540:18:540:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:540:18:540:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:540:26:540:26 | s | | main.rs:508:5:509:14 | S1 | | main.rs:543:53:543:53 | x | | main.rs:543:34:543:50 | T | | main.rs:544:13:544:13 | s | | main.rs:508:5:509:14 | S1 | @@ -839,6 +917,8 @@ inferType | main.rs:544:17:544:26 | x.method() | | main.rs:508:5:509:14 | S1 | | main.rs:545:18:545:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:545:18:545:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:545:18:545:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:545:18:545:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:545:26:545:26 | s | | main.rs:508:5:509:14 | S1 | | main.rs:549:16:549:19 | SelfParam | | main.rs:548:5:552:5 | Self [trait Pair] | | main.rs:551:16:551:19 | SelfParam | | main.rs:548:5:552:5 | Self [trait Pair] | @@ -852,6 +932,8 @@ inferType | main.rs:557:18:557:24 | y.snd() | | main.rs:511:5:512:14 | S2 | | main.rs:558:18:558:29 | "{:?}, {:?}\\n" | | file://:0:0:0:0 | & | | main.rs:558:18:558:29 | "{:?}, {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:558:18:558:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:558:18:558:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:558:32:558:33 | s1 | | main.rs:508:5:509:14 | S1 | | main.rs:558:36:558:37 | s2 | | main.rs:511:5:512:14 | S2 | | main.rs:561:69:561:69 | x | | main.rs:561:52:561:66 | T | @@ -864,6 +946,8 @@ inferType | main.rs:564:18:564:24 | y.snd() | | main.rs:561:41:561:49 | T2 | | main.rs:565:18:565:29 | "{:?}, {:?}\\n" | | file://:0:0:0:0 | & | | main.rs:565:18:565:29 | "{:?}, {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:565:18:565:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:565:18:565:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:565:32:565:33 | s1 | | main.rs:508:5:509:14 | S1 | | main.rs:565:36:565:37 | s2 | | main.rs:561:41:561:49 | T2 | | main.rs:568:50:568:50 | x | | main.rs:568:41:568:47 | T | @@ -876,6 +960,8 @@ inferType | main.rs:571:18:571:24 | y.snd() | | {EXTERNAL LOCATION} | i64 | | main.rs:572:18:572:29 | "{:?}, {:?}\\n" | | file://:0:0:0:0 | & | | main.rs:572:18:572:29 | "{:?}, {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:572:18:572:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:572:18:572:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:572:32:572:33 | s1 | | {EXTERNAL LOCATION} | bool | | main.rs:572:36:572:37 | s2 | | {EXTERNAL LOCATION} | i64 | | main.rs:575:54:575:54 | x | | main.rs:575:41:575:51 | T | @@ -888,6 +974,8 @@ inferType | main.rs:578:18:578:24 | y.snd() | | {EXTERNAL LOCATION} | i64 | | main.rs:579:18:579:29 | "{:?}, {:?}\\n" | | file://:0:0:0:0 | & | | main.rs:579:18:579:29 | "{:?}, {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:579:18:579:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:579:18:579:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:579:32:579:33 | s1 | | {EXTERNAL LOCATION} | u8 | | main.rs:579:36:579:37 | s2 | | {EXTERNAL LOCATION} | i64 | | main.rs:595:15:595:18 | SelfParam | | main.rs:594:5:603:5 | Self [trait MyTrait] | @@ -924,11 +1012,15 @@ inferType | main.rs:625:30:625:31 | S2 | | main.rs:591:5:592:14 | S2 | | main.rs:627:18:627:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:627:18:627:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:627:18:627:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:627:18:627:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:627:26:627:26 | x | | main.rs:584:5:587:5 | MyThing | | main.rs:627:26:627:26 | x | T | main.rs:589:5:590:14 | S1 | | main.rs:627:26:627:31 | x.m1() | | main.rs:589:5:590:14 | S1 | | main.rs:628:18:628:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:628:18:628:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:628:18:628:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:628:18:628:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:628:26:628:26 | y | | main.rs:584:5:587:5 | MyThing | | main.rs:628:26:628:26 | y | T | main.rs:591:5:592:14 | S2 | | main.rs:628:26:628:31 | y.m1() | | main.rs:591:5:592:14 | S2 | @@ -944,11 +1036,15 @@ inferType | main.rs:631:30:631:31 | S2 | | main.rs:591:5:592:14 | S2 | | main.rs:633:18:633:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:633:18:633:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:633:18:633:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:633:18:633:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:633:26:633:26 | x | | main.rs:584:5:587:5 | MyThing | | main.rs:633:26:633:26 | x | T | main.rs:589:5:590:14 | S1 | | main.rs:633:26:633:31 | x.m2() | | main.rs:589:5:590:14 | S1 | | main.rs:634:18:634:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:634:18:634:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:634:18:634:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:634:18:634:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:634:26:634:26 | y | | main.rs:584:5:587:5 | MyThing | | main.rs:634:26:634:26 | y | T | main.rs:591:5:592:14 | S2 | | main.rs:634:26:634:31 | y.m2() | | main.rs:591:5:592:14 | S2 | @@ -964,11 +1060,15 @@ inferType | main.rs:637:31:637:32 | S2 | | main.rs:591:5:592:14 | S2 | | main.rs:639:18:639:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:639:18:639:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:639:18:639:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:639:18:639:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:639:26:639:42 | call_trait_m1(...) | | main.rs:589:5:590:14 | S1 | | main.rs:639:40:639:41 | x2 | | main.rs:584:5:587:5 | MyThing | | main.rs:639:40:639:41 | x2 | T | main.rs:589:5:590:14 | S1 | | main.rs:640:18:640:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:640:18:640:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:640:18:640:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:640:18:640:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:640:26:640:42 | call_trait_m1(...) | | main.rs:591:5:592:14 | S2 | | main.rs:640:40:640:41 | y2 | | main.rs:584:5:587:5 | MyThing | | main.rs:640:40:640:41 | y2 | T | main.rs:591:5:592:14 | S2 | @@ -997,6 +1097,8 @@ inferType | main.rs:649:37:649:38 | x3 | T.T | main.rs:589:5:590:14 | S1 | | main.rs:650:18:650:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:650:18:650:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:650:18:650:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:650:18:650:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:650:26:650:26 | a | | main.rs:589:5:590:14 | S1 | | main.rs:651:13:651:13 | b | | main.rs:591:5:592:14 | S2 | | main.rs:651:17:651:39 | call_trait_thing_m1(...) | | main.rs:591:5:592:14 | S2 | @@ -1005,6 +1107,8 @@ inferType | main.rs:651:37:651:38 | y3 | T.T | main.rs:591:5:592:14 | S2 | | main.rs:652:18:652:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:652:18:652:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:652:18:652:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:652:18:652:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:652:26:652:26 | b | | main.rs:591:5:592:14 | S2 | | main.rs:663:19:663:22 | SelfParam | | main.rs:657:5:660:5 | Wrapper | | main.rs:663:19:663:22 | SelfParam | A | main.rs:662:10:662:10 | A | @@ -1080,6 +1184,8 @@ inferType | main.rs:776:18:776:18 | S | | main.rs:708:5:709:13 | S | | main.rs:778:18:778:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:778:18:778:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:778:18:778:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:778:18:778:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:778:26:778:27 | x1 | | main.rs:708:5:709:13 | S | | main.rs:778:26:778:32 | x1.m1() | | main.rs:714:5:715:14 | AT | | main.rs:780:13:780:14 | x2 | | main.rs:708:5:709:13 | S | @@ -1089,11 +1195,15 @@ inferType | main.rs:782:17:782:23 | x2.m2() | | main.rs:714:5:715:14 | AT | | main.rs:783:18:783:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:783:18:783:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:783:18:783:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:783:18:783:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:783:26:783:26 | y | | main.rs:714:5:715:14 | AT | | main.rs:785:13:785:14 | x3 | | main.rs:708:5:709:13 | S | | main.rs:785:18:785:18 | S | | main.rs:708:5:709:13 | S | | main.rs:787:18:787:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:787:18:787:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:787:18:787:43 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:787:18:787:43 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:787:26:787:27 | x3 | | main.rs:708:5:709:13 | S | | main.rs:787:26:787:34 | x3.put(...) | | main.rs:657:5:660:5 | Wrapper | | main.rs:787:26:787:34 | x3.put(...) | A | {EXTERNAL LOCATION} | i32 | @@ -1101,6 +1211,8 @@ inferType | main.rs:787:33:787:33 | 1 | | {EXTERNAL LOCATION} | i32 | | main.rs:790:18:790:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:790:18:790:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:790:18:790:49 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:790:18:790:49 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:790:26:790:27 | x3 | | main.rs:708:5:709:13 | S | | main.rs:790:26:790:40 | x3.putTwo(...) | | main.rs:657:5:660:5 | Wrapper | | main.rs:790:26:790:40 | x3.putTwo(...) | A | main.rs:728:36:728:50 | AssociatedParam | @@ -1110,10 +1222,14 @@ inferType | main.rs:792:20:792:20 | S | | main.rs:708:5:709:13 | S | | main.rs:793:18:793:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:793:18:793:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:793:18:793:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:793:18:793:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:795:13:795:14 | x5 | | main.rs:711:5:712:14 | S2 | | main.rs:795:18:795:19 | S2 | | main.rs:711:5:712:14 | S2 | | main.rs:796:18:796:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:796:18:796:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:796:18:796:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:796:18:796:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:796:26:796:27 | x5 | | main.rs:711:5:712:14 | S2 | | main.rs:796:26:796:32 | x5.m1() | | main.rs:657:5:660:5 | Wrapper | | main.rs:796:26:796:32 | x5.m1() | A | main.rs:711:5:712:14 | S2 | @@ -1121,6 +1237,8 @@ inferType | main.rs:797:18:797:19 | S2 | | main.rs:711:5:712:14 | S2 | | main.rs:798:18:798:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:798:18:798:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:798:18:798:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:798:18:798:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:798:26:798:27 | x6 | | main.rs:711:5:712:14 | S2 | | main.rs:798:26:798:32 | x6.m2() | | main.rs:657:5:660:5 | Wrapper | | main.rs:798:26:798:32 | x6.m2() | A | main.rs:711:5:712:14 | S2 | @@ -1155,11 +1273,15 @@ inferType | main.rs:829:33:829:34 | S2 | | main.rs:815:5:816:14 | S2 | | main.rs:831:18:831:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:831:18:831:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:831:18:831:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:831:18:831:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:831:26:831:26 | x | | main.rs:807:5:811:5 | MyEnum | | main.rs:831:26:831:26 | x | A | main.rs:813:5:814:14 | S1 | | main.rs:831:26:831:31 | x.m1() | | main.rs:813:5:814:14 | S1 | | main.rs:832:18:832:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:832:18:832:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:832:18:832:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:832:18:832:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:832:26:832:26 | y | | main.rs:807:5:811:5 | MyEnum | | main.rs:832:26:832:26 | y | A | main.rs:815:5:816:14 | S2 | | main.rs:832:26:832:31 | y.m1() | | main.rs:815:5:816:14 | S2 | @@ -1219,6 +1341,8 @@ inferType | main.rs:911:17:911:22 | x.m1() | A | main.rs:847:5:848:14 | S1 | | main.rs:912:18:912:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:912:18:912:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:912:18:912:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:912:18:912:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:912:26:912:26 | a | | main.rs:837:5:840:5 | MyThing | | main.rs:912:26:912:26 | a | A | main.rs:847:5:848:14 | S1 | | main.rs:916:13:916:13 | x | | main.rs:837:5:840:5 | MyThing | @@ -1233,11 +1357,15 @@ inferType | main.rs:917:30:917:31 | S2 | | main.rs:849:5:850:14 | S2 | | main.rs:919:18:919:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:919:18:919:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:919:18:919:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:919:18:919:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:919:26:919:26 | x | | main.rs:837:5:840:5 | MyThing | | main.rs:919:26:919:26 | x | A | main.rs:847:5:848:14 | S1 | | main.rs:919:26:919:31 | x.m1() | | main.rs:847:5:848:14 | S1 | | main.rs:920:18:920:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:920:18:920:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:920:18:920:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:920:18:920:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:920:26:920:26 | y | | main.rs:837:5:840:5 | MyThing | | main.rs:920:26:920:26 | y | A | main.rs:849:5:850:14 | S2 | | main.rs:920:26:920:31 | y.m1() | | main.rs:849:5:850:14 | S2 | @@ -1253,11 +1381,15 @@ inferType | main.rs:923:30:923:31 | S2 | | main.rs:849:5:850:14 | S2 | | main.rs:925:18:925:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:925:18:925:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:925:18:925:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:925:18:925:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:925:26:925:26 | x | | main.rs:837:5:840:5 | MyThing | | main.rs:925:26:925:26 | x | A | main.rs:847:5:848:14 | S1 | | main.rs:925:26:925:31 | x.m2() | | main.rs:847:5:848:14 | S1 | | main.rs:926:18:926:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:926:18:926:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:926:18:926:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:926:18:926:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:926:26:926:26 | y | | main.rs:837:5:840:5 | MyThing | | main.rs:926:26:926:26 | y | A | main.rs:849:5:850:14 | S2 | | main.rs:926:26:926:31 | y.m2() | | main.rs:849:5:850:14 | S2 | @@ -1273,11 +1405,15 @@ inferType | main.rs:929:31:929:32 | S2 | | main.rs:849:5:850:14 | S2 | | main.rs:931:18:931:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:931:18:931:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:931:18:931:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:931:18:931:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:931:26:931:26 | x | | main.rs:842:5:845:5 | MyThing2 | | main.rs:931:26:931:26 | x | A | main.rs:847:5:848:14 | S1 | | main.rs:931:26:931:31 | x.m3() | | main.rs:847:5:848:14 | S1 | | main.rs:932:18:932:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:932:18:932:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:932:18:932:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:932:18:932:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:932:26:932:26 | y | | main.rs:842:5:845:5 | MyThing2 | | main.rs:932:26:932:26 | y | A | main.rs:849:5:850:14 | S2 | | main.rs:932:26:932:31 | y.m3() | | main.rs:849:5:850:14 | S2 | @@ -1318,6 +1454,8 @@ inferType | main.rs:973:17:973:18 | S1 | | main.rs:945:5:946:14 | S1 | | main.rs:974:18:974:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:974:18:974:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:974:18:974:31 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:974:18:974:31 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:974:26:974:31 | id(...) | | file://:0:0:0:0 | & | | main.rs:974:26:974:31 | id(...) | &T | main.rs:945:5:946:14 | S1 | | main.rs:974:29:974:30 | &x | | file://:0:0:0:0 | & | @@ -1327,6 +1465,8 @@ inferType | main.rs:976:17:976:18 | S1 | | main.rs:945:5:946:14 | S1 | | main.rs:977:18:977:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:977:18:977:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:977:18:977:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:977:18:977:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:977:26:977:37 | id::<...>(...) | | file://:0:0:0:0 | & | | main.rs:977:26:977:37 | id::<...>(...) | &T | main.rs:945:5:946:14 | S1 | | main.rs:977:35:977:36 | &x | | file://:0:0:0:0 | & | @@ -1336,6 +1476,8 @@ inferType | main.rs:979:17:979:18 | S1 | | main.rs:945:5:946:14 | S1 | | main.rs:981:18:981:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:981:18:981:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:981:18:981:44 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:981:18:981:44 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:981:26:981:44 | id::<...>(...) | | file://:0:0:0:0 | & | | main.rs:981:26:981:44 | id::<...>(...) | &T | main.rs:945:5:946:14 | S1 | | main.rs:981:42:981:43 | &x | | file://:0:0:0:0 | & | @@ -1361,11 +1503,15 @@ inferType | main.rs:1003:43:1003:82 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1003:50:1003:81 | "PairNone has no second elemen... | | file://:0:0:0:0 | & | | main.rs:1003:50:1003:81 | "PairNone has no second elemen... | &T | {EXTERNAL LOCATION} | str | +| main.rs:1003:50:1003:81 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1003:50:1003:81 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1003:50:1003:81 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1003:50:1003:81 | { ... } | | main.rs:1000:15:1000:17 | Snd | | main.rs:1004:43:1004:81 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1004:50:1004:80 | "PairFst has no second element... | | file://:0:0:0:0 | & | | main.rs:1004:50:1004:80 | "PairFst has no second element... | &T | {EXTERNAL LOCATION} | str | +| main.rs:1004:50:1004:80 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1004:50:1004:80 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1004:50:1004:80 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1004:50:1004:80 | { ... } | | main.rs:1000:15:1000:17 | Snd | | main.rs:1005:37:1005:39 | snd | | main.rs:1000:15:1000:17 | Snd | @@ -1389,6 +1535,8 @@ inferType | main.rs:1033:17:1033:41 | ... .unwrapSnd() | | main.rs:1017:5:1018:14 | S3 | | main.rs:1034:18:1034:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1034:18:1034:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1034:18:1034:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1034:18:1034:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1034:26:1034:26 | x | | main.rs:1017:5:1018:14 | S3 | | main.rs:1047:13:1047:14 | p1 | | main.rs:992:5:998:5 | PairOption | | main.rs:1047:13:1047:14 | p1 | Fst | main.rs:1011:5:1012:14 | S1 | @@ -1400,6 +1548,8 @@ inferType | main.rs:1047:51:1047:52 | S2 | | main.rs:1014:5:1015:14 | S2 | | main.rs:1048:18:1048:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1048:18:1048:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1048:18:1048:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1048:18:1048:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1048:26:1048:27 | p1 | | main.rs:992:5:998:5 | PairOption | | main.rs:1048:26:1048:27 | p1 | Fst | main.rs:1011:5:1012:14 | S1 | | main.rs:1048:26:1048:27 | p1 | Snd | main.rs:1014:5:1015:14 | S2 | @@ -1411,6 +1561,8 @@ inferType | main.rs:1051:26:1051:47 | ...::PairNone(...) | Snd | main.rs:1014:5:1015:14 | S2 | | main.rs:1052:18:1052:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1052:18:1052:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1052:18:1052:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1052:18:1052:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1052:26:1052:27 | p2 | | main.rs:992:5:998:5 | PairOption | | main.rs:1052:26:1052:27 | p2 | Fst | main.rs:1011:5:1012:14 | S1 | | main.rs:1052:26:1052:27 | p2 | Snd | main.rs:1014:5:1015:14 | S2 | @@ -1423,6 +1575,8 @@ inferType | main.rs:1055:54:1055:55 | S3 | | main.rs:1017:5:1018:14 | S3 | | main.rs:1056:18:1056:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1056:18:1056:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1056:18:1056:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1056:18:1056:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1056:26:1056:27 | p3 | | main.rs:992:5:998:5 | PairOption | | main.rs:1056:26:1056:27 | p3 | Fst | main.rs:1014:5:1015:14 | S2 | | main.rs:1056:26:1056:27 | p3 | Snd | main.rs:1017:5:1018:14 | S3 | @@ -1434,6 +1588,8 @@ inferType | main.rs:1059:35:1059:56 | ...::PairNone(...) | Snd | main.rs:1017:5:1018:14 | S3 | | main.rs:1060:18:1060:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1060:18:1060:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1060:18:1060:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1060:18:1060:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1060:26:1060:27 | p3 | | main.rs:992:5:998:5 | PairOption | | main.rs:1060:26:1060:27 | p3 | Fst | main.rs:1014:5:1015:14 | S2 | | main.rs:1060:26:1060:27 | p3 | Snd | main.rs:1017:5:1018:14 | S3 | @@ -1491,6 +1647,8 @@ inferType | main.rs:1108:18:1108:37 | ...::new(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1109:18:1109:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1109:18:1109:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1109:18:1109:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1109:18:1109:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1109:26:1109:27 | x1 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1109:26:1109:27 | x1 | T | main.rs:1104:5:1105:13 | S | | main.rs:1111:13:1111:18 | mut x2 | | main.rs:1069:5:1073:5 | MyOption | @@ -1502,6 +1660,8 @@ inferType | main.rs:1112:16:1112:16 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1113:18:1113:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1113:18:1113:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1113:18:1113:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1113:18:1113:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1113:26:1113:27 | x2 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1113:26:1113:27 | x2 | T | main.rs:1104:5:1105:13 | S | | main.rs:1116:13:1116:18 | mut x3 | | main.rs:1069:5:1073:5 | MyOption | @@ -1510,6 +1670,8 @@ inferType | main.rs:1117:21:1117:21 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1118:18:1118:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1118:18:1118:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1118:18:1118:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1118:18:1118:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1118:26:1118:27 | x3 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1120:13:1120:18 | mut x4 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1120:13:1120:18 | mut x4 | T | main.rs:1104:5:1105:13 | S | @@ -1523,6 +1685,8 @@ inferType | main.rs:1121:32:1121:32 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1122:18:1122:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1122:18:1122:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1122:18:1122:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1122:18:1122:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1122:26:1122:27 | x4 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1122:26:1122:27 | x4 | T | main.rs:1104:5:1105:13 | S | | main.rs:1124:13:1124:14 | x5 | | main.rs:1069:5:1073:5 | MyOption | @@ -1535,6 +1699,8 @@ inferType | main.rs:1124:35:1124:57 | ...::MyNone(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1125:18:1125:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1125:18:1125:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1125:18:1125:37 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1125:18:1125:37 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1125:26:1125:27 | x5 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1125:26:1125:27 | x5 | T | main.rs:1069:5:1073:5 | MyOption | | main.rs:1125:26:1125:27 | x5 | T.T | main.rs:1104:5:1105:13 | S | @@ -1550,6 +1716,8 @@ inferType | main.rs:1127:35:1127:57 | ...::MyNone(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1128:18:1128:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1128:18:1128:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1128:18:1128:61 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1128:18:1128:61 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1128:26:1128:61 | ...::flatten(...) | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1128:26:1128:61 | ...::flatten(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1128:59:1128:60 | x6 | | main.rs:1069:5:1073:5 | MyOption | @@ -1573,6 +1741,8 @@ inferType | main.rs:1134:30:1134:30 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1136:18:1136:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1136:18:1136:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1136:18:1136:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1136:18:1136:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1136:26:1136:32 | from_if | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1136:26:1136:32 | from_if | T | main.rs:1104:5:1105:13 | S | | main.rs:1139:13:1139:22 | from_match | | main.rs:1069:5:1073:5 | MyOption | @@ -1591,6 +1761,8 @@ inferType | main.rs:1141:39:1141:39 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1143:18:1143:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1143:18:1143:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1143:18:1143:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1143:18:1143:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1143:26:1143:35 | from_match | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1143:26:1143:35 | from_match | T | main.rs:1104:5:1105:13 | S | | main.rs:1146:13:1146:21 | from_loop | | main.rs:1069:5:1073:5 | MyOption | @@ -1607,6 +1779,8 @@ inferType | main.rs:1150:36:1150:36 | S | | main.rs:1104:5:1105:13 | S | | main.rs:1152:18:1152:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1152:18:1152:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1152:18:1152:34 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1152:18:1152:34 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1152:26:1152:34 | from_loop | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1152:26:1152:34 | from_loop | T | main.rs:1104:5:1105:13 | S | | main.rs:1170:15:1170:18 | SelfParam | | main.rs:1158:5:1159:19 | S | @@ -1673,6 +1847,8 @@ inferType | main.rs:1202:20:1202:21 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1203:18:1203:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1203:18:1203:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1203:18:1203:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1203:18:1203:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1203:26:1203:27 | x1 | | main.rs:1158:5:1159:19 | S | | main.rs:1203:26:1203:27 | x1 | T | main.rs:1161:5:1162:14 | S2 | | main.rs:1203:26:1203:32 | x1.m1() | | main.rs:1161:5:1162:14 | S2 | @@ -1683,12 +1859,16 @@ inferType | main.rs:1205:20:1205:21 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1207:18:1207:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1207:18:1207:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1207:18:1207:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1207:18:1207:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1207:26:1207:27 | x2 | | main.rs:1158:5:1159:19 | S | | main.rs:1207:26:1207:27 | x2 | T | main.rs:1161:5:1162:14 | S2 | | main.rs:1207:26:1207:32 | x2.m2() | | file://:0:0:0:0 | & | | main.rs:1207:26:1207:32 | x2.m2() | &T | main.rs:1161:5:1162:14 | S2 | | main.rs:1208:18:1208:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1208:18:1208:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1208:18:1208:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1208:18:1208:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1208:26:1208:27 | x2 | | main.rs:1158:5:1159:19 | S | | main.rs:1208:26:1208:27 | x2 | T | main.rs:1161:5:1162:14 | S2 | | main.rs:1208:26:1208:32 | x2.m3() | | file://:0:0:0:0 | & | @@ -1700,6 +1880,8 @@ inferType | main.rs:1210:20:1210:21 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1212:18:1212:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1212:18:1212:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1212:18:1212:41 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1212:18:1212:41 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1212:26:1212:41 | ...::m2(...) | | file://:0:0:0:0 | & | | main.rs:1212:26:1212:41 | ...::m2(...) | &T | main.rs:1161:5:1162:14 | S2 | | main.rs:1212:38:1212:40 | &x3 | | file://:0:0:0:0 | & | @@ -1709,6 +1891,8 @@ inferType | main.rs:1212:39:1212:40 | x3 | T | main.rs:1161:5:1162:14 | S2 | | main.rs:1213:18:1213:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1213:18:1213:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1213:18:1213:41 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1213:18:1213:41 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1213:26:1213:41 | ...::m3(...) | | file://:0:0:0:0 | & | | main.rs:1213:26:1213:41 | ...::m3(...) | &T | main.rs:1161:5:1162:14 | S2 | | main.rs:1213:38:1213:40 | &x3 | | file://:0:0:0:0 | & | @@ -1727,6 +1911,8 @@ inferType | main.rs:1215:21:1215:22 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1217:18:1217:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1217:18:1217:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1217:18:1217:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1217:18:1217:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1217:26:1217:27 | x4 | | file://:0:0:0:0 | & | | main.rs:1217:26:1217:27 | x4 | &T | main.rs:1158:5:1159:19 | S | | main.rs:1217:26:1217:27 | x4 | &T.T | main.rs:1161:5:1162:14 | S2 | @@ -1734,6 +1920,8 @@ inferType | main.rs:1217:26:1217:32 | x4.m2() | &T | main.rs:1161:5:1162:14 | S2 | | main.rs:1218:18:1218:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1218:18:1218:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1218:18:1218:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1218:18:1218:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1218:26:1218:27 | x4 | | file://:0:0:0:0 | & | | main.rs:1218:26:1218:27 | x4 | &T | main.rs:1158:5:1159:19 | S | | main.rs:1218:26:1218:27 | x4 | &T.T | main.rs:1161:5:1162:14 | S2 | @@ -1750,12 +1938,16 @@ inferType | main.rs:1220:21:1220:22 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1222:18:1222:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1222:18:1222:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1222:18:1222:32 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1222:18:1222:32 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1222:26:1222:27 | x5 | | file://:0:0:0:0 | & | | main.rs:1222:26:1222:27 | x5 | &T | main.rs:1158:5:1159:19 | S | | main.rs:1222:26:1222:27 | x5 | &T.T | main.rs:1161:5:1162:14 | S2 | | main.rs:1222:26:1222:32 | x5.m1() | | main.rs:1161:5:1162:14 | S2 | | main.rs:1223:18:1223:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1223:18:1223:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1223:18:1223:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1223:18:1223:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1223:26:1223:27 | x5 | | file://:0:0:0:0 | & | | main.rs:1223:26:1223:27 | x5 | &T | main.rs:1158:5:1159:19 | S | | main.rs:1223:26:1223:27 | x5 | &T.T | main.rs:1161:5:1162:14 | S2 | @@ -1771,6 +1963,8 @@ inferType | main.rs:1225:21:1225:22 | S2 | | main.rs:1161:5:1162:14 | S2 | | main.rs:1228:18:1228:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1228:18:1228:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1228:18:1228:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1228:18:1228:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1228:26:1228:30 | (...) | | main.rs:1158:5:1159:19 | S | | main.rs:1228:26:1228:30 | (...) | T | main.rs:1161:5:1162:14 | S2 | | main.rs:1228:26:1228:35 | ... .m1() | | main.rs:1161:5:1162:14 | S2 | @@ -1797,6 +1991,8 @@ inferType | main.rs:1233:17:1233:23 | x7.m1() | &T | main.rs:1161:5:1162:14 | S2 | | main.rs:1234:18:1234:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1234:18:1234:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1234:18:1234:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1234:18:1234:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1234:26:1234:27 | x7 | | main.rs:1158:5:1159:19 | S | | main.rs:1234:26:1234:27 | x7 | T | file://:0:0:0:0 | & | | main.rs:1234:26:1234:27 | x7 | T.&T | main.rs:1161:5:1162:14 | S2 | @@ -1820,6 +2016,8 @@ inferType | main.rs:1244:17:1244:24 | my_thing | &T | main.rs:1164:5:1167:5 | MyInt | | main.rs:1245:18:1245:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1245:18:1245:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1245:18:1245:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1245:18:1245:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1248:13:1248:20 | my_thing | | file://:0:0:0:0 | & | | main.rs:1248:13:1248:20 | my_thing | &T | main.rs:1164:5:1167:5 | MyInt | | main.rs:1248:24:1248:39 | &... | | file://:0:0:0:0 | & | @@ -1831,6 +2029,8 @@ inferType | main.rs:1249:17:1249:24 | my_thing | &T | main.rs:1164:5:1167:5 | MyInt | | main.rs:1250:18:1250:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1250:18:1250:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1250:18:1250:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1250:18:1250:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1257:16:1257:20 | SelfParam | | file://:0:0:0:0 | & | | main.rs:1257:16:1257:20 | SelfParam | &T | main.rs:1255:5:1263:5 | Self [trait MyTrait] | | main.rs:1260:16:1260:20 | SelfParam | | file://:0:0:0:0 | & | @@ -1992,6 +2192,8 @@ inferType | main.rs:1340:27:1340:30 | flag | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1341:18:1341:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1341:18:1341:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1341:18:1341:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1341:18:1341:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1341:26:1341:29 | flag | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1356:43:1359:5 | { ... } | | {EXTERNAL LOCATION} | Result | | main.rs:1356:43:1359:5 | { ... } | E | main.rs:1348:5:1349:14 | S1 | @@ -2062,6 +2264,8 @@ inferType | main.rs:1382:53:1385:9 | { ... } | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1383:22:1383:27 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1383:22:1383:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1383:22:1383:30 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1383:22:1383:30 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1384:13:1384:34 | ...::Ok::<...>(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1384:13:1384:34 | ...::Ok::<...>(...) | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1386:9:1386:23 | ...::Err(...) | | {EXTERNAL LOCATION} | Result | @@ -2073,16 +2277,22 @@ inferType | main.rs:1391:37:1391:52 | try_same_error(...) | T | main.rs:1348:5:1349:14 | S1 | | main.rs:1392:22:1392:27 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1392:22:1392:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1392:22:1392:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1392:22:1392:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1395:37:1395:55 | try_convert_error(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1395:37:1395:55 | try_convert_error(...) | E | main.rs:1351:5:1352:14 | S2 | | main.rs:1395:37:1395:55 | try_convert_error(...) | T | main.rs:1348:5:1349:14 | S1 | | main.rs:1396:22:1396:27 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1396:22:1396:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1396:22:1396:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1396:22:1396:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1399:37:1399:49 | try_chained(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1399:37:1399:49 | try_chained(...) | E | main.rs:1351:5:1352:14 | S2 | | main.rs:1399:37:1399:49 | try_chained(...) | T | main.rs:1348:5:1349:14 | S1 | | main.rs:1400:22:1400:27 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1400:22:1400:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1400:22:1400:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1400:22:1400:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1403:37:1403:63 | try_complex(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1403:37:1403:63 | try_complex(...) | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1403:37:1403:63 | try_complex(...) | T | main.rs:1348:5:1349:14 | S1 | @@ -2092,6 +2302,8 @@ inferType | main.rs:1403:60:1403:61 | S1 | | main.rs:1348:5:1349:14 | S1 | | main.rs:1404:22:1404:27 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:1404:22:1404:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:1404:22:1404:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1404:22:1404:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1411:13:1411:13 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:1411:22:1411:22 | 1 | | {EXTERNAL LOCATION} | i32 | | main.rs:1412:13:1412:13 | y | | {EXTERNAL LOCATION} | i32 | @@ -3046,9 +3258,14 @@ inferType | main.rs:1968:24:1968:25 | xs | | file://:0:0:0:0 | [] | | main.rs:1968:24:1968:25 | xs | [T;...] | main.rs:1917:5:1918:13 | S | | main.rs:1968:24:1968:25 | xs | [T] | main.rs:1917:5:1918:13 | S | +| main.rs:1974:13:1974:13 | x | | {EXTERNAL LOCATION} | String | +| main.rs:1974:17:1974:46 | MacroExpr | | {EXTERNAL LOCATION} | String | | main.rs:1974:25:1974:35 | "Hello, {}" | | file://:0:0:0:0 | & | | main.rs:1974:25:1974:35 | "Hello, {}" | &T | {EXTERNAL LOCATION} | str | | main.rs:1974:25:1974:45 | ...::format(...) | | {EXTERNAL LOCATION} | String | +| main.rs:1974:25:1974:45 | ...::must_use(...) | | {EXTERNAL LOCATION} | String | +| main.rs:1974:25:1974:45 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1974:25:1974:45 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1974:25:1974:45 | { ... } | | {EXTERNAL LOCATION} | String | | main.rs:1974:38:1974:45 | "World!" | | file://:0:0:0:0 | & | | main.rs:1974:38:1974:45 | "World!" | &T | {EXTERNAL LOCATION} | str | @@ -3497,8 +3714,12 @@ inferType | main.rs:2229:32:2229:32 | 3 | | {EXTERNAL LOCATION} | u16 | | main.rs:2232:13:2232:17 | vals5 | | {EXTERNAL LOCATION} | Vec | | main.rs:2232:13:2232:17 | vals5 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2232:13:2232:17 | vals5 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:13:2232:17 | vals5 | T | {EXTERNAL LOCATION} | u32 | | main.rs:2232:21:2232:43 | ...::from(...) | | {EXTERNAL LOCATION} | Vec | | main.rs:2232:21:2232:43 | ...::from(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2232:21:2232:43 | ...::from(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2232:21:2232:43 | ...::from(...) | T | {EXTERNAL LOCATION} | u32 | | main.rs:2232:31:2232:42 | [...] | | file://:0:0:0:0 | [] | | main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | | main.rs:2232:31:2232:42 | [...] | [T;...] | {EXTERNAL LOCATION} | u32 | @@ -3509,10 +3730,16 @@ inferType | main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | i32 | | main.rs:2232:41:2232:41 | 3 | | {EXTERNAL LOCATION} | u32 | | main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | i32 | +| main.rs:2233:13:2233:13 | u | | {EXTERNAL LOCATION} | u32 | | main.rs:2233:13:2233:13 | u | | file://:0:0:0:0 | & | | main.rs:2233:13:2233:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2233:13:2233:13 | u | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2233:13:2233:13 | u | T | {EXTERNAL LOCATION} | u32 | | main.rs:2233:18:2233:22 | vals5 | | {EXTERNAL LOCATION} | Vec | | main.rs:2233:18:2233:22 | vals5 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2233:18:2233:22 | vals5 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2233:18:2233:22 | vals5 | T | {EXTERNAL LOCATION} | u32 | | main.rs:2235:13:2235:17 | vals6 | | {EXTERNAL LOCATION} | Vec | | main.rs:2235:13:2235:17 | vals6 | A | {EXTERNAL LOCATION} | Global | | main.rs:2235:13:2235:17 | vals6 | T | file://:0:0:0:0 | & | @@ -3542,60 +3769,143 @@ inferType | main.rs:2236:18:2236:22 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | | main.rs:2238:13:2238:21 | mut vals7 | | {EXTERNAL LOCATION} | Vec | | main.rs:2238:13:2238:21 | mut vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2238:13:2238:21 | mut vals7 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2238:25:2238:34 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | | main.rs:2238:25:2238:34 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2238:25:2238:34 | ...::new(...) | T | {EXTERNAL LOCATION} | u8 | | main.rs:2239:9:2239:13 | vals7 | | {EXTERNAL LOCATION} | Vec | | main.rs:2239:9:2239:13 | vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2239:9:2239:13 | vals7 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2239:20:2239:22 | 1u8 | | {EXTERNAL LOCATION} | u8 | | main.rs:2240:13:2240:13 | u | | {EXTERNAL LOCATION} | Vec | +| main.rs:2240:13:2240:13 | u | | {EXTERNAL LOCATION} | u8 | | main.rs:2240:13:2240:13 | u | | file://:0:0:0:0 | & | | main.rs:2240:13:2240:13 | u | A | {EXTERNAL LOCATION} | Global | +| main.rs:2240:13:2240:13 | u | T | {EXTERNAL LOCATION} | u8 | | main.rs:2240:18:2240:22 | vals7 | | {EXTERNAL LOCATION} | Vec | | main.rs:2240:18:2240:22 | vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2240:18:2240:22 | vals7 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2242:33:2242:33 | 1 | | {EXTERNAL LOCATION} | i32 | | main.rs:2242:36:2242:36 | 2 | | {EXTERNAL LOCATION} | i32 | | main.rs:2242:45:2242:45 | 3 | | {EXTERNAL LOCATION} | i32 | | main.rs:2242:48:2242:48 | 4 | | {EXTERNAL LOCATION} | i32 | | main.rs:2249:13:2249:20 | mut map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2249:13:2249:20 | mut map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2249:13:2249:20 | mut map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2249:13:2249:20 | mut map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2249:13:2249:20 | mut map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2249:13:2249:20 | mut map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2249:13:2249:20 | mut map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2249:24:2249:55 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2249:24:2249:55 | ...::new(...) | K | {EXTERNAL LOCATION} | i32 | | main.rs:2249:24:2249:55 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2249:24:2249:55 | ...::new(...) | V | {EXTERNAL LOCATION} | Box | +| main.rs:2249:24:2249:55 | ...::new(...) | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2249:24:2249:55 | ...::new(...) | V.T | file://:0:0:0:0 | & | +| main.rs:2249:24:2249:55 | ...::new(...) | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2250:9:2250:12 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2250:9:2250:12 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2250:9:2250:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2250:9:2250:12 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2250:9:2250:12 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2250:9:2250:12 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2250:9:2250:12 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2250:9:2250:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2250:9:2250:39 | map1.insert(...) | T | {EXTERNAL LOCATION} | Box | +| main.rs:2250:9:2250:39 | map1.insert(...) | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2250:9:2250:39 | map1.insert(...) | T.T | file://:0:0:0:0 | & | +| main.rs:2250:9:2250:39 | map1.insert(...) | T.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2250:21:2250:21 | 1 | | {EXTERNAL LOCATION} | i32 | | main.rs:2250:24:2250:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | | main.rs:2250:24:2250:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2250:24:2250:38 | ...::new(...) | T | file://:0:0:0:0 | & | +| main.rs:2250:24:2250:38 | ...::new(...) | T.&T | {EXTERNAL LOCATION} | str | | main.rs:2250:33:2250:37 | "one" | | file://:0:0:0:0 | & | | main.rs:2250:33:2250:37 | "one" | &T | {EXTERNAL LOCATION} | str | | main.rs:2251:9:2251:12 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2251:9:2251:12 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2251:9:2251:12 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2251:9:2251:12 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2251:9:2251:12 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2251:9:2251:12 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2251:9:2251:12 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2251:9:2251:39 | map1.insert(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2251:9:2251:39 | map1.insert(...) | T | {EXTERNAL LOCATION} | Box | +| main.rs:2251:9:2251:39 | map1.insert(...) | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2251:9:2251:39 | map1.insert(...) | T.T | file://:0:0:0:0 | & | +| main.rs:2251:9:2251:39 | map1.insert(...) | T.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2251:21:2251:21 | 2 | | {EXTERNAL LOCATION} | i32 | | main.rs:2251:24:2251:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | | main.rs:2251:24:2251:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2251:24:2251:38 | ...::new(...) | T | file://:0:0:0:0 | & | +| main.rs:2251:24:2251:38 | ...::new(...) | T.&T | {EXTERNAL LOCATION} | str | | main.rs:2251:33:2251:37 | "two" | | file://:0:0:0:0 | & | | main.rs:2251:33:2251:37 | "two" | &T | {EXTERNAL LOCATION} | str | | main.rs:2252:13:2252:15 | key | | {EXTERNAL LOCATION} | Item | | main.rs:2252:13:2252:15 | key | | file://:0:0:0:0 | & | +| main.rs:2252:13:2252:15 | key | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2252:20:2252:23 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2252:20:2252:23 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2252:20:2252:23 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2252:20:2252:23 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2252:20:2252:23 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2252:20:2252:23 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2252:20:2252:23 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2252:20:2252:30 | map1.keys() | | {EXTERNAL LOCATION} | Keys | +| main.rs:2252:20:2252:30 | map1.keys() | K | {EXTERNAL LOCATION} | i32 | +| main.rs:2252:20:2252:30 | map1.keys() | V | {EXTERNAL LOCATION} | Box | +| main.rs:2252:20:2252:30 | map1.keys() | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2252:20:2252:30 | map1.keys() | V.T | file://:0:0:0:0 | & | +| main.rs:2252:20:2252:30 | map1.keys() | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2253:13:2253:17 | value | | {EXTERNAL LOCATION} | Item | | main.rs:2253:13:2253:17 | value | | file://:0:0:0:0 | & | +| main.rs:2253:13:2253:17 | value | &T | {EXTERNAL LOCATION} | Box | +| main.rs:2253:13:2253:17 | value | &T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2253:13:2253:17 | value | &T.T | file://:0:0:0:0 | & | +| main.rs:2253:13:2253:17 | value | &T.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2253:22:2253:25 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2253:22:2253:25 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2253:22:2253:25 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2253:22:2253:25 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2253:22:2253:25 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2253:22:2253:25 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2253:22:2253:25 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2253:22:2253:34 | map1.values() | | {EXTERNAL LOCATION} | Values | +| main.rs:2253:22:2253:34 | map1.values() | K | {EXTERNAL LOCATION} | i32 | +| main.rs:2253:22:2253:34 | map1.values() | V | {EXTERNAL LOCATION} | Box | +| main.rs:2253:22:2253:34 | map1.values() | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2253:22:2253:34 | map1.values() | V.T | file://:0:0:0:0 | & | +| main.rs:2253:22:2253:34 | map1.values() | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2254:13:2254:24 | TuplePat | | {EXTERNAL LOCATION} | Item | | main.rs:2254:29:2254:32 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2254:29:2254:32 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2254:29:2254:32 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2254:29:2254:32 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2254:29:2254:32 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2254:29:2254:32 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2254:29:2254:32 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2254:29:2254:39 | map1.iter() | | {EXTERNAL LOCATION} | Iter | +| main.rs:2254:29:2254:39 | map1.iter() | K | {EXTERNAL LOCATION} | i32 | +| main.rs:2254:29:2254:39 | map1.iter() | V | {EXTERNAL LOCATION} | Box | +| main.rs:2254:29:2254:39 | map1.iter() | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2254:29:2254:39 | map1.iter() | V.T | file://:0:0:0:0 | & | +| main.rs:2254:29:2254:39 | map1.iter() | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2255:13:2255:24 | TuplePat | | {EXTERNAL LOCATION} | Item | | main.rs:2255:29:2255:33 | &map1 | | file://:0:0:0:0 | & | | main.rs:2255:29:2255:33 | &map1 | &T | {EXTERNAL LOCATION} | HashMap | +| main.rs:2255:29:2255:33 | &map1 | &T.K | {EXTERNAL LOCATION} | i32 | | main.rs:2255:29:2255:33 | &map1 | &T.S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2255:29:2255:33 | &map1 | &T.V | {EXTERNAL LOCATION} | Box | +| main.rs:2255:29:2255:33 | &map1 | &T.V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2255:29:2255:33 | &map1 | &T.V.T | file://:0:0:0:0 | & | +| main.rs:2255:29:2255:33 | &map1 | &T.V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2255:30:2255:33 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2255:30:2255:33 | map1 | K | {EXTERNAL LOCATION} | i32 | | main.rs:2255:30:2255:33 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2255:30:2255:33 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2255:30:2255:33 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2255:30:2255:33 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2255:30:2255:33 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i32 | | main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i64 | | main.rs:2259:26:2259:26 | 0 | | {EXTERNAL LOCATION} | i32 | @@ -3604,6 +3914,7 @@ inferType | main.rs:2261:23:2261:23 | a | | {EXTERNAL LOCATION} | i64 | | main.rs:2261:23:2261:28 | ... < ... | | {EXTERNAL LOCATION} | bool | | main.rs:2261:27:2261:28 | 10 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2261:27:2261:28 | 10 | | {EXTERNAL LOCATION} | i64 | | main.rs:2263:13:2263:13 | a | | {EXTERNAL LOCATION} | i32 | | main.rs:2263:13:2263:13 | a | | {EXTERNAL LOCATION} | i64 | | main.rs:2263:13:2263:18 | ... += ... | | file://:0:0:0:0 | () | @@ -3713,10 +4024,14 @@ inferType | main.rs:2382:29:2382:33 | value | T | {EXTERNAL LOCATION} | i32 | | main.rs:2384:22:2384:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2384:22:2384:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2384:22:2384:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2384:22:2384:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2386:15:2386:19 | value | | {EXTERNAL LOCATION} | Option | | main.rs:2386:15:2386:19 | value | T | {EXTERNAL LOCATION} | i32 | | main.rs:2389:26:2389:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2389:26:2389:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2389:26:2389:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2389:26:2389:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2393:13:2393:16 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2393:20:2393:24 | value | | {EXTERNAL LOCATION} | Option | | main.rs:2393:20:2393:24 | value | T | {EXTERNAL LOCATION} | i32 | @@ -3725,6 +4040,8 @@ inferType | main.rs:2394:20:2394:23 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2395:18:2395:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2395:18:2395:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2395:18:2395:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2395:18:2395:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2395:20:2395:23 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2396:13:2396:16 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2396:20:2396:24 | value | | {EXTERNAL LOCATION} | Option | @@ -3732,6 +4049,8 @@ inferType | main.rs:2396:20:2396:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | | main.rs:2397:18:2397:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2397:18:2397:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2397:18:2397:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2397:18:2397:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2397:20:2397:23 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2398:9:2398:12 | None | | {EXTERNAL LOCATION} | Option | testFailures diff --git a/rust/ql/test/query-tests/security/CWE-089/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-089/CONSISTENCY/PathResolutionConsistency.expected index cc35fcfde21..d8fcd1ec9f0 100644 --- a/rust/ql/test/query-tests/security/CWE-089/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/query-tests/security/CWE-089/CONSISTENCY/PathResolutionConsistency.expected @@ -8,11 +8,13 @@ multipleCallTargets | sqlx.rs:61:28:61:81 | ...::from(...) | | sqlx.rs:64:26:64:46 | safe_query_1.as_str() | | sqlx.rs:65:26:65:46 | safe_query_2.as_str() | +| sqlx.rs:66:26:66:46 | safe_query_3.as_str() | | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | | sqlx.rs:70:30:70:52 | unsafe_query_3.as_str() | | sqlx.rs:75:25:75:45 | safe_query_1.as_str() | | sqlx.rs:76:25:76:45 | safe_query_2.as_str() | +| sqlx.rs:77:25:77:45 | safe_query_3.as_str() | | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | | sqlx.rs:81:29:81:51 | unsafe_query_3.as_str() | diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index ff203271aba..87d6b4af332 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -1,32 +1,53 @@ #select +| sqlx.rs:66:26:66:46 | safe_query_3.as_str() | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:66:26:66:46 | safe_query_3.as_str() | This query depends on a $@. | sqlx.rs:48:25:48:46 | ...::get | user-provided value | | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | sqlx.rs:47:22:47:35 | ...::args | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | This query depends on a $@. | sqlx.rs:47:22:47:35 | ...::args | user-provided value | | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | This query depends on a $@. | sqlx.rs:48:25:48:46 | ...::get | user-provided value | +| sqlx.rs:77:25:77:45 | safe_query_3.as_str() | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:77:25:77:45 | safe_query_3.as_str() | This query depends on a $@. | sqlx.rs:48:25:48:46 | ...::get | user-provided value | | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | sqlx.rs:47:22:47:35 | ...::args | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | This query depends on a $@. | sqlx.rs:47:22:47:35 | ...::args | user-provided value | | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | This query depends on a $@. | sqlx.rs:48:25:48:46 | ...::get | user-provided value | edges | sqlx.rs:47:9:47:18 | arg_string | sqlx.rs:53:27:53:36 | arg_string | provenance | | | sqlx.rs:47:22:47:35 | ...::args | sqlx.rs:47:22:47:37 | ...::args(...) [element] | provenance | Src:MaD:2 | -| sqlx.rs:47:22:47:37 | ...::args(...) [element] | sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | provenance | MaD:8 | +| sqlx.rs:47:22:47:37 | ...::args(...) [element] | sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | provenance | MaD:11 | | sqlx.rs:47:22:47:44 | ... .nth(...) [Some] | sqlx.rs:47:22:47:77 | ... .unwrap_or(...) | provenance | MaD:3 | | sqlx.rs:47:22:47:77 | ... .unwrap_or(...) | sqlx.rs:47:9:47:18 | arg_string | provenance | | +| sqlx.rs:48:9:48:21 | remote_string | sqlx.rs:49:25:49:52 | remote_string.parse() [Ok] | provenance | MaD:10 | | sqlx.rs:48:9:48:21 | remote_string | sqlx.rs:54:27:54:39 | remote_string | provenance | | | sqlx.rs:48:25:48:46 | ...::get | sqlx.rs:48:25:48:69 | ...::get(...) [Ok] | provenance | Src:MaD:1 | | sqlx.rs:48:25:48:69 | ...::get(...) [Ok] | sqlx.rs:48:25:48:78 | ... .unwrap() | provenance | MaD:4 | -| sqlx.rs:48:25:48:78 | ... .unwrap() | sqlx.rs:48:25:48:85 | ... .text() [Ok] | provenance | MaD:9 | +| sqlx.rs:48:25:48:78 | ... .unwrap() | sqlx.rs:48:25:48:85 | ... .text() [Ok] | provenance | MaD:12 | | sqlx.rs:48:25:48:85 | ... .text() [Ok] | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | provenance | MaD:5 | | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | sqlx.rs:48:9:48:21 | remote_string | provenance | | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:7 | +| sqlx.rs:49:9:49:21 | remote_number | sqlx.rs:52:32:52:87 | MacroExpr | provenance | | +| sqlx.rs:49:25:49:52 | remote_string.parse() [Ok] | sqlx.rs:49:25:49:65 | ... .unwrap_or(...) | provenance | MaD:5 | +| sqlx.rs:49:25:49:65 | ... .unwrap_or(...) | sqlx.rs:49:9:49:21 | remote_number | provenance | | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:66:26:66:37 | safe_query_3 | provenance | | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:66:26:66:46 | safe_query_3.as_str() | provenance | MaD:8 | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:66:26:66:46 | safe_query_3.as_str() | provenance | MaD:6 | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:77:25:77:36 | safe_query_3 | provenance | | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:77:25:77:45 | safe_query_3.as_str() | provenance | MaD:8 | +| sqlx.rs:52:9:52:20 | safe_query_3 | sqlx.rs:77:25:77:45 | safe_query_3.as_str() | provenance | MaD:6 | +| sqlx.rs:52:24:52:88 | res | sqlx.rs:52:32:52:87 | { ... } | provenance | | +| sqlx.rs:52:32:52:87 | ...::format(...) | sqlx.rs:52:24:52:88 | res | provenance | | +| sqlx.rs:52:32:52:87 | ...::must_use(...) | sqlx.rs:52:9:52:20 | safe_query_3 | provenance | | +| sqlx.rs:52:32:52:87 | MacroExpr | sqlx.rs:52:32:52:87 | ...::format(...) | provenance | MaD:9 | +| sqlx.rs:52:32:52:87 | { ... } | sqlx.rs:52:32:52:87 | ...::must_use(...) | provenance | MaD:7 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:8 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | provenance | MaD:6 | -| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:7 | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:8 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | provenance | MaD:6 | | sqlx.rs:53:26:53:36 | &arg_string [&ref] | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | provenance | | | sqlx.rs:53:27:53:36 | arg_string | sqlx.rs:53:26:53:36 | &arg_string [&ref] | provenance | | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:7 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:8 | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | provenance | MaD:6 | -| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:7 | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:8 | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | provenance | MaD:6 | | sqlx.rs:54:26:54:39 | &remote_string [&ref] | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | provenance | | | sqlx.rs:54:27:54:39 | remote_string | sqlx.rs:54:26:54:39 | &remote_string [&ref] | provenance | | +| sqlx.rs:66:26:66:37 | safe_query_3 | sqlx.rs:66:26:66:46 | safe_query_3.as_str() | provenance | MaD:8 | +| sqlx.rs:66:26:66:37 | safe_query_3 | sqlx.rs:66:26:66:46 | safe_query_3.as_str() | provenance | MaD:6 | +| sqlx.rs:77:25:77:36 | safe_query_3 | sqlx.rs:77:25:77:45 | safe_query_3.as_str() | provenance | MaD:8 | +| sqlx.rs:77:25:77:36 | safe_query_3 | sqlx.rs:77:25:77:45 | safe_query_3.as_str() | provenance | MaD:6 | models | 1 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; ReturnValue.Field[core::result::Result::Ok(0)]; remote | | 2 | Source: std::env::args; ReturnValue.Element; commandargs | @@ -34,9 +55,12 @@ models | 4 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | | 5 | Summary: ::unwrap_or; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | | 6 | Summary: ::as_str; Argument[self]; ReturnValue; value | -| 7 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | -| 8 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 9 | Summary: repo:https://github.com/seanmonstar/reqwest:reqwest; ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 7 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | +| 8 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | +| 9 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 10 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 11 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 12 | Summary: repo:https://github.com/seanmonstar/reqwest:reqwest; ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | nodes | sqlx.rs:47:9:47:18 | arg_string | semmle.label | arg_string | | sqlx.rs:47:22:47:35 | ...::args | semmle.label | ...::args | @@ -49,14 +73,27 @@ nodes | sqlx.rs:48:25:48:78 | ... .unwrap() | semmle.label | ... .unwrap() | | sqlx.rs:48:25:48:85 | ... .text() [Ok] | semmle.label | ... .text() [Ok] | | sqlx.rs:48:25:48:118 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| sqlx.rs:49:9:49:21 | remote_number | semmle.label | remote_number | +| sqlx.rs:49:25:49:52 | remote_string.parse() [Ok] | semmle.label | remote_string.parse() [Ok] | +| sqlx.rs:49:25:49:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| sqlx.rs:52:9:52:20 | safe_query_3 | semmle.label | safe_query_3 | +| sqlx.rs:52:24:52:88 | res | semmle.label | res | +| sqlx.rs:52:32:52:87 | ...::format(...) | semmle.label | ...::format(...) | +| sqlx.rs:52:32:52:87 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| sqlx.rs:52:32:52:87 | MacroExpr | semmle.label | MacroExpr | +| sqlx.rs:52:32:52:87 | { ... } | semmle.label | { ... } | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | semmle.label | unsafe_query_1 [&ref] | | sqlx.rs:53:26:53:36 | &arg_string [&ref] | semmle.label | &arg_string [&ref] | | sqlx.rs:53:27:53:36 | arg_string | semmle.label | arg_string | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | semmle.label | unsafe_query_2 [&ref] | | sqlx.rs:54:26:54:39 | &remote_string [&ref] | semmle.label | &remote_string [&ref] | | sqlx.rs:54:27:54:39 | remote_string | semmle.label | remote_string | +| sqlx.rs:66:26:66:37 | safe_query_3 | semmle.label | safe_query_3 | +| sqlx.rs:66:26:66:46 | safe_query_3.as_str() | semmle.label | safe_query_3.as_str() | | sqlx.rs:67:26:67:48 | unsafe_query_1.as_str() | semmle.label | unsafe_query_1.as_str() | | sqlx.rs:69:30:69:52 | unsafe_query_2.as_str() | semmle.label | unsafe_query_2.as_str() | +| sqlx.rs:77:25:77:36 | safe_query_3 | semmle.label | safe_query_3 | +| sqlx.rs:77:25:77:45 | safe_query_3.as_str() | semmle.label | safe_query_3.as_str() | | sqlx.rs:78:25:78:47 | unsafe_query_1.as_str() | semmle.label | unsafe_query_1.as_str() | | sqlx.rs:80:29:80:51 | unsafe_query_2.as_str() | semmle.label | unsafe_query_2.as_str() | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-089/sqlx.rs b/rust/ql/test/query-tests/security/CWE-089/sqlx.rs index 4d121e86fee..fd1153cffd3 100644 --- a/rust/ql/test/query-tests/security/CWE-089/sqlx.rs +++ b/rust/ql/test/query-tests/security/CWE-089/sqlx.rs @@ -63,7 +63,7 @@ async fn test_sqlx_mysql(url: &str, enable_remote: bool) -> Result<(), sqlx::Err // direct execution let _ = conn.execute(safe_query_1.as_str()).await?; // $ sql-sink let _ = conn.execute(safe_query_2.as_str()).await?; // $ sql-sink - let _ = conn.execute(safe_query_3.as_str()).await?; // $ sql-sink + let _ = conn.execute(safe_query_3.as_str()).await?; // $ sql-sink $ SPURIOUS: Alert[rust/sql-injection]=remote1 let _ = conn.execute(unsafe_query_1.as_str()).await?; // $ sql-sink Alert[rust/sql-injection]=args1 if enable_remote { let _ = conn.execute(unsafe_query_2.as_str()).await?; // $ sql-sink Alert[rust/sql-injection]=remote1 @@ -74,7 +74,7 @@ async fn test_sqlx_mysql(url: &str, enable_remote: bool) -> Result<(), sqlx::Err // prepared queries let _ = sqlx::query(safe_query_1.as_str()).execute(&pool).await?; // $ sql-sink let _ = sqlx::query(safe_query_2.as_str()).execute(&pool).await?; // $ sql-sink - let _ = sqlx::query(safe_query_3.as_str()).execute(&pool).await?; // $ sql-sink + let _ = sqlx::query(safe_query_3.as_str()).execute(&pool).await?; // $ sql-sink $ SPURIOUS: Alert[rust/sql-injection]=remote1 let _ = sqlx::query(unsafe_query_1.as_str()).execute(&pool).await?; // $ sql-sink Alert[rust/sql-injection]=args1 if enable_remote { let _ = sqlx::query(unsafe_query_2.as_str()).execute(&pool).await?; // $ sql-sink Alert[rust/sql-injection]=remote1 diff --git a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/PathResolutionConsistency.expected index 564927f7ed3..c5b470fa9c3 100644 --- a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/PathResolutionConsistency.expected @@ -2,4 +2,9 @@ multipleCallTargets | test_logging.rs:77:20:77:36 | password.as_str() | | test_logging.rs:78:22:78:38 | password.as_str() | | test_logging.rs:88:18:88:34 | password.as_str() | +| test_logging.rs:229:30:229:71 | ... .as_str() | +| test_logging.rs:242:16:242:61 | ... .as_bytes() | | test_logging.rs:243:5:245:66 | ... .write_all(...) | +| test_logging.rs:245:20:245:65 | ... .as_bytes() | +| test_logging.rs:248:15:248:60 | ... .as_bytes() | +| test_logging.rs:251:15:251:60 | ... .as_bytes() | diff --git a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected index 8506a58effb..9f3c9ea82a4 100644 --- a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected +++ b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected @@ -48,110 +48,116 @@ | test_logging.rs:220:13:220:58 | ...::panic_fmt | test_logging.rs:220:50:220:57 | password | test_logging.rs:220:13:220:58 | ...::panic_fmt | This operation writes $@ to a log file. | test_logging.rs:220:50:220:57 | password | password | | test_logging.rs:223:13:223:60 | ...::assert_failed | test_logging.rs:223:52:223:59 | password | test_logging.rs:223:13:223:60 | ...::assert_failed | This operation writes $@ to a log file. | test_logging.rs:223:52:223:59 | password | password | | test_logging.rs:226:13:226:60 | ...::assert_failed | test_logging.rs:226:52:226:59 | password | test_logging.rs:226:13:226:60 | ...::assert_failed | This operation writes $@ to a log file. | test_logging.rs:226:52:226:59 | password | password | +| test_logging.rs:229:23:229:28 | expect | test_logging.rs:229:54:229:61 | password | test_logging.rs:229:23:229:28 | expect | This operation writes $@ to a log file. | test_logging.rs:229:54:229:61 | password | password | +| test_logging.rs:229:23:229:28 | expect | test_logging.rs:229:54:229:61 | password | test_logging.rs:229:23:229:28 | expect | This operation writes $@ to a log file. | test_logging.rs:229:54:229:61 | password | password | +| test_logging.rs:242:10:242:14 | write | test_logging.rs:242:42:242:49 | password | test_logging.rs:242:10:242:14 | write | This operation writes $@ to a log file. | test_logging.rs:242:42:242:49 | password | password | +| test_logging.rs:245:10:245:18 | write_all | test_logging.rs:245:46:245:53 | password | test_logging.rs:245:10:245:18 | write_all | This operation writes $@ to a log file. | test_logging.rs:245:46:245:53 | password | password | +| test_logging.rs:248:9:248:13 | write | test_logging.rs:248:41:248:48 | password | test_logging.rs:248:9:248:13 | write | This operation writes $@ to a log file. | test_logging.rs:248:41:248:48 | password | password | +| test_logging.rs:251:9:251:13 | write | test_logging.rs:251:41:251:48 | password | test_logging.rs:251:9:251:13 | write | This operation writes $@ to a log file. | test_logging.rs:251:41:251:48 | password | password | edges -| test_logging.rs:42:12:42:35 | MacroExpr | test_logging.rs:42:5:42:36 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:42:12:42:35 | MacroExpr | test_logging.rs:42:5:42:36 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:42:28:42:35 | password | test_logging.rs:42:12:42:35 | MacroExpr | provenance | | -| test_logging.rs:43:12:43:35 | MacroExpr | test_logging.rs:43:5:43:36 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:43:12:43:35 | MacroExpr | test_logging.rs:43:5:43:36 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:43:28:43:35 | password | test_logging.rs:43:12:43:35 | MacroExpr | provenance | | -| test_logging.rs:44:11:44:34 | MacroExpr | test_logging.rs:44:5:44:35 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:44:11:44:34 | MacroExpr | test_logging.rs:44:5:44:35 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:44:27:44:34 | password | test_logging.rs:44:11:44:34 | MacroExpr | provenance | | -| test_logging.rs:45:12:45:35 | MacroExpr | test_logging.rs:45:5:45:36 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:45:12:45:35 | MacroExpr | test_logging.rs:45:5:45:36 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:45:28:45:35 | password | test_logging.rs:45:12:45:35 | MacroExpr | provenance | | -| test_logging.rs:46:11:46:34 | MacroExpr | test_logging.rs:46:5:46:35 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:46:11:46:34 | MacroExpr | test_logging.rs:46:5:46:35 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:46:27:46:34 | password | test_logging.rs:46:11:46:34 | MacroExpr | provenance | | -| test_logging.rs:47:24:47:47 | MacroExpr | test_logging.rs:47:5:47:48 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:47:24:47:47 | MacroExpr | test_logging.rs:47:5:47:48 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:47:40:47:47 | password | test_logging.rs:47:24:47:47 | MacroExpr | provenance | | -| test_logging.rs:52:12:52:35 | MacroExpr | test_logging.rs:52:5:52:36 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:52:12:52:35 | MacroExpr | test_logging.rs:52:5:52:36 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:52:28:52:35 | password | test_logging.rs:52:12:52:35 | MacroExpr | provenance | | -| test_logging.rs:54:12:54:48 | MacroExpr | test_logging.rs:54:5:54:49 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:54:12:54:48 | MacroExpr | test_logging.rs:54:5:54:49 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:54:41:54:48 | password | test_logging.rs:54:12:54:48 | MacroExpr | provenance | | -| test_logging.rs:56:12:56:46 | MacroExpr | test_logging.rs:56:5:56:47 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:56:12:56:46 | MacroExpr | test_logging.rs:56:5:56:47 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:56:39:56:46 | password | test_logging.rs:56:12:56:46 | MacroExpr | provenance | | -| test_logging.rs:57:12:57:33 | MacroExpr | test_logging.rs:57:5:57:34 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:57:12:57:33 | MacroExpr | test_logging.rs:57:5:57:34 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:57:24:57:31 | password | test_logging.rs:57:12:57:33 | MacroExpr | provenance | | -| test_logging.rs:58:12:58:35 | MacroExpr | test_logging.rs:58:5:58:36 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:58:12:58:35 | MacroExpr | test_logging.rs:58:5:58:36 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:58:24:58:31 | password | test_logging.rs:58:12:58:35 | MacroExpr | provenance | | -| test_logging.rs:60:30:60:53 | MacroExpr | test_logging.rs:60:5:60:54 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:60:30:60:53 | MacroExpr | test_logging.rs:60:5:60:54 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:60:46:60:53 | password | test_logging.rs:60:30:60:53 | MacroExpr | provenance | | -| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | +| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:61:20:61:28 | &... [&ref, tuple.0] | test_logging.rs:61:5:61:55 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | | test_logging.rs:61:20:61:28 | &password | test_logging.rs:61:20:61:28 | TupleExpr [tuple.0] | provenance | | | test_logging.rs:61:20:61:28 | &password [&ref] | test_logging.rs:61:20:61:28 | TupleExpr [tuple.0, &ref] | provenance | | | test_logging.rs:61:20:61:28 | TupleExpr [tuple.0, &ref] | test_logging.rs:61:20:61:28 | &... [&ref, tuple.0, &ref] | provenance | | | test_logging.rs:61:20:61:28 | TupleExpr [tuple.0] | test_logging.rs:61:20:61:28 | &... [&ref, tuple.0] | provenance | | | test_logging.rs:61:21:61:28 | password | test_logging.rs:61:20:61:28 | &password | provenance | Config | | test_logging.rs:61:21:61:28 | password | test_logging.rs:61:20:61:28 | &password [&ref] | provenance | | -| test_logging.rs:65:24:65:47 | MacroExpr | test_logging.rs:65:5:65:48 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:65:24:65:47 | MacroExpr | test_logging.rs:65:5:65:48 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:65:40:65:47 | password | test_logging.rs:65:24:65:47 | MacroExpr | provenance | | -| test_logging.rs:67:42:67:65 | MacroExpr | test_logging.rs:67:5:67:66 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:67:42:67:65 | MacroExpr | test_logging.rs:67:5:67:66 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:67:58:67:65 | password | test_logging.rs:67:42:67:65 | MacroExpr | provenance | | -| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0, &ref] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0, &ref] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | +| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0, &ref] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0, &ref] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:68:18:68:26 | &... [&ref, tuple.0] | test_logging.rs:68:5:68:67 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | | test_logging.rs:68:18:68:26 | &password | test_logging.rs:68:18:68:26 | TupleExpr [tuple.0] | provenance | | | test_logging.rs:68:18:68:26 | &password [&ref] | test_logging.rs:68:18:68:26 | TupleExpr [tuple.0, &ref] | provenance | | | test_logging.rs:68:18:68:26 | TupleExpr [tuple.0, &ref] | test_logging.rs:68:18:68:26 | &... [&ref, tuple.0, &ref] | provenance | | | test_logging.rs:68:18:68:26 | TupleExpr [tuple.0] | test_logging.rs:68:18:68:26 | &... [&ref, tuple.0] | provenance | | | test_logging.rs:68:19:68:26 | password | test_logging.rs:68:18:68:26 | &password | provenance | Config | | test_logging.rs:68:19:68:26 | password | test_logging.rs:68:18:68:26 | &password [&ref] | provenance | | -| test_logging.rs:72:23:72:46 | MacroExpr | test_logging.rs:72:5:72:47 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:72:23:72:46 | MacroExpr | test_logging.rs:72:5:72:47 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:72:39:72:46 | password | test_logging.rs:72:23:72:46 | MacroExpr | provenance | | -| test_logging.rs:74:41:74:64 | MacroExpr | test_logging.rs:74:5:74:65 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:74:41:74:64 | MacroExpr | test_logging.rs:74:5:74:65 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:74:57:74:64 | password | test_logging.rs:74:41:74:64 | MacroExpr | provenance | | -| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | +| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:75:20:75:28 | &... [&ref, tuple.0] | test_logging.rs:75:5:75:51 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | | test_logging.rs:75:20:75:28 | &password | test_logging.rs:75:20:75:28 | TupleExpr [tuple.0] | provenance | | | test_logging.rs:75:20:75:28 | &password [&ref] | test_logging.rs:75:20:75:28 | TupleExpr [tuple.0, &ref] | provenance | | | test_logging.rs:75:20:75:28 | TupleExpr [tuple.0, &ref] | test_logging.rs:75:20:75:28 | &... [&ref, tuple.0, &ref] | provenance | | | test_logging.rs:75:20:75:28 | TupleExpr [tuple.0] | test_logging.rs:75:20:75:28 | &... [&ref, tuple.0] | provenance | | | test_logging.rs:75:21:75:28 | password | test_logging.rs:75:20:75:28 | &password | provenance | Config | | test_logging.rs:75:21:75:28 | password | test_logging.rs:75:20:75:28 | &password [&ref] | provenance | | -| test_logging.rs:76:23:76:46 | MacroExpr | test_logging.rs:76:5:76:47 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:76:23:76:46 | MacroExpr | test_logging.rs:76:5:76:47 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:76:39:76:46 | password | test_logging.rs:76:23:76:46 | MacroExpr | provenance | | -| test_logging.rs:82:20:82:43 | MacroExpr | test_logging.rs:82:5:82:44 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:82:20:82:43 | MacroExpr | test_logging.rs:82:5:82:44 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:82:36:82:43 | password | test_logging.rs:82:20:82:43 | MacroExpr | provenance | | -| test_logging.rs:84:38:84:61 | MacroExpr | test_logging.rs:84:5:84:62 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:84:38:84:61 | MacroExpr | test_logging.rs:84:5:84:62 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:84:54:84:61 | password | test_logging.rs:84:38:84:61 | MacroExpr | provenance | | -| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 Sink:MaD:9 | -| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:9 Sink:MaD:9 Sink:MaD:9 | +| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0, &ref] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 Sink:MaD:13 | +| test_logging.rs:85:20:85:28 | &... [&ref, tuple.0] | test_logging.rs:85:5:85:48 | ...::log | provenance | MaD:13 Sink:MaD:13 Sink:MaD:13 | | test_logging.rs:85:20:85:28 | &password | test_logging.rs:85:20:85:28 | TupleExpr [tuple.0] | provenance | | | test_logging.rs:85:20:85:28 | &password [&ref] | test_logging.rs:85:20:85:28 | TupleExpr [tuple.0, &ref] | provenance | | | test_logging.rs:85:20:85:28 | TupleExpr [tuple.0, &ref] | test_logging.rs:85:20:85:28 | &... [&ref, tuple.0, &ref] | provenance | | | test_logging.rs:85:20:85:28 | TupleExpr [tuple.0] | test_logging.rs:85:20:85:28 | &... [&ref, tuple.0] | provenance | | | test_logging.rs:85:21:85:28 | password | test_logging.rs:85:20:85:28 | &password | provenance | Config | | test_logging.rs:85:21:85:28 | password | test_logging.rs:85:20:85:28 | &password [&ref] | provenance | | -| test_logging.rs:86:20:86:43 | MacroExpr | test_logging.rs:86:5:86:44 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:86:20:86:43 | MacroExpr | test_logging.rs:86:5:86:44 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:86:36:86:43 | password | test_logging.rs:86:20:86:43 | MacroExpr | provenance | | | test_logging.rs:93:9:93:10 | m1 | test_logging.rs:94:11:94:28 | MacroExpr | provenance | | | test_logging.rs:93:14:93:22 | &password | test_logging.rs:93:9:93:10 | m1 | provenance | | | test_logging.rs:93:15:93:22 | password | test_logging.rs:93:14:93:22 | &password | provenance | Config | -| test_logging.rs:94:11:94:28 | MacroExpr | test_logging.rs:94:5:94:29 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:94:11:94:28 | MacroExpr | test_logging.rs:94:5:94:29 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:96:9:96:10 | m2 | test_logging.rs:97:11:97:18 | MacroExpr | provenance | | | test_logging.rs:96:41:96:49 | &password | test_logging.rs:96:9:96:10 | m2 | provenance | | | test_logging.rs:96:42:96:49 | password | test_logging.rs:96:41:96:49 | &password | provenance | Config | -| test_logging.rs:97:11:97:18 | MacroExpr | test_logging.rs:97:5:97:19 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:97:11:97:18 | MacroExpr | test_logging.rs:97:5:97:19 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:99:9:99:10 | m3 | test_logging.rs:100:11:100:18 | MacroExpr | provenance | | | test_logging.rs:99:14:99:46 | res | test_logging.rs:99:22:99:45 | { ... } | provenance | | | test_logging.rs:99:22:99:45 | ...::format(...) | test_logging.rs:99:14:99:46 | res | provenance | | | test_logging.rs:99:22:99:45 | ...::must_use(...) | test_logging.rs:99:9:99:10 | m3 | provenance | | -| test_logging.rs:99:22:99:45 | MacroExpr | test_logging.rs:99:22:99:45 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:99:22:99:45 | { ... } | test_logging.rs:99:22:99:45 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:99:22:99:45 | MacroExpr | test_logging.rs:99:22:99:45 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:99:22:99:45 | { ... } | test_logging.rs:99:22:99:45 | ...::must_use(...) | provenance | MaD:17 | | test_logging.rs:99:38:99:45 | password | test_logging.rs:99:22:99:45 | MacroExpr | provenance | | -| test_logging.rs:100:11:100:18 | MacroExpr | test_logging.rs:100:5:100:19 | ...::log | provenance | MaD:8 Sink:MaD:8 | -| test_logging.rs:118:12:118:41 | MacroExpr | test_logging.rs:118:5:118:42 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:100:11:100:18 | MacroExpr | test_logging.rs:100:5:100:19 | ...::log | provenance | MaD:12 Sink:MaD:12 | +| test_logging.rs:118:12:118:41 | MacroExpr | test_logging.rs:118:5:118:42 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:118:28:118:41 | get_password(...) | test_logging.rs:118:12:118:41 | MacroExpr | provenance | | | test_logging.rs:129:9:129:10 | t1 [tuple.1] | test_logging.rs:131:28:131:29 | t1 [tuple.1] | provenance | | | test_logging.rs:129:14:129:33 | TupleExpr [tuple.1] | test_logging.rs:129:9:129:10 | t1 [tuple.1] | provenance | | | test_logging.rs:129:25:129:32 | password | test_logging.rs:129:14:129:33 | TupleExpr [tuple.1] | provenance | | -| test_logging.rs:131:12:131:31 | MacroExpr | test_logging.rs:131:5:131:32 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:131:12:131:31 | MacroExpr | test_logging.rs:131:5:131:32 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:131:28:131:29 | t1 [tuple.1] | test_logging.rs:131:28:131:31 | t1.1 | provenance | | | test_logging.rs:131:28:131:31 | t1.1 | test_logging.rs:131:12:131:31 | MacroExpr | provenance | | -| test_logging.rs:141:11:141:37 | MacroExpr | test_logging.rs:141:5:141:38 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:141:11:141:37 | MacroExpr | test_logging.rs:141:5:141:38 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:141:27:141:37 | s1.password | test_logging.rs:141:11:141:37 | MacroExpr | provenance | | -| test_logging.rs:151:11:151:37 | MacroExpr | test_logging.rs:151:5:151:38 | ...::log | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:151:11:151:37 | MacroExpr | test_logging.rs:151:5:151:38 | ...::log | provenance | MaD:12 Sink:MaD:12 | | test_logging.rs:151:27:151:37 | s2.password | test_logging.rs:151:11:151:37 | MacroExpr | provenance | | | test_logging.rs:176:33:176:79 | &... | test_logging.rs:176:22:176:31 | log_expect | provenance | MaD:1 Sink:MaD:1 | | test_logging.rs:176:33:176:79 | &... [&ref] | test_logging.rs:176:22:176:31 | log_expect | provenance | MaD:1 Sink:MaD:1 | @@ -160,82 +166,143 @@ edges | test_logging.rs:176:34:176:79 | res | test_logging.rs:176:42:176:78 | { ... } | provenance | | | test_logging.rs:176:42:176:78 | ...::format(...) | test_logging.rs:176:34:176:79 | res | provenance | | | test_logging.rs:176:42:176:78 | ...::must_use(...) | test_logging.rs:176:34:176:79 | MacroExpr | provenance | | -| test_logging.rs:176:42:176:78 | MacroExpr | test_logging.rs:176:42:176:78 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:176:42:176:78 | { ... } | test_logging.rs:176:42:176:78 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:176:42:176:78 | MacroExpr | test_logging.rs:176:42:176:78 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:176:42:176:78 | { ... } | test_logging.rs:176:42:176:78 | ...::must_use(...) | provenance | MaD:17 | | test_logging.rs:176:70:176:78 | password2 | test_logging.rs:176:42:176:78 | MacroExpr | provenance | | -| test_logging.rs:180:35:180:81 | &... | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:2 Sink:MaD:2 | -| test_logging.rs:180:35:180:81 | &... [&ref] | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:2 Sink:MaD:2 | +| test_logging.rs:180:35:180:81 | &... | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:3 Sink:MaD:3 | +| test_logging.rs:180:35:180:81 | &... [&ref] | test_logging.rs:180:24:180:33 | log_expect | provenance | MaD:3 Sink:MaD:3 | | test_logging.rs:180:36:180:81 | MacroExpr | test_logging.rs:180:35:180:81 | &... | provenance | Config | | test_logging.rs:180:36:180:81 | MacroExpr | test_logging.rs:180:35:180:81 | &... [&ref] | provenance | | | test_logging.rs:180:36:180:81 | res | test_logging.rs:180:44:180:80 | { ... } | provenance | | | test_logging.rs:180:44:180:80 | ...::format(...) | test_logging.rs:180:36:180:81 | res | provenance | | | test_logging.rs:180:44:180:80 | ...::must_use(...) | test_logging.rs:180:36:180:81 | MacroExpr | provenance | | -| test_logging.rs:180:44:180:80 | MacroExpr | test_logging.rs:180:44:180:80 | ...::format(...) | provenance | MaD:13 | -| test_logging.rs:180:44:180:80 | { ... } | test_logging.rs:180:44:180:80 | ...::must_use(...) | provenance | MaD:12 | +| test_logging.rs:180:44:180:80 | MacroExpr | test_logging.rs:180:44:180:80 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:180:44:180:80 | { ... } | test_logging.rs:180:44:180:80 | ...::must_use(...) | provenance | MaD:17 | | test_logging.rs:180:72:180:80 | password2 | test_logging.rs:180:44:180:80 | MacroExpr | provenance | | | test_logging.rs:183:9:183:19 | err_result2 [Err] | test_logging.rs:184:13:184:23 | err_result2 [Err] | provenance | | | test_logging.rs:183:47:183:68 | Err(...) [Err] | test_logging.rs:183:9:183:19 | err_result2 [Err] | provenance | | | test_logging.rs:183:51:183:59 | password2 | test_logging.rs:183:51:183:67 | password2.clone() | provenance | generated | | test_logging.rs:183:51:183:67 | password2.clone() | test_logging.rs:183:47:183:68 | Err(...) [Err] | provenance | | -| test_logging.rs:184:13:184:23 | err_result2 [Err] | test_logging.rs:184:25:184:34 | log_expect | provenance | MaD:3 Sink:MaD:3 | +| test_logging.rs:184:13:184:23 | err_result2 [Err] | test_logging.rs:184:25:184:34 | log_expect | provenance | MaD:4 Sink:MaD:4 | | test_logging.rs:187:9:187:19 | err_result3 [Err] | test_logging.rs:188:13:188:23 | err_result3 [Err] | provenance | | | test_logging.rs:187:47:187:60 | Err(...) [Err] | test_logging.rs:187:9:187:19 | err_result3 [Err] | provenance | | | test_logging.rs:187:51:187:59 | password2 | test_logging.rs:187:47:187:60 | Err(...) [Err] | provenance | | -| test_logging.rs:188:13:188:23 | err_result3 [Err] | test_logging.rs:188:25:188:34 | log_unwrap | provenance | MaD:4 Sink:MaD:4 | -| test_logging.rs:192:12:192:37 | MacroExpr | test_logging.rs:192:5:192:38 | ...::_print | provenance | MaD:11 Sink:MaD:11 | +| test_logging.rs:188:13:188:23 | err_result3 [Err] | test_logging.rs:188:25:188:34 | log_unwrap | provenance | MaD:5 Sink:MaD:5 | +| test_logging.rs:192:12:192:37 | MacroExpr | test_logging.rs:192:5:192:38 | ...::_print | provenance | MaD:15 Sink:MaD:15 | | test_logging.rs:192:30:192:37 | password | test_logging.rs:192:12:192:37 | MacroExpr | provenance | | -| test_logging.rs:193:14:193:37 | MacroExpr | test_logging.rs:193:5:193:38 | ...::_print | provenance | MaD:11 Sink:MaD:11 | +| test_logging.rs:193:14:193:37 | MacroExpr | test_logging.rs:193:5:193:38 | ...::_print | provenance | MaD:15 Sink:MaD:15 | | test_logging.rs:193:30:193:37 | password | test_logging.rs:193:14:193:37 | MacroExpr | provenance | | -| test_logging.rs:194:13:194:38 | MacroExpr | test_logging.rs:194:5:194:39 | ...::_eprint | provenance | MaD:10 Sink:MaD:10 | +| test_logging.rs:194:13:194:38 | MacroExpr | test_logging.rs:194:5:194:39 | ...::_eprint | provenance | MaD:14 Sink:MaD:14 | | test_logging.rs:194:31:194:38 | password | test_logging.rs:194:13:194:38 | MacroExpr | provenance | | -| test_logging.rs:195:15:195:38 | MacroExpr | test_logging.rs:195:5:195:39 | ...::_eprint | provenance | MaD:10 Sink:MaD:10 | +| test_logging.rs:195:15:195:38 | MacroExpr | test_logging.rs:195:5:195:39 | ...::_eprint | provenance | MaD:14 Sink:MaD:14 | | test_logging.rs:195:31:195:38 | password | test_logging.rs:195:15:195:38 | MacroExpr | provenance | | -| test_logging.rs:199:20:199:43 | MacroExpr | test_logging.rs:199:13:199:44 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:199:20:199:43 | MacroExpr | test_logging.rs:199:13:199:44 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:199:36:199:43 | password | test_logging.rs:199:20:199:43 | MacroExpr | provenance | | -| test_logging.rs:202:19:202:42 | MacroExpr | test_logging.rs:202:13:202:43 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:202:19:202:42 | MacroExpr | test_logging.rs:202:13:202:43 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:202:35:202:42 | password | test_logging.rs:202:19:202:42 | MacroExpr | provenance | | -| test_logging.rs:205:28:205:51 | MacroExpr | test_logging.rs:205:13:205:52 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:205:28:205:51 | MacroExpr | test_logging.rs:205:13:205:52 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:205:44:205:51 | password | test_logging.rs:205:28:205:51 | MacroExpr | provenance | | -| test_logging.rs:208:26:208:49 | MacroExpr | test_logging.rs:208:13:208:50 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:208:26:208:49 | MacroExpr | test_logging.rs:208:13:208:50 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:208:42:208:49 | password | test_logging.rs:208:26:208:49 | MacroExpr | provenance | | -| test_logging.rs:211:28:211:51 | MacroExpr | test_logging.rs:211:13:211:52 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:211:28:211:51 | MacroExpr | test_logging.rs:211:13:211:52 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:211:44:211:51 | password | test_logging.rs:211:28:211:51 | MacroExpr | provenance | | -| test_logging.rs:214:13:214:54 | ...::assert_failed [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed | provenance | Sink:MaD:5 | -| test_logging.rs:214:30:214:53 | ...::Some(...) [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed | provenance | MaD:5 Sink:MaD:5 | -| test_logging.rs:214:30:214:53 | ...::Some(...) [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed [Some] | provenance | MaD:6 | +| test_logging.rs:214:13:214:54 | ...::assert_failed [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed | provenance | Sink:MaD:9 | +| test_logging.rs:214:30:214:53 | ...::Some(...) [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed | provenance | MaD:9 Sink:MaD:9 | +| test_logging.rs:214:30:214:53 | ...::Some(...) [Some] | test_logging.rs:214:13:214:54 | ...::assert_failed [Some] | provenance | MaD:10 | | test_logging.rs:214:30:214:53 | MacroExpr | test_logging.rs:214:30:214:53 | ...::Some(...) [Some] | provenance | | | test_logging.rs:214:46:214:53 | password | test_logging.rs:214:30:214:53 | MacroExpr | provenance | | -| test_logging.rs:217:13:217:54 | ...::assert_failed [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed | provenance | Sink:MaD:5 | -| test_logging.rs:217:30:217:53 | ...::Some(...) [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed | provenance | MaD:5 Sink:MaD:5 | -| test_logging.rs:217:30:217:53 | ...::Some(...) [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed [Some] | provenance | MaD:6 | +| test_logging.rs:217:13:217:54 | ...::assert_failed [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed | provenance | Sink:MaD:9 | +| test_logging.rs:217:30:217:53 | ...::Some(...) [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed | provenance | MaD:9 Sink:MaD:9 | +| test_logging.rs:217:30:217:53 | ...::Some(...) [Some] | test_logging.rs:217:13:217:54 | ...::assert_failed [Some] | provenance | MaD:10 | | test_logging.rs:217:30:217:53 | MacroExpr | test_logging.rs:217:30:217:53 | ...::Some(...) [Some] | provenance | | | test_logging.rs:217:46:217:53 | password | test_logging.rs:217:30:217:53 | MacroExpr | provenance | | -| test_logging.rs:220:34:220:57 | MacroExpr | test_logging.rs:220:13:220:58 | ...::panic_fmt | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:220:34:220:57 | MacroExpr | test_logging.rs:220:13:220:58 | ...::panic_fmt | provenance | MaD:11 Sink:MaD:11 | | test_logging.rs:220:50:220:57 | password | test_logging.rs:220:34:220:57 | MacroExpr | provenance | | -| test_logging.rs:223:13:223:60 | ...::assert_failed [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed | provenance | Sink:MaD:5 | -| test_logging.rs:223:36:223:59 | ...::Some(...) [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed | provenance | MaD:5 Sink:MaD:5 | -| test_logging.rs:223:36:223:59 | ...::Some(...) [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed [Some] | provenance | MaD:6 | +| test_logging.rs:223:13:223:60 | ...::assert_failed [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed | provenance | Sink:MaD:9 | +| test_logging.rs:223:36:223:59 | ...::Some(...) [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed | provenance | MaD:9 Sink:MaD:9 | +| test_logging.rs:223:36:223:59 | ...::Some(...) [Some] | test_logging.rs:223:13:223:60 | ...::assert_failed [Some] | provenance | MaD:10 | | test_logging.rs:223:36:223:59 | MacroExpr | test_logging.rs:223:36:223:59 | ...::Some(...) [Some] | provenance | | | test_logging.rs:223:52:223:59 | password | test_logging.rs:223:36:223:59 | MacroExpr | provenance | | -| test_logging.rs:226:13:226:60 | ...::assert_failed [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed | provenance | Sink:MaD:5 | -| test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed | provenance | MaD:5 Sink:MaD:5 | -| test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed [Some] | provenance | MaD:6 | +| test_logging.rs:226:13:226:60 | ...::assert_failed [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed | provenance | Sink:MaD:9 | +| test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed | provenance | MaD:9 Sink:MaD:9 | +| test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | test_logging.rs:226:13:226:60 | ...::assert_failed [Some] | provenance | MaD:10 | | test_logging.rs:226:36:226:59 | MacroExpr | test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | provenance | | | test_logging.rs:226:52:226:59 | password | test_logging.rs:226:36:226:59 | MacroExpr | provenance | | +| test_logging.rs:229:30:229:62 | MacroExpr | test_logging.rs:229:30:229:71 | ... .as_str() [&ref] | provenance | MaD:19 | +| test_logging.rs:229:30:229:62 | MacroExpr | test_logging.rs:229:30:229:71 | ... .as_str() [&ref] | provenance | MaD:16 | +| test_logging.rs:229:30:229:62 | res | test_logging.rs:229:38:229:61 | { ... } | provenance | | +| test_logging.rs:229:30:229:71 | ... .as_str() | test_logging.rs:229:23:229:28 | expect | provenance | MaD:2 Sink:MaD:2 | +| test_logging.rs:229:30:229:71 | ... .as_str() | test_logging.rs:229:23:229:28 | expect | provenance | MaD:2 Sink:MaD:2 | +| test_logging.rs:229:30:229:71 | ... .as_str() [&ref] | test_logging.rs:229:23:229:28 | expect | provenance | MaD:2 Sink:MaD:2 | +| test_logging.rs:229:30:229:71 | ... .as_str() [&ref] | test_logging.rs:229:23:229:28 | expect | provenance | MaD:2 Sink:MaD:2 | +| test_logging.rs:229:38:229:61 | ...::format(...) | test_logging.rs:229:30:229:62 | res | provenance | | +| test_logging.rs:229:38:229:61 | ...::must_use(...) | test_logging.rs:229:30:229:62 | MacroExpr | provenance | | +| test_logging.rs:229:38:229:61 | ...::must_use(...) | test_logging.rs:229:30:229:71 | ... .as_str() | provenance | MaD:19 | +| test_logging.rs:229:38:229:61 | ...::must_use(...) | test_logging.rs:229:30:229:71 | ... .as_str() | provenance | MaD:16 | +| test_logging.rs:229:38:229:61 | MacroExpr | test_logging.rs:229:38:229:61 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:229:38:229:61 | { ... } | test_logging.rs:229:38:229:61 | ...::must_use(...) | provenance | MaD:17 | +| test_logging.rs:229:54:229:61 | password | test_logging.rs:229:38:229:61 | MacroExpr | provenance | | +| test_logging.rs:242:16:242:50 | MacroExpr | test_logging.rs:242:16:242:61 | ... .as_bytes() [&ref] | provenance | MaD:18 | +| test_logging.rs:242:16:242:50 | res | test_logging.rs:242:24:242:49 | { ... } | provenance | | +| test_logging.rs:242:16:242:61 | ... .as_bytes() | test_logging.rs:242:10:242:14 | write | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:242:16:242:61 | ... .as_bytes() [&ref] | test_logging.rs:242:10:242:14 | write | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:242:24:242:49 | ...::format(...) | test_logging.rs:242:16:242:50 | res | provenance | | +| test_logging.rs:242:24:242:49 | ...::must_use(...) | test_logging.rs:242:16:242:50 | MacroExpr | provenance | | +| test_logging.rs:242:24:242:49 | ...::must_use(...) | test_logging.rs:242:16:242:61 | ... .as_bytes() | provenance | MaD:18 | +| test_logging.rs:242:24:242:49 | MacroExpr | test_logging.rs:242:24:242:49 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:242:24:242:49 | { ... } | test_logging.rs:242:24:242:49 | ...::must_use(...) | provenance | MaD:17 | +| test_logging.rs:242:42:242:49 | password | test_logging.rs:242:24:242:49 | MacroExpr | provenance | | +| test_logging.rs:245:20:245:54 | MacroExpr | test_logging.rs:245:20:245:65 | ... .as_bytes() [&ref] | provenance | MaD:18 | +| test_logging.rs:245:20:245:54 | res | test_logging.rs:245:28:245:53 | { ... } | provenance | | +| test_logging.rs:245:20:245:65 | ... .as_bytes() | test_logging.rs:245:10:245:18 | write_all | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:245:20:245:65 | ... .as_bytes() [&ref] | test_logging.rs:245:10:245:18 | write_all | provenance | MaD:8 Sink:MaD:8 | +| test_logging.rs:245:28:245:53 | ...::format(...) | test_logging.rs:245:20:245:54 | res | provenance | | +| test_logging.rs:245:28:245:53 | ...::must_use(...) | test_logging.rs:245:20:245:54 | MacroExpr | provenance | | +| test_logging.rs:245:28:245:53 | ...::must_use(...) | test_logging.rs:245:20:245:65 | ... .as_bytes() | provenance | MaD:18 | +| test_logging.rs:245:28:245:53 | MacroExpr | test_logging.rs:245:28:245:53 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:245:28:245:53 | { ... } | test_logging.rs:245:28:245:53 | ...::must_use(...) | provenance | MaD:17 | +| test_logging.rs:245:46:245:53 | password | test_logging.rs:245:28:245:53 | MacroExpr | provenance | | +| test_logging.rs:248:15:248:49 | MacroExpr | test_logging.rs:248:15:248:60 | ... .as_bytes() [&ref] | provenance | MaD:18 | +| test_logging.rs:248:15:248:49 | res | test_logging.rs:248:23:248:48 | { ... } | provenance | | +| test_logging.rs:248:15:248:60 | ... .as_bytes() | test_logging.rs:248:9:248:13 | write | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:248:15:248:60 | ... .as_bytes() [&ref] | test_logging.rs:248:9:248:13 | write | provenance | MaD:7 Sink:MaD:7 | +| test_logging.rs:248:23:248:48 | ...::format(...) | test_logging.rs:248:15:248:49 | res | provenance | | +| test_logging.rs:248:23:248:48 | ...::must_use(...) | test_logging.rs:248:15:248:49 | MacroExpr | provenance | | +| test_logging.rs:248:23:248:48 | ...::must_use(...) | test_logging.rs:248:15:248:60 | ... .as_bytes() | provenance | MaD:18 | +| test_logging.rs:248:23:248:48 | MacroExpr | test_logging.rs:248:23:248:48 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:248:23:248:48 | { ... } | test_logging.rs:248:23:248:48 | ...::must_use(...) | provenance | MaD:17 | +| test_logging.rs:248:41:248:48 | password | test_logging.rs:248:23:248:48 | MacroExpr | provenance | | +| test_logging.rs:251:15:251:49 | MacroExpr | test_logging.rs:251:15:251:60 | ... .as_bytes() [&ref] | provenance | MaD:18 | +| test_logging.rs:251:15:251:49 | res | test_logging.rs:251:23:251:48 | { ... } | provenance | | +| test_logging.rs:251:15:251:60 | ... .as_bytes() | test_logging.rs:251:9:251:13 | write | provenance | MaD:6 Sink:MaD:6 | +| test_logging.rs:251:15:251:60 | ... .as_bytes() [&ref] | test_logging.rs:251:9:251:13 | write | provenance | MaD:6 Sink:MaD:6 | +| test_logging.rs:251:23:251:48 | ...::format(...) | test_logging.rs:251:15:251:49 | res | provenance | | +| test_logging.rs:251:23:251:48 | ...::must_use(...) | test_logging.rs:251:15:251:49 | MacroExpr | provenance | | +| test_logging.rs:251:23:251:48 | ...::must_use(...) | test_logging.rs:251:15:251:60 | ... .as_bytes() | provenance | MaD:18 | +| test_logging.rs:251:23:251:48 | MacroExpr | test_logging.rs:251:23:251:48 | ...::format(...) | provenance | MaD:20 | +| test_logging.rs:251:23:251:48 | { ... } | test_logging.rs:251:23:251:48 | ...::must_use(...) | provenance | MaD:17 | +| test_logging.rs:251:41:251:48 | password | test_logging.rs:251:23:251:48 | MacroExpr | provenance | | models | 1 | Sink: ::log_expect; Argument[0]; log-injection | -| 2 | Sink: ::log_expect; Argument[0]; log-injection | -| 3 | Sink: ::log_expect; Argument[self].Field[core::result::Result::Err(0)]; log-injection | -| 4 | Sink: ::log_unwrap; Argument[self].Field[core::result::Result::Err(0)]; log-injection | -| 5 | Sink: core::panicking::assert_failed; Argument[3].Field[core::option::Option::Some(0)]; log-injection | -| 6 | Sink: core::panicking::assert_failed; Argument[3]; log-injection | -| 7 | Sink: core::panicking::panic_fmt; Argument[0]; log-injection | -| 8 | Sink: log::__private_api::log; Argument[1]; log-injection | -| 9 | Sink: log::__private_api::log; Argument[3]; log-injection | -| 10 | Sink: std::io::stdio::_eprint; Argument[0]; log-injection | -| 11 | Sink: std::io::stdio::_print; Argument[0]; log-injection | -| 12 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | -| 13 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 2 | Sink: ::expect; Argument[0]; log-injection | +| 3 | Sink: ::log_expect; Argument[0]; log-injection | +| 4 | Sink: ::log_expect; Argument[self].Field[core::result::Result::Err(0)]; log-injection | +| 5 | Sink: ::log_unwrap; Argument[self].Field[core::result::Result::Err(0)]; log-injection | +| 6 | Sink: ::write; Argument[0]; log-injection | +| 7 | Sink: ::write; Argument[0]; log-injection | +| 8 | Sink: ::write_all; Argument[0]; log-injection | +| 9 | Sink: core::panicking::assert_failed; Argument[3].Field[core::option::Option::Some(0)]; log-injection | +| 10 | Sink: core::panicking::assert_failed; Argument[3]; log-injection | +| 11 | Sink: core::panicking::panic_fmt; Argument[0]; log-injection | +| 12 | Sink: log::__private_api::log; Argument[1]; log-injection | +| 13 | Sink: log::__private_api::log; Argument[3]; log-injection | +| 14 | Sink: std::io::stdio::_eprint; Argument[0]; log-injection | +| 15 | Sink: std::io::stdio::_print; Argument[0]; log-injection | +| 16 | Summary: ::as_str; Argument[self]; ReturnValue; value | +| 17 | Summary: core::hint::must_use; Argument[0]; ReturnValue; value | +| 18 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; value | +| 19 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | +| 20 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | nodes | test_logging.rs:42:5:42:36 | ...::log | semmle.label | ...::log | | test_logging.rs:42:12:42:35 | MacroExpr | semmle.label | MacroExpr | @@ -445,4 +512,55 @@ nodes | test_logging.rs:226:36:226:59 | ...::Some(...) [Some] | semmle.label | ...::Some(...) [Some] | | test_logging.rs:226:36:226:59 | MacroExpr | semmle.label | MacroExpr | | test_logging.rs:226:52:226:59 | password | semmle.label | password | +| test_logging.rs:229:23:229:28 | expect | semmle.label | expect | +| test_logging.rs:229:23:229:28 | expect | semmle.label | expect | +| test_logging.rs:229:30:229:62 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:229:30:229:62 | res | semmle.label | res | +| test_logging.rs:229:30:229:71 | ... .as_str() | semmle.label | ... .as_str() | +| test_logging.rs:229:30:229:71 | ... .as_str() [&ref] | semmle.label | ... .as_str() [&ref] | +| test_logging.rs:229:38:229:61 | ...::format(...) | semmle.label | ...::format(...) | +| test_logging.rs:229:38:229:61 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| test_logging.rs:229:38:229:61 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:229:38:229:61 | { ... } | semmle.label | { ... } | +| test_logging.rs:229:54:229:61 | password | semmle.label | password | +| test_logging.rs:242:10:242:14 | write | semmle.label | write | +| test_logging.rs:242:16:242:50 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:242:16:242:50 | res | semmle.label | res | +| test_logging.rs:242:16:242:61 | ... .as_bytes() | semmle.label | ... .as_bytes() | +| test_logging.rs:242:16:242:61 | ... .as_bytes() [&ref] | semmle.label | ... .as_bytes() [&ref] | +| test_logging.rs:242:24:242:49 | ...::format(...) | semmle.label | ...::format(...) | +| test_logging.rs:242:24:242:49 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| test_logging.rs:242:24:242:49 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:242:24:242:49 | { ... } | semmle.label | { ... } | +| test_logging.rs:242:42:242:49 | password | semmle.label | password | +| test_logging.rs:245:10:245:18 | write_all | semmle.label | write_all | +| test_logging.rs:245:20:245:54 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:245:20:245:54 | res | semmle.label | res | +| test_logging.rs:245:20:245:65 | ... .as_bytes() | semmle.label | ... .as_bytes() | +| test_logging.rs:245:20:245:65 | ... .as_bytes() [&ref] | semmle.label | ... .as_bytes() [&ref] | +| test_logging.rs:245:28:245:53 | ...::format(...) | semmle.label | ...::format(...) | +| test_logging.rs:245:28:245:53 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| test_logging.rs:245:28:245:53 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:245:28:245:53 | { ... } | semmle.label | { ... } | +| test_logging.rs:245:46:245:53 | password | semmle.label | password | +| test_logging.rs:248:9:248:13 | write | semmle.label | write | +| test_logging.rs:248:15:248:49 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:248:15:248:49 | res | semmle.label | res | +| test_logging.rs:248:15:248:60 | ... .as_bytes() | semmle.label | ... .as_bytes() | +| test_logging.rs:248:15:248:60 | ... .as_bytes() [&ref] | semmle.label | ... .as_bytes() [&ref] | +| test_logging.rs:248:23:248:48 | ...::format(...) | semmle.label | ...::format(...) | +| test_logging.rs:248:23:248:48 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| test_logging.rs:248:23:248:48 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:248:23:248:48 | { ... } | semmle.label | { ... } | +| test_logging.rs:248:41:248:48 | password | semmle.label | password | +| test_logging.rs:251:9:251:13 | write | semmle.label | write | +| test_logging.rs:251:15:251:49 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:251:15:251:49 | res | semmle.label | res | +| test_logging.rs:251:15:251:60 | ... .as_bytes() | semmle.label | ... .as_bytes() | +| test_logging.rs:251:15:251:60 | ... .as_bytes() [&ref] | semmle.label | ... .as_bytes() [&ref] | +| test_logging.rs:251:23:251:48 | ...::format(...) | semmle.label | ...::format(...) | +| test_logging.rs:251:23:251:48 | ...::must_use(...) | semmle.label | ...::must_use(...) | +| test_logging.rs:251:23:251:48 | MacroExpr | semmle.label | MacroExpr | +| test_logging.rs:251:23:251:48 | { ... } | semmle.label | { ... } | +| test_logging.rs:251:41:251:48 | password | semmle.label | password | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-312/test_logging.rs b/rust/ql/test/query-tests/security/CWE-312/test_logging.rs index f5f94fc89f8..4b12005a6cb 100644 --- a/rust/ql/test/query-tests/security/CWE-312/test_logging.rs +++ b/rust/ql/test/query-tests/security/CWE-312/test_logging.rs @@ -226,7 +226,7 @@ fn test_std(password: String, i: i32, opt_i: Option) { debug_assert_ne!(1, 1, "message = {}", password); // $ Alert[rust/cleartext-logging] } 11 => { - _ = opt_i.expect(format!("message = {}", password).as_str()); // $ MISSING: Alert[rust/cleartext-logging] (https://github.com/github/codeql/pull/19658) + _ = opt_i.expect(format!("message = {}", password).as_str()); // $ Alert[rust/cleartext-logging] } _ => {} } @@ -239,16 +239,16 @@ fn test_std(password: String, i: i32, opt_i: Option) { .write_fmt(format_args!("message = {}\n", password)); // $ MISSING: Alert[rust/cleartext-logging] std::io::stdout() .lock() - .write(format!("message = {}\n", password).as_bytes()); // $ MISSING: Alert[rust/cleartext-logging] (https://github.com/github/codeql/pull/19658) + .write(format!("message = {}\n", password).as_bytes()); // $ Alert[rust/cleartext-logging] std::io::stdout() .lock() - .write_all(format!("message = {}\n", password).as_bytes()); // $ MISSING: Alert[rust/cleartext-logging] (https://github.com/github/codeql/pull/19658) + .write_all(format!("message = {}\n", password).as_bytes()); // $ Alert[rust/cleartext-logging] let mut out = std::io::stdout().lock(); - out.write(format!("message = {}\n", password).as_bytes()); // $ MISSING: Alert[rust/cleartext-logging] (https://github.com/github/codeql/pull/19658) + out.write(format!("message = {}\n", password).as_bytes()); // $ Alert[rust/cleartext-logging] let mut err = std::io::stderr().lock(); - err.write(format!("message = {}\n", password).as_bytes()); // $ MISSING: Alert[rust/cleartext-logging] (https://github.com/github/codeql/pull/19658) + err.write(format!("message = {}\n", password).as_bytes()); // $ Alert[rust/cleartext-logging] } fn main() { diff --git a/rust/ql/test/query-tests/security/CWE-328/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-328/CONSISTENCY/PathResolutionConsistency.expected new file mode 100644 index 00000000000..cb8b7cc4d6c --- /dev/null +++ b/rust/ql/test/query-tests/security/CWE-328/CONSISTENCY/PathResolutionConsistency.expected @@ -0,0 +1,3 @@ +multipleCallTargets +| test.rs:82:26:82:44 | harmless.as_bytes() | +| test.rs:83:26:83:44 | password.as_bytes() | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 5e99e62b9d2..0f22859a9b2 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -14,7 +14,9 @@ | main.rs:54:13:54:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:59:13:59:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:61:13:61:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:63:13:63:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:64:13:64:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:65:13:65:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:68:13:68:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:88:13:88:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:88:13:88:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:96:17:96:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:96:17:96:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | @@ -69,7 +71,7 @@ edges | main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:35 | | main.rs:20:14:20:63 | ... .unwrap() | main.rs:20:9:20:10 | l2 | provenance | | -| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | +| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:46 | | main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:21:31:21:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:40 | | main.rs:21:31:21:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:40 | @@ -77,17 +79,17 @@ edges | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:35 | | main.rs:22:31:22:53 | ... .unwrap() | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:35 | -| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:46 | +| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:48 | | main.rs:23:31:23:68 | ... .pad_to_align() | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:18 Sink:MaD:18 | | main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | -| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | +| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:47 | | main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:32:9:32:10 | l5 | main.rs:33:31:33:32 | l5 | provenance | | | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | main.rs:32:9:32:10 | l5 | provenance | | | main.rs:32:60:32:60 | v | main.rs:32:60:32:89 | ... * ... | provenance | MaD:37 | -| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | +| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:47 | | main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:35:9:35:10 | s6 | main.rs:36:60:36:61 | s6 | provenance | | | main.rs:35:15:35:49 | ... * ... | main.rs:35:9:35:10 | s6 | provenance | | @@ -96,14 +98,14 @@ edges | main.rs:36:9:36:10 | l6 [Layout.size] | main.rs:37:31:37:32 | l6 [Layout.size] | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) [Layout.size] | main.rs:36:9:36:10 | l6 [Layout.size] | provenance | | -| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:47 | | main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) [Layout.size] | provenance | MaD:31 | | main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:49 | +| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:51 | | main.rs:37:31:37:32 | l6 [Layout.size] | main.rs:39:60:39:68 | l6.size() | provenance | MaD:32 | | main.rs:39:9:39:10 | l7 | main.rs:40:31:40:32 | l7 | provenance | | | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | main.rs:39:9:39:10 | l7 | provenance | | -| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:45 | +| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:47 | | main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:45 | ... + ... | provenance | | @@ -114,34 +116,43 @@ edges | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:35 | | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | | main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | +| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:49 | | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:35 | | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | | main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | +| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:49 | | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:35 | | main.rs:53:31:53:58 | ... .unwrap() | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:48 | +| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:50 | | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:35 | | main.rs:54:31:54:63 | ... .unwrap() | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:48 | +| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:50 | | main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | | main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:34 | | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | main.rs:58:9:58:20 | TuplePat [tuple.0] | provenance | | -| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:47 | +| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:49 | | main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:59:31:59:32 | k1 | main.rs:60:34:60:35 | k1 | provenance | | +| main.rs:59:31:59:32 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:43 | | main.rs:59:31:59:32 | k1 | main.rs:64:48:64:49 | k1 | provenance | | +| main.rs:59:31:59:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:45 | | main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | | main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:35 | | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | | main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:42 | | main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | +| main.rs:62:9:62:20 | TuplePat [tuple.0] | main.rs:62:10:62:11 | k3 | provenance | | +| main.rs:62:10:62:11 | k3 | main.rs:63:31:63:32 | k3 | provenance | | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | provenance | MaD:35 | +| main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | +| main.rs:63:31:63:32 | k3 | main.rs:63:13:63:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:35 | | main.rs:64:31:64:59 | ... .unwrap() | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | -| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:43 | +| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:44 | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap() | provenance | MaD:35 | +| main.rs:65:31:65:59 | ... .unwrap() | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:35 | | main.rs:67:14:67:56 | ... .unwrap() | main.rs:67:9:67:10 | l4 | provenance | | @@ -151,7 +162,7 @@ edges | main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:35 | | main.rs:87:18:87:67 | ... .unwrap() | main.rs:87:9:87:14 | layout | provenance | | -| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | +| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:46 | | main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | | main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | @@ -203,7 +214,7 @@ edges | main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:35 | | main.rs:161:19:161:68 | ... .unwrap() | main.rs:161:13:161:15 | l13 | provenance | | -| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | +| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:46 | | main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | | main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | @@ -256,7 +267,7 @@ edges | main.rs:230:46:230:46 | v | main.rs:230:13:230:44 | ...::try_with_capacity_in | provenance | MaD:3 Sink:MaD:3 | | main.rs:230:46:230:46 | v | main.rs:231:42:231:42 | v | provenance | | | main.rs:231:42:231:42 | v | main.rs:231:13:231:40 | ...::with_capacity_in | provenance | MaD:4 Sink:MaD:4 | -| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:50 | +| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:52 | | main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | | main.rs:280:21:280:47 | user_input.parse() [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | | main.rs:280:21:280:48 | TryExpr | main.rs:280:9:280:17 | num_bytes | provenance | | @@ -265,10 +276,10 @@ edges | main.rs:282:9:282:14 | layout | main.rs:284:40:284:45 | layout | provenance | | | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:35 | | main.rs:282:18:282:75 | ... .unwrap() | main.rs:282:9:282:14 | layout | provenance | | -| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:44 | +| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:46 | | main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:17 Sink:MaD:17 | | main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:30 | -| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:51 | +| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:53 | | main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:33 | | main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | | main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | @@ -278,9 +289,9 @@ edges | main.rs:317:9:317:9 | v | main.rs:324:25:324:25 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:325:22:325:22 | v | provenance | | | main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:30 | -| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:51 | +| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:53 | | main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:33 | -| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:50 | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:52 | | main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:35 | | main.rs:317:13:317:91 | ... .unwrap() | main.rs:317:9:317:9 | v | provenance | | | main.rs:320:34:320:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | @@ -332,15 +343,17 @@ models | 40 | Summary: lang:core; ::align_to; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | | 41 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | | 42 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 43 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 44 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 45 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | -| 46 | Summary: lang:core; ::pad_to_align; Argument[self]; ReturnValue; taint | -| 47 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 48 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 49 | Summary: lang:core; ::size; Argument[self]; ReturnValue; taint | -| 50 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 51 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 43 | Summary: lang:core; ::extend; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 44 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 45 | Summary: lang:core; ::extend_packed; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 46 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 47 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | +| 48 | Summary: lang:core; ::pad_to_align; Argument[self]; ReturnValue; taint | +| 49 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 50 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 51 | Summary: lang:core; ::size; Argument[self]; ReturnValue; taint | +| 52 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 53 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[core::option::Option::Some(0)]; value | nodes | main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | | main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | @@ -420,10 +433,19 @@ nodes | main.rs:60:34:60:35 | k1 | semmle.label | k1 | | main.rs:61:13:61:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:61:31:61:32 | k2 | semmle.label | k2 | +| main.rs:62:9:62:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | +| main.rs:62:10:62:11 | k3 | semmle.label | k3 | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | semmle.label | k1.extend(...) [Ok, tuple.0] | +| main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | semmle.label | ... .unwrap() [tuple.0] | +| main.rs:63:13:63:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:63:31:63:32 | k3 | semmle.label | k3 | | main.rs:64:13:64:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | semmle.label | l3.extend_packed(...) [Ok] | | main.rs:64:31:64:59 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:64:48:64:49 | k1 | semmle.label | k1 | +| main.rs:65:13:65:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | semmle.label | k1.extend_packed(...) [Ok] | +| main.rs:65:31:65:59 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:67:9:67:10 | l4 | semmle.label | l4 | | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | | main.rs:67:14:67:56 | ... .unwrap() | semmle.label | ... .unwrap() | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index 0b39862ef32..1f549cb2675 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -60,9 +60,9 @@ unsafe fn test_std_alloc_new_repeat_extend(v: usize) { let (k2, _offs2) = l3.extend(k1).unwrap(); let _ = std::alloc::alloc(k2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let (k3, _offs3) = k1.extend(l3).unwrap(); - let _ = std::alloc::alloc(k3); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 (https://github.com/github/codeql/pull/19658) + let _ = std::alloc::alloc(k3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc(l3.extend_packed(k1).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(k1.extend_packed(l3).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 (https://github.com/github/codeql/pull/19658) + let _ = std::alloc::alloc(k1.extend_packed(l3).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l4 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l4); // $ Alert[rust/uncontrolled-allocation-size]=arg1 From 006d77ffdd49dc424d029d81f41de0f3ac4107f5 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 11 Jul 2025 06:13:01 +0100 Subject: [PATCH 65/96] Refactor QL to make type check more concise --- .../semmle/code/java/security/UnsafeDeserializationQuery.qll | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll b/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll index e10c6cebaf6..541942c6036 100644 --- a/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll +++ b/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll @@ -149,10 +149,7 @@ predicate unsafeDeserialization(MethodCall ma, Expr sink) { exists(Method m | m = ma.getMethod() | m instanceof ObjectInputStreamReadObjectMethod and sink = ma.getQualifier() and - not exists(DataFlow::ExprNode node | - node.getExpr() = sink and - node.getTypeBound() instanceof SafeObjectInputStreamType - ) + not DataFlow::exprNode(sink).getTypeBound() instanceof SafeObjectInputStreamType or m instanceof XmlDecoderReadObjectMethod and sink = ma.getQualifier() From 07598e8b62eac17ec34150c8b71326ae90335b90 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Fri, 11 Jul 2025 05:59:13 +0000 Subject: [PATCH 66/96] Add test results. --- .../Security/CWE-829/UntrustedCheckoutCritical.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected b/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected index 9e54eb48c9a..39e54b2bbae 100644 --- a/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected +++ b/actions/ql/test/query-tests/Security/CWE-829/UntrustedCheckoutCritical.expected @@ -59,6 +59,8 @@ edges | .github/workflows/artifactpoisoning95.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning95.yml:19:9:19:24 | Run Step | | .github/workflows/artifactpoisoning96.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:9:18:24 | Run Step | +| .github/workflows/artifactpoisoning97.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning97.yml:13:9:19:6 | Uses Step | +| .github/workflows/artifactpoisoning97.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning97.yml:19:9:19:25 | Run Step | | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:16:9:19:59 | Run Step: pr_number | | .github/workflows/auto_ci.yml:20:9:27:6 | Uses Step | .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step | | .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step | .github/workflows/auto_ci.yml:32:9:37:6 | Run Step | From 53ee565fdb02d271ba5ad74d596709afba0103b9 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 10 Jul 2025 20:46:39 +0200 Subject: [PATCH 67/96] Rust: Add more type inference tests --- .../test/library-tests/type-inference/main.rs | 139 +++++++++++--- .../type-inference/type-inference.expected | 178 ++++++++++++++---- 2 files changed, 254 insertions(+), 63 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index a9cc146bc09..253ed603f91 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2346,6 +2346,121 @@ mod tuples { } } +pub mod pattern_matching { + struct MyRecordStruct { + value1: T1, + value2: T2, + } + + struct MyTupleStruct(T1, T2); + + enum MyEnum { + Variant1 { value1: T1, value2: T2 }, + Variant2(T2, T1), + } + + pub fn f() -> Option<()> { + let value = Some(42); + if let Some(mesg) = value { + let mesg = mesg; // $ MISSING: type=mesg:i32 + println!("{mesg}"); + } + match value { + Some(mesg) => { + let mesg = mesg; // $ MISSING: type=mesg:i32 + println!("{mesg}"); + } + None => (), + }; + let mesg = value.unwrap(); // $ method=unwrap + let mesg = mesg; // $ type=mesg:i32 + println!("{mesg}"); + let mesg = value?; // $ type=mesg:i32 + println!("{mesg}"); + + let value2 = &Some(42); + if let &Some(mesg) = value2 { + let mesg = mesg; // $ MISSING: type=mesg:i32 + println!("{mesg}"); + } + + let value3 = 42; + if let ref mesg = value3 { + let mesg = mesg; // $ MISSING: type=mesg:&T.i32 + println!("{mesg}"); + } + + let value4 = Some(42); + if let Some(ref mesg) = value4 { + let mesg = mesg; // $ MISSING: type=mesg:&T.i32 + println!("{mesg}"); + } + + let ref value5 = 42; + let x = value5; // $ MISSING: type=x:&T.i32 + + let my_record_struct = MyRecordStruct { + value1: 42, + value2: false, + }; + if let MyRecordStruct { value1, value2 } = my_record_struct { + let x = value1; // $ MISSING: type=x:i32 + let y = value2; // $ MISSING: type=y:bool + (); + } + + let my_tuple_struct = MyTupleStruct(42, false); + if let MyTupleStruct(value1, value2) = my_tuple_struct { + let x = value1; // $ MISSING: type=x:i32 + let y = value2; // $ MISSING: type=y:bool + (); + } + + let my_enum1 = MyEnum::Variant1 { + value1: 42, + value2: false, + }; + match my_enum1 { + MyEnum::Variant1 { value1, value2 } => { + let x = value1; // $ MISSING: type=x:i32 + let y = value2; // $ MISSING: type=y:bool + (); + } + MyEnum::Variant2(value1, value2) => { + let x = value1; // $ MISSING: type=x:bool + let y = value2; // $ MISSING: type=y:i32 + (); + } + } + + let my_nested_enum = MyEnum::Variant2( + false, + MyRecordStruct { + value1: 42, + value2: "string", + }, + ); + + match my_nested_enum { + MyEnum::Variant2( + value1, + MyRecordStruct { + value1: x, + value2: y, + }, + ) => { + let a = value1; // $ MISSING: type=a:bool + let b = x; // $ MISSING: type=b:i32 + let c = y; // $ MISSING: type=c:&T.str + (); + } + _ => (), + } + + None + } +} + fn main() { field_access::f(); // $ method=f method_impl::f(); // $ method=f @@ -2374,27 +2489,5 @@ fn main() { method_determined_by_argument_type::f(); // $ method=f tuples::f(); // $ method=f dereference::test(); // $ method=test -} - -pub mod unwrap { - pub fn test_unwrapping() -> Option<()> { - let value = Some(42); - if let Some(mesg) = value { - let mesg = mesg; // $ MISSING: type=mesg:i32 - println!("{mesg}"); - } - match value { - Some(mesg) => { - let mesg = mesg; // $ MISSING: type=mesg:i32 - println!("{mesg}"); - } - None => (), - }; - let mesg = value.unwrap(); // $ method=unwrap - let mesg = mesg; // $ type=mesg:i32 - println!("{mesg}"); - let mesg = value?; // $ type=mesg:i32 - println!("{mesg}"); - None - } + pattern_matching::f(); // $ method=f } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 21cb6d0f785..4a6898c7987 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -4009,48 +4009,146 @@ inferType | main.rs:2326:14:2326:18 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | | main.rs:2326:21:2326:25 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | | main.rs:2328:16:2328:19 | SelfParam | | main.rs:2322:5:2322:16 | S1 | -| main.rs:2351:5:2351:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2352:5:2352:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2352:20:2352:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2352:41:2352:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2368:5:2368:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | -| main.rs:2380:44:2399:5 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2381:13:2381:17 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2381:13:2381:17 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:21:2381:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2381:21:2381:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:26:2381:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:29:2382:33 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2382:29:2382:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2362:30:2461:5 | { ... } | | {EXTERNAL LOCATION} | Option | +| main.rs:2363:13:2363:17 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2363:13:2363:17 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2363:21:2363:28 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2363:21:2363:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2363:26:2363:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2364:29:2364:33 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2364:29:2364:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2366:22:2366:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2366:22:2366:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2366:22:2366:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2366:22:2366:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2368:15:2368:19 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2368:15:2368:19 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2371:26:2371:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2371:26:2371:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2371:26:2371:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2371:26:2371:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2375:13:2375:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2375:20:2375:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2375:20:2375:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2375:20:2375:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | +| main.rs:2376:13:2376:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2376:20:2376:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2377:18:2377:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2377:18:2377:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2377:18:2377:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2377:18:2377:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2377:20:2377:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2378:13:2378:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2378:20:2378:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2378:20:2378:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2378:20:2378:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | +| main.rs:2379:18:2379:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2379:18:2379:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2379:18:2379:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2379:18:2379:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2379:20:2379:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:13:2381:18 | value2 | | file://:0:0:0:0 | & | +| main.rs:2381:13:2381:18 | value2 | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2381:13:2381:18 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:22:2381:30 | &... | | file://:0:0:0:0 | & | +| main.rs:2381:22:2381:30 | &... | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2381:22:2381:30 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:23:2381:30 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2381:23:2381:30 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:28:2381:29 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:30:2382:35 | value2 | | file://:0:0:0:0 | & | +| main.rs:2382:30:2382:35 | value2 | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2382:30:2382:35 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | | main.rs:2384:22:2384:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2384:22:2384:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2384:22:2384:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2384:22:2384:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2386:15:2386:19 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2386:15:2386:19 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2389:26:2389:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2389:26:2389:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2389:26:2389:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2389:26:2389:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2393:13:2393:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:20:2393:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2393:20:2393:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:20:2393:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:13:2394:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:20:2394:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2395:18:2395:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2395:18:2395:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2395:18:2395:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2395:18:2395:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2395:20:2395:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2396:13:2396:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2396:20:2396:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2396:20:2396:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2396:20:2396:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | -| main.rs:2397:18:2397:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2397:18:2397:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2397:18:2397:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2397:18:2397:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2397:20:2397:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2398:9:2398:12 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2387:13:2387:18 | value3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2387:22:2387:23 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2388:27:2388:32 | value3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2390:22:2390:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2390:22:2390:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2390:22:2390:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2390:22:2390:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2393:13:2393:18 | value4 | | {EXTERNAL LOCATION} | Option | +| main.rs:2393:13:2393:18 | value4 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:22:2393:29 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2393:22:2393:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:27:2393:28 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:33:2394:38 | value4 | | {EXTERNAL LOCATION} | Option | +| main.rs:2394:33:2394:38 | value4 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2396:22:2396:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2396:22:2396:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2396:22:2396:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2396:22:2396:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2399:13:2399:22 | ref value5 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2399:26:2399:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:13:2400:13 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:17:2400:22 | value5 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2402:13:2402:28 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2402:13:2402:28 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2402:13:2402:28 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2402:32:2405:9 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2402:32:2405:9 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2402:32:2405:9 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2403:21:2403:22 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2404:21:2404:25 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2406:52:2406:67 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2406:52:2406:67 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2406:52:2406:67 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2412:13:2412:27 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | +| main.rs:2412:13:2412:27 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2412:13:2412:27 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2412:31:2412:54 | MyTupleStruct(...) | | main.rs:2355:5:2355:41 | MyTupleStruct | +| main.rs:2412:31:2412:54 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2412:31:2412:54 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2412:45:2412:46 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2412:49:2412:53 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2413:48:2413:62 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | +| main.rs:2413:48:2413:62 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2413:48:2413:62 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2419:13:2419:20 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2419:13:2419:20 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2419:13:2419:20 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2419:24:2422:9 | ...::Variant1 {...} | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2419:24:2422:9 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2419:24:2422:9 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2420:21:2420:22 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2421:21:2421:25 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2423:15:2423:22 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2423:15:2423:22 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2423:15:2423:22 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2436:13:2436:26 | my_nested_enum | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2436:13:2436:26 | my_nested_enum | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2436:13:2436:26 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2436:13:2436:26 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2436:13:2436:26 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2436:13:2436:26 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2436:30:2442:9 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2437:13:2437:17 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2438:13:2441:13 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2439:25:2439:26 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2440:25:2440:32 | "string" | | file://:0:0:0:0 | & | +| main.rs:2440:25:2440:32 | "string" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2444:15:2444:28 | my_nested_enum | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2444:15:2444:28 | my_nested_enum | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2444:15:2444:28 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2444:15:2444:28 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2444:15:2444:28 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2444:15:2444:28 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2460:9:2460:12 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2466:5:2466:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2467:5:2467:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2467:20:2467:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2467:41:2467:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2483:5:2483:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| main.rs:2492:5:2492:25 | ...::f(...) | | {EXTERNAL LOCATION} | Option | testFailures From 6736dd4e8f30a3f18cb0c25892860aa2a11c006a Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Jul 2025 09:36:38 +0100 Subject: [PATCH 68/96] C++: Add some tests with missing flow through function objects. --- .../dataflow/external-models/flow.ext.yml | 3 +- .../dataflow/external-models/sinks.expected | 4 ++ .../dataflow/external-models/sources.expected | 1 + .../dataflow/external-models/test.cpp | 45 +++++++++++++++++++ .../dataflow/taint-tests/localTaint.expected | 13 ++++-- .../taint-tests/test_mad-signatures.expected | 7 +++ .../dataflow/taint-tests/thread.cpp | 4 ++ 7 files changed, 73 insertions(+), 4 deletions(-) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml b/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml index 12dbf7d4cd2..f0df3e749e6 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml @@ -16,4 +16,5 @@ extensions: - ["", "", False, "ymlStepManual", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - ["", "", False, "ymlStepGenerated", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"] - ["", "", False, "ymlStepManual_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["", "", False, "ymlStepGenerated_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"] \ No newline at end of file + - ["", "", False, "ymlStepGenerated_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"] + - ["", "", False, "callWithArgument", "", "", "Argument[1]", "Argument[0].Parameter[0]", "value", "manual"] \ No newline at end of file diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected index 7e5b714765b..0cc01c8165e 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected @@ -9,3 +9,7 @@ | test.cpp:33:10:33:11 | z2 | test-sink | | test.cpp:36:10:36:11 | z3 | test-sink | | test.cpp:48:16:48:16 | x | test-sink | +| test.cpp:69:11:69:11 | y | test-sink | +| test.cpp:75:11:75:11 | y | test-sink | +| test.cpp:83:11:83:11 | y | test-sink | +| test.cpp:89:11:89:11 | y | test-sink | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected index b0f52caf00c..401fffdbd59 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected @@ -1,6 +1,7 @@ | asio_streams.cpp:87:34:87:44 | read_until output argument | remote | | test.cpp:10:10:10:18 | call to ymlSource | local | | test.cpp:56:8:56:16 | call to ymlSource | local | +| test.cpp:94:10:94:18 | call to ymlSource | local | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | local | | windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | local | | windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index d40ee556a63..50e78a17650 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -58,3 +58,48 @@ int test_pthread_create() { pthread_t threadId; pthread_create(&threadId, nullptr, myThreadFunction, (void *)&s); } + +template +void callWithArgument(F f, int x); + +struct StructWithOperatorCall_has_constructor { + StructWithOperatorCall_has_constructor(); + + void operator()(int y) { + ymlSink(y); // $ MISSING: ir + } +}; + +struct StructWithOperatorCall_no_constructor { + void operator()(int y) { + ymlSink(y); // $ MISSING: ir + } +}; + +struct StructWithOperatorCall_has_constructor_2 { + StructWithOperatorCall_has_constructor_2(); + + void operator()(int y) { + ymlSink(y); // $ MISSING: ir + } +}; + +struct StructWithOperatorCall_no_constructor_2 { + void operator()(int y) { + ymlSink(y); // $ MISSING: ir + } +}; + +void test_callWithArgument() { + int x = ymlSource(); + { + StructWithOperatorCall_has_constructor func; + callWithArgument(func, x); + } + { + StructWithOperatorCall_no_constructor func; + callWithArgument(func, x); + } + callWithArgument(StructWithOperatorCall_has_constructor_2(), x); + callWithArgument(StructWithOperatorCall_no_constructor_2(), x); +} \ No newline at end of file diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected index 1bf719e630e..e19f34eb217 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected @@ -7777,17 +7777,24 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future | thread.cpp:24:5:24:5 | s | thread.cpp:26:38:26:38 | s | | | thread.cpp:24:5:24:5 | s | thread.cpp:27:37:27:37 | s | | | thread.cpp:24:5:24:5 | s | thread.cpp:28:38:28:38 | s | | +| thread.cpp:24:5:24:5 | s | thread.cpp:32:7:32:7 | s | | | thread.cpp:25:3:25:3 | s [post update] | thread.cpp:26:38:26:38 | s | | | thread.cpp:25:3:25:3 | s [post update] | thread.cpp:27:37:27:37 | s | | | thread.cpp:25:3:25:3 | s [post update] | thread.cpp:28:38:28:38 | s | | +| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:32:7:32:7 | s | | | thread.cpp:25:3:25:16 | ... = ... | thread.cpp:25:5:25:5 | x [post update] | | | thread.cpp:25:9:25:14 | call to source | thread.cpp:25:3:25:16 | ... = ... | | -| thread.cpp:26:18:26:39 | call to thread | thread.cpp:29:1:29:1 | t1 | | +| thread.cpp:26:18:26:39 | call to thread | thread.cpp:33:1:33:1 | t1 | | | thread.cpp:26:38:26:38 | s | thread.cpp:26:37:26:38 | & ... | | -| thread.cpp:27:18:27:38 | call to thread | thread.cpp:29:1:29:1 | t2 | | +| thread.cpp:27:18:27:38 | call to thread | thread.cpp:33:1:33:1 | t2 | | | thread.cpp:27:37:27:37 | ref arg s | thread.cpp:28:38:28:38 | s | | -| thread.cpp:28:18:28:43 | call to thread | thread.cpp:29:1:29:1 | t3 | | +| thread.cpp:27:37:27:37 | ref arg s | thread.cpp:32:7:32:7 | s | | +| thread.cpp:28:18:28:43 | call to thread | thread.cpp:33:1:33:1 | t3 | | | thread.cpp:28:38:28:38 | s | thread.cpp:28:37:28:38 | & ... | | +| thread.cpp:30:18:32:8 | call to thread | thread.cpp:33:1:33:1 | t4 | | +| thread.cpp:30:24:30:24 | p | thread.cpp:30:24:30:24 | p | | +| thread.cpp:30:24:30:24 | p | thread.cpp:31:10:31:10 | p | | +| thread.cpp:32:7:32:7 | s | thread.cpp:32:6:32:7 | & ... | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | | | vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected index 9a128a36035..239ed2ec607 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected @@ -46936,6 +46936,8 @@ getParameterTypeName | stl.h:690:12:690:17 | thread | 0 | func:0 && | | stl.h:690:12:690:17 | thread | 0 | func:0 && | | stl.h:690:12:690:17 | thread | 0 | func:0 && | +| stl.h:690:12:690:17 | thread | 0 | func:0 && | +| stl.h:690:12:690:17 | thread | 1 | func:1 && | | stl.h:690:12:690:17 | thread | 1 | func:1 && | | stl.h:690:12:690:17 | thread | 1 | func:1 && | | stl.h:690:12:690:17 | thread | 1 | func:1 && | @@ -47196,6 +47198,11 @@ getParameterTypeName | thread.cpp:14:6:14:22 | thread_function_2 | 0 | S | | thread.cpp:18:6:18:22 | thread_function_3 | 0 | S * | | thread.cpp:18:6:18:22 | thread_function_3 | 1 | int | +| thread.cpp:30:18:30:18 | (unnamed constructor) | 0 | const lambda [] type at line 762, col. 18 & | +| thread.cpp:30:18:30:18 | (unnamed constructor) | 0 | lambda [] type at line 762, col. 18 && | +| thread.cpp:30:18:30:18 | operator= | 0 | const lambda [] type at line 762, col. 18 & | +| thread.cpp:30:20:30:20 | _FUN | 0 | S * | +| thread.cpp:30:20:30:20 | operator() | 0 | S * | | vector.cpp:13:6:13:9 | sink | 0 | int | | vector.cpp:14:27:14:30 | sink | 0 | vector> & | | vector.cpp:14:27:14:30 | sink | 0 | vector> & | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp index b0393801a94..81320a26e8a 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp @@ -26,4 +26,8 @@ void test_thread() { std::thread t1(thread_function_1, &s); std::thread t2(thread_function_2, s); std::thread t3(thread_function_3, &s, 42); + + std::thread t4([](S* p) { + sink(p->x); // $ MISSING: ir + }, &s); } \ No newline at end of file From 11cba94032f48923eed475b598b7407b99089269 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 20:36:26 +0100 Subject: [PATCH 69/96] C++: Add a missing predicate on 'UninitializedInstruction' that we will use later. --- .../ir/implementation/aliased_ssa/Instruction.qll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll index af5dd419985..96c18a04ff7 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll @@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction { * Gets the variable that is uninitialized. */ final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() } + + /** + * Gets the operand that provides the address of the location to which the + * uninitialized value will be stored. + */ + final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() } + + /** + * Gets the instruction whose result provides the address of the location to + * which the value will be stored, if an exact definition is available. + */ + final Instruction getDestinationAddress() { + result = this.getDestinationAddressOperand().getDef() + } } /** From 663c3e7b6da7869496c879aaf6b51fbc51c4a67b Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 20:36:44 +0100 Subject: [PATCH 70/96] C++: Sync identical files. --- .../code/cpp/ir/implementation/raw/Instruction.qll | 14 ++++++++++++++ .../implementation/unaliased_ssa/Instruction.qll | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll index af5dd419985..96c18a04ff7 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll @@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction { * Gets the variable that is uninitialized. */ final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() } + + /** + * Gets the operand that provides the address of the location to which the + * uninitialized value will be stored. + */ + final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() } + + /** + * Gets the instruction whose result provides the address of the location to + * which the value will be stored, if an exact definition is available. + */ + final Instruction getDestinationAddress() { + result = this.getDestinationAddressOperand().getDef() + } } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll index af5dd419985..96c18a04ff7 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll @@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction { * Gets the variable that is uninitialized. */ final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() } + + /** + * Gets the operand that provides the address of the location to which the + * uninitialized value will be stored. + */ + final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() } + + /** + * Gets the instruction whose result provides the address of the location to + * which the value will be stored, if an exact definition is available. + */ + final Instruction getDestinationAddress() { + result = this.getDestinationAddressOperand().getDef() + } } /** From b53c3547d0880c0963bc4f9b7d90f198cef69406 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 21:06:10 +0100 Subject: [PATCH 71/96] C++: Add lambda dispatch for functors. --- .../ir/dataflow/internal/DataFlowPrivate.qll | 64 +++++++++++++++++-- .../dataflow/external-models/flow.expected | 52 +++++++++++---- .../dataflow/external-models/test.cpp | 4 +- 3 files changed, 99 insertions(+), 21 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index d776985720a..ff0512f44e1 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -1382,16 +1382,63 @@ predicate neverSkipInPathGraph(Node n) { exists(n.asIndirectDefinition()) } -class LambdaCallKind = Unit; +private newtype TLambdaCallKind = + TFunctionPointer() or + TFunctor() + +class LambdaCallKind extends TLambdaCallKind { + predicate isFunctionPointer() { this = TFunctionPointer() } + + predicate isFunctor() { this = TFunctor() } + + string toString() { + this.isFunctionPointer() and + result = "Function pointer kind" + or + this.isFunctor() and + result = "Functor kind" + } +} + +private class ConstructorCallInstruction extends CallInstruction { + Cpp::Class constructedType; + + ConstructorCallInstruction() { + this.getStaticCallTarget().(Cpp::Constructor).getDeclaringType() = constructedType + } + + Cpp::Class getConstructedType() { result = constructedType } +} + +private class OperatorCall extends Cpp::MemberFunction { + OperatorCall() { this.hasName("operator()") } +} + +private predicate isFunctorCreationWithConstructor(Node creation, OperatorCall operator) { + exists(DataFlowCall constructorCall, IndirectionPosition pos | + // A construction of an object with a constructor. In this case we use + // the post-update node of the qualifier + pos.getArgumentIndex() = -1 and + isArgumentNode(creation.(PostUpdateNode).getPreUpdateNode(), constructorCall, pos) and + operator.getDeclaringType() = + constructorCall.asCallInstruction().(ConstructorCallInstruction).getConstructedType() + ) +} /** Holds if `creation` is an expression that creates a lambda of kind `kind` for `c`. */ predicate lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c) { - creation.asInstruction().(FunctionAddressInstruction).getFunctionSymbol() = c.asSourceCallable() and - exists(kind) + kind.isFunctionPointer() and + creation.asInstruction().(FunctionAddressInstruction).getFunctionSymbol() = c.asSourceCallable() + or + kind.isFunctor() and + exists(OperatorCall operator | operator = c.asSourceCallable() | + isFunctorCreationWithConstructor(creation, operator) + ) } /** Holds if `call` is a lambda call of kind `kind` where `receiver` is the lambda expression. */ predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) { + kind.isFunctionPointer() and ( call.(SummaryCall).getReceiver() = receiver.(FlowSummaryNode).getSummaryNode() or @@ -1400,8 +1447,15 @@ predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) { // has a result for `getStaticCallTarget`. not exists(call.getStaticCallTarget()) and call.asCallInstruction().getCallTargetOperand() = receiver.asOperand() - ) and - exists(kind) + ) + or + kind.isFunctor() and + ( + call.(SummaryCall).getReceiver() = receiver.(FlowSummaryNode).getSummaryNode() + or + not exists(call.getStaticCallTarget()) and + call.asCallInstruction().getThisArgumentOperand() = receiver.asOperand() + ) } /** Extra data-flow steps needed for lambda flow analysis. */ diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index bf306c28a99..b0e32bc9b92 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -21,13 +21,14 @@ models | 20 | Summary: ; ; false; CreateRemoteThreadEx; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual | | 21 | Summary: ; ; false; CreateThread; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual | | 22 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual | -| 23 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual | -| 24 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated | -| 25 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual | -| 26 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual | -| 27 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual | +| 23 | Summary: ; ; false; callWithArgument; ; ; Argument[1]; Argument[0].Parameter[0]; value; manual | +| 24 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual | +| 25 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated | +| 26 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual | +| 27 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual | +| 28 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual | edges -| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:27 | +| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:28 | | asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:91:7:91:17 | recv_buffer | provenance | Src:MaD:17 | | asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:93:29:93:39 | *recv_buffer | provenance | Src:MaD:17 Sink:MaD:2 | | asio_streams.cpp:97:37:97:44 | call to source | asio_streams.cpp:98:7:98:14 | send_str | provenance | TaintFunction | @@ -36,10 +37,10 @@ edges | asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:101:7:101:17 | send_buffer | provenance | | | asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:103:29:103:39 | *send_buffer | provenance | Sink:MaD:2 | | asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | provenance | | -| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:27 | -| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:25 | -| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:24 | -| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:26 | +| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:28 | +| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:26 | +| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:25 | +| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:27 | | test.cpp:7:47:7:52 | value2 | test.cpp:7:64:7:69 | value2 | provenance | | | test.cpp:7:64:7:69 | value2 | test.cpp:7:5:7:30 | *ymlStepGenerated_with_body | provenance | | | test.cpp:10:10:10:18 | call to ymlSource | test.cpp:10:10:10:18 | call to ymlSource | provenance | Src:MaD:16 | @@ -51,15 +52,15 @@ edges | test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | | | test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:18:10:18:10 | y | provenance | Sink:MaD:1 | | test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | provenance | | -| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:25 | +| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:26 | | test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | | | test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:22:10:22:10 | z | provenance | Sink:MaD:1 | | test.cpp:21:27:21:27 | x | test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | provenance | | -| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:24 | +| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:25 | | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | | | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:26:10:26:11 | y2 | provenance | Sink:MaD:1 | | test.cpp:25:35:25:35 | x | test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | provenance | | -| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:26 | +| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:27 | | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | | | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:33:10:33:11 | z2 | provenance | Sink:MaD:1 | | test.cpp:32:41:32:41 | x | test.cpp:7:47:7:52 | value2 | provenance | | @@ -67,12 +68,23 @@ edges | test.cpp:46:30:46:32 | *arg [x] | test.cpp:47:12:47:19 | *arg [x] | provenance | | | test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:13:48:13 | *s [x] | provenance | | | test.cpp:48:13:48:13 | *s [x] | test.cpp:48:16:48:16 | x | provenance | Sink:MaD:1 | -| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:23 | +| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:24 | | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | test.cpp:46:30:46:32 | *arg [x] | provenance | | | test.cpp:56:2:56:2 | *s [post update] [x] | test.cpp:59:55:59:64 | *& ... [x] | provenance | | | test.cpp:56:2:56:18 | ... = ... | test.cpp:56:2:56:2 | *s [post update] [x] | provenance | | | test.cpp:56:8:56:16 | call to ymlSource | test.cpp:56:2:56:18 | ... = ... | provenance | Src:MaD:16 | | test.cpp:59:55:59:64 | *& ... [x] | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | provenance | | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:68:22:68:22 | y | provenance | | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:82:22:82:22 | y | provenance | | +| test.cpp:68:22:68:22 | y | test.cpp:69:11:69:11 | y | provenance | Sink:MaD:1 | +| test.cpp:82:22:82:22 | y | test.cpp:83:11:83:11 | y | provenance | Sink:MaD:1 | +| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:16 | +| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:97:26:97:26 | x | provenance | | +| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:103:63:103:63 | x | provenance | | +| test.cpp:97:26:97:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | +| test.cpp:103:63:103:63 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | | @@ -209,6 +221,18 @@ nodes | test.cpp:56:2:56:18 | ... = ... | semmle.label | ... = ... | | test.cpp:56:8:56:16 | call to ymlSource | semmle.label | call to ymlSource | | test.cpp:59:55:59:64 | *& ... [x] | semmle.label | *& ... [x] | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | +| test.cpp:68:22:68:22 | y | semmle.label | y | +| test.cpp:69:11:69:11 | y | semmle.label | y | +| test.cpp:82:22:82:22 | y | semmle.label | y | +| test.cpp:83:11:83:11 | y | semmle.label | y | +| test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:97:26:97:26 | x | semmle.label | x | +| test.cpp:103:63:103:63 | x | semmle.label | x | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | semmle.label | [summary param] *0 in CommandLineToArgvA | | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | semmle.label | [summary] to write: ReturnValue[**] in CommandLineToArgvA | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | semmle.label | *call to GetCommandLineA | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index 50e78a17650..8e76fe8d6d5 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -66,7 +66,7 @@ struct StructWithOperatorCall_has_constructor { StructWithOperatorCall_has_constructor(); void operator()(int y) { - ymlSink(y); // $ MISSING: ir + ymlSink(y); // $ ir } }; @@ -80,7 +80,7 @@ struct StructWithOperatorCall_has_constructor_2 { StructWithOperatorCall_has_constructor_2(); void operator()(int y) { - ymlSink(y); // $ MISSING: ir + ymlSink(y); // $ ir } }; From 4ab2977358c4f4b1262157478f8ceb271c1dec78 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 10 Jul 2025 20:25:18 +0200 Subject: [PATCH 72/96] Rust: Type inference for pattern matching --- .../rust/elements/internal/StructPatImpl.qll | 9 +- .../codeql/rust/internal/TypeInference.qll | 169 +++++++++++- .../PathResolutionConsistency.expected | 6 + .../dataflow/sources/web_frameworks.rs | 4 +- .../PathResolutionConsistency.expected | 2 + .../test/library-tests/type-inference/main.rs | 34 +-- .../type-inference/type-inference.expected | 252 ++++++++++++++---- .../type-inference/type-inference.ql | 4 +- .../security/CWE-022/TaintedPath.expected | 12 +- .../query-tests/security/CWE-022/src/main.rs | 4 +- 10 files changed, 410 insertions(+), 86 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/StructPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/StructPatImpl.qll index 71d4804e282..28afc2a5b0d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/StructPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/StructPatImpl.qll @@ -33,7 +33,7 @@ module Impl { name = this.getStructPatFieldList().getAField().getFieldName() } - /** Gets the record field that matches the `name` pattern of this pattern. */ + /** Gets the struct field that matches the `name` pattern of this pattern. */ pragma[nomagic] StructField getStructField(string name) { exists(PathResolution::ItemNode i | i = this.getResolvedPath(name) | @@ -41,5 +41,12 @@ module Impl { result.isVariantField(i, name) ) } + + /** Gets the struct pattern for the field `name`. */ + pragma[nomagic] + StructPatField getPatField(string name) { + result = this.getStructPatFieldList().getAField() and + name = result.getFieldName() + } } } diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index 0bb6da4e48f..43097c8f760 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -260,7 +260,7 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat prefix2.isEmpty() and ( exists(Variable v | n1 = v.getAnAccess() | - n2 = v.getPat() + n2 = v.getPat().getName() or n2 = v.getParameter().(SelfParam) ) @@ -276,6 +276,22 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat or n1 = n2.(MatchExpr).getAnArm().getExpr() or + exists(LetExpr let | + n1 = let.getScrutinee() and + n2 = let.getPat() + ) + or + exists(MatchExpr me | + n1 = me.getScrutinee() and + n2 = me.getAnArm().getPat() + ) + or + n1 = n2.(OrPat).getAPat() + or + n1 = n2.(ParenPat).getPat() + or + n1 = n2.(LiteralPat).getLiteral() + or exists(BreakExpr break | break.getExpr() = n1 and break.getTarget() = n2.(LoopExpr) @@ -287,9 +303,21 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat ) or n1 = n2.(MacroExpr).getMacroCall().getMacroCallExpansion() + or + n1 = n2.(MacroPat).getMacroCall().getMacroCallExpansion() ) or - n1 = n2.(RefExpr).getExpr() and + n1 = + any(IdentPat ip | + n2 = ip.getName() and + prefix1.isEmpty() and + if ip.isRef() then prefix2 = TypePath::singleton(TRefTypeParameter()) else prefix2.isEmpty() + ) + or + ( + n1 = n2.(RefExpr).getExpr() or + n1 = n2.(RefPat).getPat() + ) and prefix1.isEmpty() and prefix2 = TypePath::singleton(TRefTypeParameter()) or @@ -478,7 +506,7 @@ private module StructExprMatchingInput implements MatchingInputSig { Type getInferredType(AccessPosition apos, TypePath path) { result = inferType(this.getNodeAt(apos), path) or - // The struct type is supplied explicitly as a type qualifier, e.g. + // The struct/enum type is supplied explicitly as a type qualifier, e.g. // `Foo::Variant { ... }`. apos.isStructPos() and exists(Path p, TypeMention tm | @@ -576,7 +604,7 @@ private module CallExprBaseMatchingInput implements MatchingInputSig { } } - abstract private class TupleDeclaration extends Declaration { + abstract additional class TupleDeclaration extends Declaration { override Type getDeclaredType(DeclarationPosition dpos, TypePath path) { result = super.getDeclaredType(dpos, path) or @@ -1032,9 +1060,18 @@ private Type inferFieldExprType(AstNode n, TypePath path) { ) } -/** Gets the root type of the reference expression `re`. */ +/** Gets the root type of the reference node `ref`. */ pragma[nomagic] -private Type inferRefExprType(RefExpr re) { exists(re) and result = TRefType() } +private Type inferRefNodeType(AstNode ref) { + ( + ref = any(IdentPat ip | ip.isRef()).getName() + or + ref instanceof RefExpr + or + ref instanceof RefPat + ) and + result = TRefType() +} pragma[nomagic] private Type inferTryExprType(TryExpr te, TypePath path) { @@ -1178,6 +1215,120 @@ private Type inferIndexExprType(IndexExpr ie, TypePath path) { ) } +/** + * A matching configuration for resolving types of struct patterns + * like `let Foo { bar } = ...`. + */ +private module StructPatMatchingInput implements MatchingInputSig { + class DeclarationPosition = StructExprMatchingInput::DeclarationPosition; + + class Declaration = StructExprMatchingInput::Declaration; + + class AccessPosition = DeclarationPosition; + + class Access extends StructPat { + Type getTypeArgument(TypeArgumentPosition apos, TypePath path) { none() } + + AstNode getNodeAt(AccessPosition apos) { + result = this.getPatField(apos.asFieldPos()).getPat() + or + result = this and + apos.isStructPos() + } + + Type getInferredType(AccessPosition apos, TypePath path) { + result = inferType(this.getNodeAt(apos), path) + or + // The struct/enum type is supplied explicitly as a type qualifier, e.g. + // `let Foo::Variant { ... } = ...`. + apos.isStructPos() and + exists(Path p, TypeMention tm | + p = this.getPath() and + if resolvePath(p) instanceof Variant then tm = p.getQualifier() else tm = p + | + result = tm.resolveTypeAt(path) + ) + } + + Declaration getTarget() { result = resolvePath(this.getPath()) } + } + + predicate accessDeclarationPositionMatch(AccessPosition apos, DeclarationPosition dpos) { + apos = dpos + } +} + +private module StructPatMatching = Matching; + +/** + * Gets the type of `n` at `path`, where `n` is either a struct pattern or + * a field pattern of a struct pattern. + */ +pragma[nomagic] +private Type inferStructPatType(AstNode n, TypePath path) { + exists(StructPatMatchingInput::Access a, StructPatMatchingInput::AccessPosition apos | + n = a.getNodeAt(apos) and + result = StructPatMatching::inferAccessType(a, apos, path) + ) +} + +/** + * A matching configuration for resolving types of tuple struct patterns + * like `let Some(x) = ...`. + */ +private module TupleStructPatMatchingInput implements MatchingInputSig { + class DeclarationPosition = CallExprBaseMatchingInput::DeclarationPosition; + + class Declaration = CallExprBaseMatchingInput::TupleDeclaration; + + class AccessPosition = DeclarationPosition; + + class Access extends TupleStructPat { + Type getTypeArgument(TypeArgumentPosition apos, TypePath path) { none() } + + AstNode getNodeAt(AccessPosition apos) { + result = this.getField(apos.asPosition()) + or + result = this and + apos.isSelf() + } + + Type getInferredType(AccessPosition apos, TypePath path) { + result = inferType(this.getNodeAt(apos), path) + or + // The struct/enum type is supplied explicitly as a type qualifier, e.g. + // `let Option::(x) = ...`. + apos.isSelf() and + exists(Path p, TypeMention tm | + p = this.getPath() and + if resolvePath(p) instanceof Variant then tm = p.getQualifier() else tm = p + | + result = tm.resolveTypeAt(path) + ) + } + + Declaration getTarget() { result = resolvePath(this.getPath()) } + } + + predicate accessDeclarationPositionMatch(AccessPosition apos, DeclarationPosition dpos) { + apos = dpos + } +} + +private module TupleStructPatMatching = Matching; + +/** + * Gets the type of `n` at `path`, where `n` is either a tuple struct pattern or + * a positional pattern of a tuple struct pattern. + */ +pragma[nomagic] +private Type inferTupleStructPatType(AstNode n, TypePath path) { + exists(TupleStructPatMatchingInput::Access a, TupleStructPatMatchingInput::AccessPosition apos | + n = a.getNodeAt(apos) and + result = TupleStructPatMatching::inferAccessType(a, apos, path) + ) +} + final private class ForIterableExpr extends Expr { ForIterableExpr() { this = any(ForExpr fe).getIterable() } @@ -1813,7 +1964,7 @@ private module Cached { or result = inferFieldExprType(n, path) or - result = inferRefExprType(n) and + result = inferRefNodeType(n) and path.isEmpty() or result = inferTryExprType(n, path) @@ -1836,6 +1987,10 @@ private module Cached { result = inferForLoopExprType(n, path) or result = inferCastExprType(n, path) + or + result = inferStructPatType(n, path) + or + result = inferTupleStructPatType(n, path) } } diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index 94ccc8ababc..a285b7b2d36 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -79,5 +79,11 @@ multipleCallTargets | test_futures_io.rs:93:26:93:63 | pinned.poll_read(...) | | test_futures_io.rs:116:22:116:50 | pinned.poll_fill_buf(...) | | test_futures_io.rs:145:26:145:49 | ...::with_capacity(...) | +| web_frameworks.rs:13:14:13:22 | a.as_str() | +| web_frameworks.rs:13:14:13:23 | a.as_str() | +| web_frameworks.rs:14:14:14:24 | a.as_bytes() | +| web_frameworks.rs:14:14:14:25 | a.as_bytes() | | web_frameworks.rs:101:14:101:23 | a.as_str() | | web_frameworks.rs:102:14:102:25 | a.as_bytes() | +| web_frameworks.rs:158:14:158:23 | a.as_str() | +| web_frameworks.rs:159:14:159:25 | a.as_bytes() | diff --git a/rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs b/rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs index 4168d1e3f6a..32cae626593 100644 --- a/rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs +++ b/rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs @@ -10,8 +10,8 @@ mod poem_test { #[handler] fn my_poem_handler_1(Path(a): Path, // $ Alert[rust/summary/taint-sources] ) -> String { - sink(a.as_str()); // $ MISSING: hasTaintFlow -- no type inference for patterns - sink(a.as_bytes()); // $ MISSING: hasTaintFlow -- no type inference for patterns + sink(a.as_str()); // $ hasTaintFlow + sink(a.as_bytes()); // $ hasTaintFlow sink(a); // $ hasTaintFlow "".to_string() diff --git a/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected index 0533774588c..5222ecb5ad2 100644 --- a/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected @@ -24,4 +24,6 @@ multipleCallTargets | test.rs:302:7:302:48 | ... .as_str() | | test.rs:303:7:303:35 | ... .as_str() | | test.rs:304:7:304:35 | ... .as_str() | +| test.rs:313:8:313:19 | num.as_str() | +| test.rs:324:8:324:19 | num.as_str() | | test.rs:343:7:343:39 | ... .as_str() | diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 253ed603f91..91040541f3e 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2362,12 +2362,12 @@ pub mod pattern_matching { pub fn f() -> Option<()> { let value = Some(42); if let Some(mesg) = value { - let mesg = mesg; // $ MISSING: type=mesg:i32 + let mesg = mesg; // $ type=mesg:i32 println!("{mesg}"); } match value { Some(mesg) => { - let mesg = mesg; // $ MISSING: type=mesg:i32 + let mesg = mesg; // $ type=mesg:i32 println!("{mesg}"); } None => (), @@ -2380,39 +2380,39 @@ pub mod pattern_matching { let value2 = &Some(42); if let &Some(mesg) = value2 { - let mesg = mesg; // $ MISSING: type=mesg:i32 + let mesg = mesg; // $ type=mesg:i32 println!("{mesg}"); } let value3 = 42; if let ref mesg = value3 { - let mesg = mesg; // $ MISSING: type=mesg:&T.i32 + let mesg = mesg; // $ type=mesg:&T.i32 println!("{mesg}"); } let value4 = Some(42); if let Some(ref mesg) = value4 { - let mesg = mesg; // $ MISSING: type=mesg:&T.i32 + let mesg = mesg; // $ type=mesg:&T.i32 println!("{mesg}"); } let ref value5 = 42; - let x = value5; // $ MISSING: type=x:&T.i32 + let x = value5; // $ type=x:&T.i32 let my_record_struct = MyRecordStruct { value1: 42, value2: false, }; if let MyRecordStruct { value1, value2 } = my_record_struct { - let x = value1; // $ MISSING: type=x:i32 - let y = value2; // $ MISSING: type=y:bool + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool (); } let my_tuple_struct = MyTupleStruct(42, false); if let MyTupleStruct(value1, value2) = my_tuple_struct { - let x = value1; // $ MISSING: type=x:i32 - let y = value2; // $ MISSING: type=y:bool + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool (); } @@ -2422,13 +2422,13 @@ pub mod pattern_matching { }; match my_enum1 { MyEnum::Variant1 { value1, value2 } => { - let x = value1; // $ MISSING: type=x:i32 - let y = value2; // $ MISSING: type=y:bool + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool (); } MyEnum::Variant2(value1, value2) => { - let x = value1; // $ MISSING: type=x:bool - let y = value2; // $ MISSING: type=y:i32 + let x = value1; // $ type=x:bool + let y = value2; // $ type=y:i32 (); } } @@ -2449,9 +2449,9 @@ pub mod pattern_matching { value2: y, }, ) => { - let a = value1; // $ MISSING: type=a:bool - let b = x; // $ MISSING: type=b:i32 - let c = y; // $ MISSING: type=c:&T.str + let a = value1; // $ type=a:bool + let b = x; // $ type=b:i32 + let c = y; // $ type=c:&T.str (); } _ => (), diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 4a6898c7987..0439d0801ad 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -231,9 +231,9 @@ inferType | main.rs:55:26:55:26 | x | A.T | main.rs:2:5:3:13 | S | | main.rs:55:26:55:28 | x.a | | main.rs:10:5:14:5 | MyOption | | main.rs:55:26:55:28 | x.a | T | main.rs:2:5:3:13 | S | -| main.rs:57:13:57:17 | mut x | | main.rs:16:5:19:5 | GenericThing | -| main.rs:57:13:57:17 | mut x | A | main.rs:10:5:14:5 | MyOption | -| main.rs:57:13:57:17 | mut x | A.T | main.rs:2:5:3:13 | S | +| main.rs:57:17:57:17 | x | | main.rs:16:5:19:5 | GenericThing | +| main.rs:57:17:57:17 | x | A | main.rs:10:5:14:5 | MyOption | +| main.rs:57:17:57:17 | x | A.T | main.rs:2:5:3:13 | S | | main.rs:57:21:59:9 | GenericThing {...} | | main.rs:16:5:19:5 | GenericThing | | main.rs:57:21:59:9 | GenericThing {...} | A | main.rs:10:5:14:5 | MyOption | | main.rs:57:21:59:9 | GenericThing {...} | A.T | main.rs:2:5:3:13 | S | @@ -1257,8 +1257,12 @@ inferType | main.rs:820:13:823:13 | match self { ... } | | main.rs:818:10:818:10 | T | | main.rs:820:19:820:22 | self | | main.rs:807:5:811:5 | MyEnum | | main.rs:820:19:820:22 | self | A | main.rs:818:10:818:10 | T | +| main.rs:821:17:821:29 | ...::C1(...) | | main.rs:807:5:811:5 | MyEnum | +| main.rs:821:17:821:29 | ...::C1(...) | A | main.rs:818:10:818:10 | T | | main.rs:821:28:821:28 | a | | main.rs:818:10:818:10 | T | | main.rs:821:34:821:34 | a | | main.rs:818:10:818:10 | T | +| main.rs:822:17:822:32 | ...::C2 {...} | | main.rs:807:5:811:5 | MyEnum | +| main.rs:822:17:822:32 | ...::C2 {...} | A | main.rs:818:10:818:10 | T | | main.rs:822:30:822:30 | a | | main.rs:818:10:818:10 | T | | main.rs:822:37:822:37 | a | | main.rs:818:10:818:10 | T | | main.rs:828:13:828:13 | x | | main.rs:807:5:811:5 | MyEnum | @@ -1500,6 +1504,9 @@ inferType | main.rs:1002:19:1002:22 | self | | main.rs:992:5:998:5 | PairOption | | main.rs:1002:19:1002:22 | self | Fst | main.rs:1000:10:1000:12 | Fst | | main.rs:1002:19:1002:22 | self | Snd | main.rs:1000:15:1000:17 | Snd | +| main.rs:1003:17:1003:38 | ...::PairNone(...) | | main.rs:992:5:998:5 | PairOption | +| main.rs:1003:17:1003:38 | ...::PairNone(...) | Fst | main.rs:1000:10:1000:12 | Fst | +| main.rs:1003:17:1003:38 | ...::PairNone(...) | Snd | main.rs:1000:15:1000:17 | Snd | | main.rs:1003:43:1003:82 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1003:50:1003:81 | "PairNone has no second elemen... | | file://:0:0:0:0 | & | | main.rs:1003:50:1003:81 | "PairNone has no second elemen... | &T | {EXTERNAL LOCATION} | str | @@ -1507,6 +1514,10 @@ inferType | main.rs:1003:50:1003:81 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1003:50:1003:81 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1003:50:1003:81 | { ... } | | main.rs:1000:15:1000:17 | Snd | +| main.rs:1004:17:1004:38 | ...::PairFst(...) | | main.rs:992:5:998:5 | PairOption | +| main.rs:1004:17:1004:38 | ...::PairFst(...) | Fst | main.rs:1000:10:1000:12 | Fst | +| main.rs:1004:17:1004:38 | ...::PairFst(...) | Snd | main.rs:1000:15:1000:17 | Snd | +| main.rs:1004:37:1004:37 | _ | | main.rs:1000:10:1000:12 | Fst | | main.rs:1004:43:1004:81 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1004:50:1004:80 | "PairFst has no second element... | | file://:0:0:0:0 | & | | main.rs:1004:50:1004:80 | "PairFst has no second element... | &T | {EXTERNAL LOCATION} | str | @@ -1514,8 +1525,15 @@ inferType | main.rs:1004:50:1004:80 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1004:50:1004:80 | MacroExpr | | main.rs:1000:15:1000:17 | Snd | | main.rs:1004:50:1004:80 | { ... } | | main.rs:1000:15:1000:17 | Snd | +| main.rs:1005:17:1005:40 | ...::PairSnd(...) | | main.rs:992:5:998:5 | PairOption | +| main.rs:1005:17:1005:40 | ...::PairSnd(...) | Fst | main.rs:1000:10:1000:12 | Fst | +| main.rs:1005:17:1005:40 | ...::PairSnd(...) | Snd | main.rs:1000:15:1000:17 | Snd | | main.rs:1005:37:1005:39 | snd | | main.rs:1000:15:1000:17 | Snd | | main.rs:1005:45:1005:47 | snd | | main.rs:1000:15:1000:17 | Snd | +| main.rs:1006:17:1006:44 | ...::PairBoth(...) | | main.rs:992:5:998:5 | PairOption | +| main.rs:1006:17:1006:44 | ...::PairBoth(...) | Fst | main.rs:1000:10:1000:12 | Fst | +| main.rs:1006:17:1006:44 | ...::PairBoth(...) | Snd | main.rs:1000:15:1000:17 | Snd | +| main.rs:1006:38:1006:38 | _ | | main.rs:1000:10:1000:12 | Fst | | main.rs:1006:41:1006:43 | snd | | main.rs:1000:15:1000:17 | Snd | | main.rs:1006:49:1006:51 | snd | | main.rs:1000:15:1000:17 | Snd | | main.rs:1032:10:1032:10 | t | | main.rs:992:5:998:5 | PairOption | @@ -1635,8 +1653,14 @@ inferType | main.rs:1097:19:1097:22 | self | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1097:19:1097:22 | self | T | main.rs:1069:5:1073:5 | MyOption | | main.rs:1097:19:1097:22 | self | T.T | main.rs:1095:10:1095:10 | T | +| main.rs:1098:17:1098:34 | ...::MyNone(...) | | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1098:17:1098:34 | ...::MyNone(...) | T | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1098:17:1098:34 | ...::MyNone(...) | T.T | main.rs:1095:10:1095:10 | T | | main.rs:1098:39:1098:56 | ...::MyNone(...) | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1098:39:1098:56 | ...::MyNone(...) | T | main.rs:1095:10:1095:10 | T | +| main.rs:1099:17:1099:35 | ...::MySome(...) | | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1099:17:1099:35 | ...::MySome(...) | T | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1099:17:1099:35 | ...::MySome(...) | T.T | main.rs:1095:10:1095:10 | T | | main.rs:1099:34:1099:34 | x | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1099:34:1099:34 | x | T | main.rs:1095:10:1095:10 | T | | main.rs:1099:40:1099:40 | x | | main.rs:1069:5:1073:5 | MyOption | @@ -1651,8 +1675,8 @@ inferType | main.rs:1109:18:1109:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1109:26:1109:27 | x1 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1109:26:1109:27 | x1 | T | main.rs:1104:5:1105:13 | S | -| main.rs:1111:13:1111:18 | mut x2 | | main.rs:1069:5:1073:5 | MyOption | -| main.rs:1111:13:1111:18 | mut x2 | T | main.rs:1104:5:1105:13 | S | +| main.rs:1111:17:1111:18 | x2 | | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1111:17:1111:18 | x2 | T | main.rs:1104:5:1105:13 | S | | main.rs:1111:22:1111:36 | ...::new(...) | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1111:22:1111:36 | ...::new(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1112:9:1112:10 | x2 | | main.rs:1069:5:1073:5 | MyOption | @@ -1664,7 +1688,7 @@ inferType | main.rs:1113:18:1113:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1113:26:1113:27 | x2 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1113:26:1113:27 | x2 | T | main.rs:1104:5:1105:13 | S | -| main.rs:1116:13:1116:18 | mut x3 | | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1116:17:1116:18 | x3 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1116:22:1116:36 | ...::new(...) | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1117:9:1117:10 | x3 | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1117:21:1117:21 | S | | main.rs:1104:5:1105:13 | S | @@ -1673,8 +1697,8 @@ inferType | main.rs:1118:18:1118:27 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1118:18:1118:27 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1118:26:1118:27 | x3 | | main.rs:1069:5:1073:5 | MyOption | -| main.rs:1120:13:1120:18 | mut x4 | | main.rs:1069:5:1073:5 | MyOption | -| main.rs:1120:13:1120:18 | mut x4 | T | main.rs:1104:5:1105:13 | S | +| main.rs:1120:17:1120:18 | x4 | | main.rs:1069:5:1073:5 | MyOption | +| main.rs:1120:17:1120:18 | x4 | T | main.rs:1104:5:1105:13 | S | | main.rs:1120:22:1120:36 | ...::new(...) | | main.rs:1069:5:1073:5 | MyOption | | main.rs:1120:22:1120:36 | ...::new(...) | T | main.rs:1104:5:1105:13 | S | | main.rs:1121:23:1121:29 | &mut x4 | | file://:0:0:0:0 | & | @@ -2185,7 +2209,7 @@ inferType | main.rs:1335:20:1335:24 | &true | | file://:0:0:0:0 | & | | main.rs:1335:20:1335:24 | &true | &T | {EXTERNAL LOCATION} | bool | | main.rs:1335:21:1335:24 | true | | {EXTERNAL LOCATION} | bool | -| main.rs:1339:13:1339:20 | mut flag | | main.rs:1298:5:1301:5 | MyFlag | +| main.rs:1339:17:1339:20 | flag | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1339:24:1339:41 | ...::default(...) | | main.rs:1298:5:1301:5 | MyFlag | | main.rs:1340:22:1340:30 | &mut flag | | file://:0:0:0:0 | & | | main.rs:1340:22:1340:30 | &mut flag | &T | main.rs:1298:5:1301:5 | MyFlag | @@ -2272,6 +2296,10 @@ inferType | main.rs:1386:9:1386:23 | ...::Err(...) | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1386:9:1386:23 | ...::Err(...) | T | main.rs:1380:20:1380:27 | T | | main.rs:1386:21:1386:22 | S1 | | main.rs:1348:5:1349:14 | S1 | +| main.rs:1391:16:1391:33 | ...::Ok(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1391:16:1391:33 | ...::Ok(...) | E | main.rs:1348:5:1349:14 | S1 | +| main.rs:1391:16:1391:33 | ...::Ok(...) | T | main.rs:1348:5:1349:14 | S1 | +| main.rs:1391:27:1391:32 | result | | main.rs:1348:5:1349:14 | S1 | | main.rs:1391:37:1391:52 | try_same_error(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1391:37:1391:52 | try_same_error(...) | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1391:37:1391:52 | try_same_error(...) | T | main.rs:1348:5:1349:14 | S1 | @@ -2279,6 +2307,11 @@ inferType | main.rs:1392:22:1392:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:1392:22:1392:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1392:22:1392:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1392:30:1392:35 | result | | main.rs:1348:5:1349:14 | S1 | +| main.rs:1395:16:1395:33 | ...::Ok(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1395:16:1395:33 | ...::Ok(...) | E | main.rs:1351:5:1352:14 | S2 | +| main.rs:1395:16:1395:33 | ...::Ok(...) | T | main.rs:1348:5:1349:14 | S1 | +| main.rs:1395:27:1395:32 | result | | main.rs:1348:5:1349:14 | S1 | | main.rs:1395:37:1395:55 | try_convert_error(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1395:37:1395:55 | try_convert_error(...) | E | main.rs:1351:5:1352:14 | S2 | | main.rs:1395:37:1395:55 | try_convert_error(...) | T | main.rs:1348:5:1349:14 | S1 | @@ -2286,6 +2319,11 @@ inferType | main.rs:1396:22:1396:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:1396:22:1396:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1396:22:1396:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1396:30:1396:35 | result | | main.rs:1348:5:1349:14 | S1 | +| main.rs:1399:16:1399:33 | ...::Ok(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1399:16:1399:33 | ...::Ok(...) | E | main.rs:1351:5:1352:14 | S2 | +| main.rs:1399:16:1399:33 | ...::Ok(...) | T | main.rs:1348:5:1349:14 | S1 | +| main.rs:1399:27:1399:32 | result | | main.rs:1348:5:1349:14 | S1 | | main.rs:1399:37:1399:49 | try_chained(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1399:37:1399:49 | try_chained(...) | E | main.rs:1351:5:1352:14 | S2 | | main.rs:1399:37:1399:49 | try_chained(...) | T | main.rs:1348:5:1349:14 | S1 | @@ -2293,6 +2331,11 @@ inferType | main.rs:1400:22:1400:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:1400:22:1400:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1400:22:1400:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1400:30:1400:35 | result | | main.rs:1348:5:1349:14 | S1 | +| main.rs:1403:16:1403:33 | ...::Ok(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1403:16:1403:33 | ...::Ok(...) | E | main.rs:1348:5:1349:14 | S1 | +| main.rs:1403:16:1403:33 | ...::Ok(...) | T | main.rs:1348:5:1349:14 | S1 | +| main.rs:1403:27:1403:32 | result | | main.rs:1348:5:1349:14 | S1 | | main.rs:1403:37:1403:63 | try_complex(...) | | {EXTERNAL LOCATION} | Result | | main.rs:1403:37:1403:63 | try_complex(...) | E | main.rs:1348:5:1349:14 | S1 | | main.rs:1403:37:1403:63 | try_complex(...) | T | main.rs:1348:5:1349:14 | S1 | @@ -2304,6 +2347,7 @@ inferType | main.rs:1404:22:1404:27 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:1404:22:1404:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:1404:22:1404:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:1404:30:1404:35 | result | | main.rs:1348:5:1349:14 | S1 | | main.rs:1411:13:1411:13 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:1411:22:1411:22 | 1 | | {EXTERNAL LOCATION} | i32 | | main.rs:1412:13:1412:13 | y | | {EXTERNAL LOCATION} | i32 | @@ -2335,7 +2379,7 @@ inferType | main.rs:1427:17:1427:20 | true | | {EXTERNAL LOCATION} | bool | | main.rs:1427:17:1427:29 | ... \|\| ... | | {EXTERNAL LOCATION} | bool | | main.rs:1427:25:1427:29 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:1429:13:1429:17 | mut a | | {EXTERNAL LOCATION} | i32 | +| main.rs:1429:17:1429:17 | a | | {EXTERNAL LOCATION} | i32 | | main.rs:1430:13:1430:16 | cond | | {EXTERNAL LOCATION} | bool | | main.rs:1430:20:1430:21 | 34 | | {EXTERNAL LOCATION} | i32 | | main.rs:1430:20:1430:27 | ... == ... | | {EXTERNAL LOCATION} | bool | @@ -2852,27 +2896,27 @@ inferType | main.rs:1695:23:1695:27 | 21i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1695:23:1695:35 | ... % ... | | {EXTERNAL LOCATION} | i64 | | main.rs:1695:31:1695:35 | 22i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1698:13:1698:30 | mut i64_add_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1698:17:1698:30 | i64_add_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1698:34:1698:38 | 23i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1699:9:1699:22 | i64_add_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1699:9:1699:31 | ... += ... | | file://:0:0:0:0 | () | | main.rs:1699:27:1699:31 | 24i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1701:13:1701:30 | mut i64_sub_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1701:17:1701:30 | i64_sub_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1701:34:1701:38 | 25i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1702:9:1702:22 | i64_sub_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1702:9:1702:31 | ... -= ... | | file://:0:0:0:0 | () | | main.rs:1702:27:1702:31 | 26i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1704:13:1704:30 | mut i64_mul_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1704:17:1704:30 | i64_mul_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1704:34:1704:38 | 27i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1705:9:1705:22 | i64_mul_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1705:9:1705:31 | ... *= ... | | file://:0:0:0:0 | () | | main.rs:1705:27:1705:31 | 28i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1707:13:1707:30 | mut i64_div_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1707:17:1707:30 | i64_div_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1707:34:1707:38 | 29i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1708:9:1708:22 | i64_div_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1708:9:1708:31 | ... /= ... | | file://:0:0:0:0 | () | | main.rs:1708:27:1708:31 | 30i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1710:13:1710:30 | mut i64_rem_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1710:17:1710:30 | i64_rem_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1710:34:1710:38 | 31i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1711:9:1711:22 | i64_rem_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1711:9:1711:31 | ... %= ... | | file://:0:0:0:0 | () | @@ -2897,27 +2941,27 @@ inferType | main.rs:1718:23:1718:27 | 41i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1718:23:1718:36 | ... >> ... | | {EXTERNAL LOCATION} | i64 | | main.rs:1718:32:1718:36 | 42i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1721:13:1721:33 | mut i64_bitand_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1721:17:1721:33 | i64_bitand_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1721:37:1721:41 | 43i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1722:9:1722:25 | i64_bitand_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1722:9:1722:34 | ... &= ... | | file://:0:0:0:0 | () | | main.rs:1722:30:1722:34 | 44i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1724:13:1724:32 | mut i64_bitor_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1724:17:1724:32 | i64_bitor_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1724:36:1724:40 | 45i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1725:9:1725:24 | i64_bitor_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1725:9:1725:33 | ... \|= ... | | file://:0:0:0:0 | () | | main.rs:1725:29:1725:33 | 46i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1727:13:1727:33 | mut i64_bitxor_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1727:17:1727:33 | i64_bitxor_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1727:37:1727:41 | 47i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1728:9:1728:25 | i64_bitxor_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1728:9:1728:34 | ... ^= ... | | file://:0:0:0:0 | () | | main.rs:1728:30:1728:34 | 48i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1730:13:1730:30 | mut i64_shl_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1730:17:1730:30 | i64_shl_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1730:34:1730:38 | 49i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1731:9:1731:22 | i64_shl_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1731:9:1731:32 | ... <<= ... | | file://:0:0:0:0 | () | | main.rs:1731:28:1731:32 | 50i64 | | {EXTERNAL LOCATION} | i64 | -| main.rs:1733:13:1733:30 | mut i64_shr_assign | | {EXTERNAL LOCATION} | i64 | +| main.rs:1733:17:1733:30 | i64_shr_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1733:34:1733:38 | 51i64 | | {EXTERNAL LOCATION} | i64 | | main.rs:1734:9:1734:22 | i64_shr_assign | | {EXTERNAL LOCATION} | i64 | | main.rs:1734:9:1734:32 | ... >>= ... | | file://:0:0:0:0 | () | @@ -2984,27 +3028,27 @@ inferType | main.rs:1756:24:1756:25 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1756:24:1756:30 | ... % ... | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1756:29:1756:30 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1759:13:1759:31 | mut vec2_add_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1759:17:1759:31 | vec2_add_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1759:35:1759:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1760:9:1760:23 | vec2_add_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1760:9:1760:29 | ... += ... | | file://:0:0:0:0 | () | | main.rs:1760:28:1760:29 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1762:13:1762:31 | mut vec2_sub_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1762:17:1762:31 | vec2_sub_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1762:35:1762:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1763:9:1763:23 | vec2_sub_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1763:9:1763:29 | ... -= ... | | file://:0:0:0:0 | () | | main.rs:1763:28:1763:29 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1765:13:1765:31 | mut vec2_mul_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1765:17:1765:31 | vec2_mul_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1765:35:1765:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1766:9:1766:23 | vec2_mul_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1766:9:1766:29 | ... *= ... | | file://:0:0:0:0 | () | | main.rs:1766:28:1766:29 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1768:13:1768:31 | mut vec2_div_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1768:17:1768:31 | vec2_div_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1768:35:1768:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1769:9:1769:23 | vec2_div_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1769:9:1769:29 | ... /= ... | | file://:0:0:0:0 | () | | main.rs:1769:28:1769:29 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1771:13:1771:31 | mut vec2_rem_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1771:17:1771:31 | vec2_rem_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1771:35:1771:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1772:9:1772:23 | vec2_rem_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1772:9:1772:29 | ... %= ... | | file://:0:0:0:0 | () | @@ -3029,27 +3073,27 @@ inferType | main.rs:1779:24:1779:25 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1779:24:1779:33 | ... >> ... | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1779:30:1779:33 | 1u32 | | {EXTERNAL LOCATION} | u32 | -| main.rs:1782:13:1782:34 | mut vec2_bitand_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1782:17:1782:34 | vec2_bitand_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1782:38:1782:39 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1783:9:1783:26 | vec2_bitand_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1783:9:1783:32 | ... &= ... | | file://:0:0:0:0 | () | | main.rs:1783:31:1783:32 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1785:13:1785:33 | mut vec2_bitor_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1785:17:1785:33 | vec2_bitor_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1785:37:1785:38 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1786:9:1786:25 | vec2_bitor_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1786:9:1786:31 | ... \|= ... | | file://:0:0:0:0 | () | | main.rs:1786:30:1786:31 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1788:13:1788:34 | mut vec2_bitxor_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1788:17:1788:34 | vec2_bitxor_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1788:38:1788:39 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1789:9:1789:26 | vec2_bitxor_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1789:9:1789:32 | ... ^= ... | | file://:0:0:0:0 | () | | main.rs:1789:31:1789:32 | v2 | | main.rs:1443:5:1448:5 | Vec2 | -| main.rs:1791:13:1791:31 | mut vec2_shl_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1791:17:1791:31 | vec2_shl_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1791:35:1791:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1792:9:1792:23 | vec2_shl_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1792:9:1792:32 | ... <<= ... | | file://:0:0:0:0 | () | | main.rs:1792:29:1792:32 | 1u32 | | {EXTERNAL LOCATION} | u32 | -| main.rs:1794:13:1794:31 | mut vec2_shr_assign | | main.rs:1443:5:1448:5 | Vec2 | +| main.rs:1794:17:1794:31 | vec2_shr_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1794:35:1794:36 | v1 | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1795:9:1795:23 | vec2_shr_assign | | main.rs:1443:5:1448:5 | Vec2 | | main.rs:1795:9:1795:32 | ... >>= ... | | file://:0:0:0:0 | () | @@ -3218,8 +3262,8 @@ inferType | main.rs:1957:17:1957:24 | slice[0] | | main.rs:1917:5:1918:13 | S | | main.rs:1957:17:1957:30 | ... .foo() | | main.rs:1917:5:1918:13 | S | | main.rs:1957:23:1957:23 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:1961:13:1961:19 | mut vec | | main.rs:1926:5:1929:5 | MyVec | -| main.rs:1961:13:1961:19 | mut vec | T | main.rs:1917:5:1918:13 | S | +| main.rs:1961:17:1961:19 | vec | | main.rs:1926:5:1929:5 | MyVec | +| main.rs:1961:17:1961:19 | vec | T | main.rs:1917:5:1918:13 | S | | main.rs:1961:23:1961:34 | ...::new(...) | | main.rs:1926:5:1929:5 | MyVec | | main.rs:1961:23:1961:34 | ...::new(...) | T | main.rs:1917:5:1918:13 | S | | main.rs:1962:9:1962:11 | vec | | main.rs:1926:5:1929:5 | MyVec | @@ -3546,9 +3590,9 @@ inferType | main.rs:2177:18:2177:22 | vals4 | | file://:0:0:0:0 | [] | | main.rs:2177:18:2177:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | i32 | | main.rs:2177:18:2177:22 | vals4 | [T;...] | {EXTERNAL LOCATION} | u64 | -| main.rs:2179:13:2179:24 | mut strings1 | | file://:0:0:0:0 | [] | -| main.rs:2179:13:2179:24 | mut strings1 | [T;...] | file://:0:0:0:0 | & | -| main.rs:2179:13:2179:24 | mut strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | +| main.rs:2179:17:2179:24 | strings1 | | file://:0:0:0:0 | [] | +| main.rs:2179:17:2179:24 | strings1 | [T;...] | file://:0:0:0:0 | & | +| main.rs:2179:17:2179:24 | strings1 | [T;...].&T | {EXTERNAL LOCATION} | str | | main.rs:2179:28:2179:48 | [...] | | file://:0:0:0:0 | [] | | main.rs:2179:28:2179:48 | [...] | [T;...] | file://:0:0:0:0 | & | | main.rs:2179:28:2179:48 | [...] | [T;...].&T | {EXTERNAL LOCATION} | str | @@ -3767,9 +3811,9 @@ inferType | main.rs:2236:18:2236:22 | vals6 | A | {EXTERNAL LOCATION} | Global | | main.rs:2236:18:2236:22 | vals6 | T | file://:0:0:0:0 | & | | main.rs:2236:18:2236:22 | vals6 | T.&T | {EXTERNAL LOCATION} | u64 | -| main.rs:2238:13:2238:21 | mut vals7 | | {EXTERNAL LOCATION} | Vec | -| main.rs:2238:13:2238:21 | mut vals7 | A | {EXTERNAL LOCATION} | Global | -| main.rs:2238:13:2238:21 | mut vals7 | T | {EXTERNAL LOCATION} | u8 | +| main.rs:2238:17:2238:21 | vals7 | | {EXTERNAL LOCATION} | Vec | +| main.rs:2238:17:2238:21 | vals7 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2238:17:2238:21 | vals7 | T | {EXTERNAL LOCATION} | u8 | | main.rs:2238:25:2238:34 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | | main.rs:2238:25:2238:34 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | | main.rs:2238:25:2238:34 | ...::new(...) | T | {EXTERNAL LOCATION} | u8 | @@ -3789,13 +3833,13 @@ inferType | main.rs:2242:36:2242:36 | 2 | | {EXTERNAL LOCATION} | i32 | | main.rs:2242:45:2242:45 | 3 | | {EXTERNAL LOCATION} | i32 | | main.rs:2242:48:2242:48 | 4 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2249:13:2249:20 | mut map1 | | {EXTERNAL LOCATION} | HashMap | -| main.rs:2249:13:2249:20 | mut map1 | K | {EXTERNAL LOCATION} | i32 | -| main.rs:2249:13:2249:20 | mut map1 | S | {EXTERNAL LOCATION} | RandomState | -| main.rs:2249:13:2249:20 | mut map1 | V | {EXTERNAL LOCATION} | Box | -| main.rs:2249:13:2249:20 | mut map1 | V.A | {EXTERNAL LOCATION} | Global | -| main.rs:2249:13:2249:20 | mut map1 | V.T | file://:0:0:0:0 | & | -| main.rs:2249:13:2249:20 | mut map1 | V.T.&T | {EXTERNAL LOCATION} | str | +| main.rs:2249:17:2249:20 | map1 | | {EXTERNAL LOCATION} | HashMap | +| main.rs:2249:17:2249:20 | map1 | K | {EXTERNAL LOCATION} | i32 | +| main.rs:2249:17:2249:20 | map1 | S | {EXTERNAL LOCATION} | RandomState | +| main.rs:2249:17:2249:20 | map1 | V | {EXTERNAL LOCATION} | Box | +| main.rs:2249:17:2249:20 | map1 | V.A | {EXTERNAL LOCATION} | Global | +| main.rs:2249:17:2249:20 | map1 | V.T | file://:0:0:0:0 | & | +| main.rs:2249:17:2249:20 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | | main.rs:2249:24:2249:55 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | | main.rs:2249:24:2249:55 | ...::new(...) | K | {EXTERNAL LOCATION} | i32 | | main.rs:2249:24:2249:55 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | @@ -3906,8 +3950,8 @@ inferType | main.rs:2255:30:2255:33 | map1 | V.A | {EXTERNAL LOCATION} | Global | | main.rs:2255:30:2255:33 | map1 | V.T | file://:0:0:0:0 | & | | main.rs:2255:30:2255:33 | map1 | V.T.&T | {EXTERNAL LOCATION} | str | -| main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i32 | -| main.rs:2259:13:2259:17 | mut a | | {EXTERNAL LOCATION} | i64 | +| main.rs:2259:17:2259:17 | a | | {EXTERNAL LOCATION} | i32 | +| main.rs:2259:17:2259:17 | a | | {EXTERNAL LOCATION} | i64 | | main.rs:2259:26:2259:26 | 0 | | {EXTERNAL LOCATION} | i32 | | main.rs:2259:26:2259:26 | 0 | | {EXTERNAL LOCATION} | i64 | | main.rs:2261:23:2261:23 | a | | {EXTERNAL LOCATION} | i32 | @@ -4015,18 +4059,32 @@ inferType | main.rs:2363:21:2363:28 | Some(...) | | {EXTERNAL LOCATION} | Option | | main.rs:2363:21:2363:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | | main.rs:2363:26:2363:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2364:16:2364:25 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2364:16:2364:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2364:21:2364:24 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2364:29:2364:33 | value | | {EXTERNAL LOCATION} | Option | | main.rs:2364:29:2364:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2365:17:2365:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2365:24:2365:27 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2366:22:2366:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2366:22:2366:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2366:22:2366:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2366:22:2366:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2366:24:2366:27 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2368:15:2368:19 | value | | {EXTERNAL LOCATION} | Option | | main.rs:2368:15:2368:19 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2369:13:2369:22 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2369:13:2369:22 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2369:18:2369:21 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2370:21:2370:24 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2370:28:2370:31 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2371:26:2371:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2371:26:2371:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2371:26:2371:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2371:26:2371:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2371:28:2371:31 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2373:13:2373:16 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2373:13:2373:16 | None | T | {EXTERNAL LOCATION} | i32 | | main.rs:2375:13:2375:16 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2375:20:2375:24 | value | | {EXTERNAL LOCATION} | Option | | main.rs:2375:20:2375:24 | value | T | {EXTERNAL LOCATION} | i32 | @@ -4056,35 +4114,65 @@ inferType | main.rs:2381:23:2381:30 | Some(...) | | {EXTERNAL LOCATION} | Option | | main.rs:2381:23:2381:30 | Some(...) | T | {EXTERNAL LOCATION} | i32 | | main.rs:2381:28:2381:29 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:16:2382:26 | &... | | file://:0:0:0:0 | & | +| main.rs:2382:16:2382:26 | &... | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2382:16:2382:26 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:17:2382:26 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2382:17:2382:26 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:22:2382:25 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2382:30:2382:35 | value2 | | file://:0:0:0:0 | & | | main.rs:2382:30:2382:35 | value2 | &T | {EXTERNAL LOCATION} | Option | | main.rs:2382:30:2382:35 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:17:2383:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:24:2383:27 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2384:22:2384:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2384:22:2384:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2384:22:2384:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2384:22:2384:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2384:24:2384:27 | mesg | | {EXTERNAL LOCATION} | i32 | | main.rs:2387:13:2387:18 | value3 | | {EXTERNAL LOCATION} | i32 | | main.rs:2387:22:2387:23 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2388:20:2388:23 | mesg | | file://:0:0:0:0 | & | +| main.rs:2388:20:2388:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2388:27:2388:32 | value3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2389:17:2389:20 | mesg | | file://:0:0:0:0 | & | +| main.rs:2389:17:2389:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2389:24:2389:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2389:24:2389:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2390:22:2390:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2390:22:2390:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2390:22:2390:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2390:22:2390:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2390:24:2390:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2390:24:2390:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2393:13:2393:18 | value4 | | {EXTERNAL LOCATION} | Option | | main.rs:2393:13:2393:18 | value4 | T | {EXTERNAL LOCATION} | i32 | | main.rs:2393:22:2393:29 | Some(...) | | {EXTERNAL LOCATION} | Option | | main.rs:2393:22:2393:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | | main.rs:2393:27:2393:28 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:16:2394:29 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2394:16:2394:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:25:2394:28 | mesg | | file://:0:0:0:0 | & | +| main.rs:2394:25:2394:28 | mesg | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2394:33:2394:38 | value4 | | {EXTERNAL LOCATION} | Option | | main.rs:2394:33:2394:38 | value4 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2395:17:2395:20 | mesg | | file://:0:0:0:0 | & | +| main.rs:2395:17:2395:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2395:24:2395:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2395:24:2395:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2396:22:2396:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | | main.rs:2396:22:2396:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2396:22:2396:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2396:22:2396:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2399:13:2399:22 | ref value5 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2396:24:2396:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2396:24:2396:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2399:17:2399:22 | value5 | | file://:0:0:0:0 | & | +| main.rs:2399:17:2399:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2399:26:2399:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:13:2400:13 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:17:2400:22 | value5 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:13:2400:13 | x | | file://:0:0:0:0 | & | +| main.rs:2400:13:2400:13 | x | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:17:2400:22 | value5 | | file://:0:0:0:0 | & | +| main.rs:2400:17:2400:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | | main.rs:2402:13:2402:28 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | | main.rs:2402:13:2402:28 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2402:13:2402:28 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | @@ -4093,9 +4181,18 @@ inferType | main.rs:2402:32:2405:9 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | | main.rs:2403:21:2403:22 | 42 | | {EXTERNAL LOCATION} | i32 | | main.rs:2404:21:2404:25 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2406:16:2406:48 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2406:16:2406:48 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2406:16:2406:48 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2406:33:2406:38 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2406:41:2406:46 | value2 | | {EXTERNAL LOCATION} | bool | | main.rs:2406:52:2406:67 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | | main.rs:2406:52:2406:67 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2406:52:2406:67 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2407:17:2407:17 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2407:21:2407:26 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2408:17:2408:17 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2408:21:2408:26 | value2 | | {EXTERNAL LOCATION} | bool | | main.rs:2412:13:2412:27 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | | main.rs:2412:13:2412:27 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2412:13:2412:27 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | @@ -4104,9 +4201,18 @@ inferType | main.rs:2412:31:2412:54 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | | main.rs:2412:45:2412:46 | 42 | | {EXTERNAL LOCATION} | i32 | | main.rs:2412:49:2412:53 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2413:16:2413:44 | MyTupleStruct(...) | | main.rs:2355:5:2355:41 | MyTupleStruct | +| main.rs:2413:16:2413:44 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2413:16:2413:44 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2413:30:2413:35 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2413:38:2413:43 | value2 | | {EXTERNAL LOCATION} | bool | | main.rs:2413:48:2413:62 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | | main.rs:2413:48:2413:62 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2413:48:2413:62 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2414:17:2414:17 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2414:21:2414:26 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2415:17:2415:17 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2415:21:2415:26 | value2 | | {EXTERNAL LOCATION} | bool | | main.rs:2419:13:2419:20 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | | main.rs:2419:13:2419:20 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2419:13:2419:20 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | @@ -4118,6 +4224,24 @@ inferType | main.rs:2423:15:2423:22 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | | main.rs:2423:15:2423:22 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | | main.rs:2423:15:2423:22 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2424:13:2424:47 | ...::Variant1 {...} | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2424:13:2424:47 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2424:13:2424:47 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2424:32:2424:37 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2424:40:2424:45 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2425:21:2425:21 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2425:25:2425:30 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2426:21:2426:21 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2426:25:2426:30 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2429:13:2429:44 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2429:13:2429:44 | ...::Variant2(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2429:13:2429:44 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2429:30:2429:35 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2429:38:2429:43 | value2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2430:21:2430:21 | x | | {EXTERNAL LOCATION} | bool | +| main.rs:2430:25:2430:30 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2431:21:2431:21 | y | | {EXTERNAL LOCATION} | i32 | +| main.rs:2431:25:2431:30 | value2 | | {EXTERNAL LOCATION} | i32 | | main.rs:2436:13:2436:26 | my_nested_enum | | main.rs:2357:5:2360:5 | MyEnum | | main.rs:2436:13:2436:26 | my_nested_enum | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | | main.rs:2436:13:2436:26 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | @@ -4144,6 +4268,34 @@ inferType | main.rs:2444:15:2444:28 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | | main.rs:2444:15:2444:28 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | | main.rs:2444:15:2444:28 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2445:13:2451:13 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2446:17:2446:22 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2447:17:2450:17 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2448:29:2448:29 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2449:29:2449:29 | y | | file://:0:0:0:0 | & | +| main.rs:2449:29:2449:29 | y | &T | {EXTERNAL LOCATION} | str | +| main.rs:2452:21:2452:21 | a | | {EXTERNAL LOCATION} | bool | +| main.rs:2452:25:2452:30 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2453:21:2453:21 | b | | {EXTERNAL LOCATION} | i32 | +| main.rs:2453:25:2453:25 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2454:21:2454:21 | c | | file://:0:0:0:0 | & | +| main.rs:2454:21:2454:21 | c | &T | {EXTERNAL LOCATION} | str | +| main.rs:2454:25:2454:25 | y | | file://:0:0:0:0 | & | +| main.rs:2454:25:2454:25 | y | &T | {EXTERNAL LOCATION} | str | +| main.rs:2457:13:2457:13 | _ | | main.rs:2357:5:2360:5 | MyEnum | +| main.rs:2457:13:2457:13 | _ | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | +| main.rs:2457:13:2457:13 | _ | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2457:13:2457:13 | _ | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2457:13:2457:13 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2457:13:2457:13 | _ | T2 | {EXTERNAL LOCATION} | bool | | main.rs:2460:9:2460:12 | None | | {EXTERNAL LOCATION} | Option | | main.rs:2466:5:2466:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | | main.rs:2467:5:2467:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | diff --git a/rust/ql/test/library-tests/type-inference/type-inference.ql b/rust/ql/test/library-tests/type-inference/type-inference.ql index 89728d5d1ba..f03f6de484c 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.ql +++ b/rust/ql/test/library-tests/type-inference/type-inference.ql @@ -6,7 +6,9 @@ import TypeInference query predicate inferType(AstNode n, TypePath path, Type t) { t = TypeInference::inferType(n, path) and n.fromSource() and - not n.isFromMacroExpansion() + not n.isFromMacroExpansion() and + not n instanceof IdentPat and // avoid overlap in the output with the underlying `Name` node + not n instanceof LiteralPat // avoid overlap in the output with the underlying `Literal` node } module ResolveTest implements TestSig { diff --git a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected index ecc607f7b3d..60847b71b79 100644 --- a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected +++ b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected @@ -1,11 +1,11 @@ #select | src/main.rs:10:5:10:22 | ...::read_to_string | src/main.rs:6:11:6:19 | file_name | src/main.rs:10:5:10:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:6:11:6:19 | file_name | user-provided value | edges -| src/main.rs:6:11:6:19 | file_name | src/main.rs:8:35:8:53 | file_name as String | provenance | | +| src/main.rs:6:11:6:19 | file_name | src/main.rs:8:35:8:43 | file_name | provenance | | | src/main.rs:8:9:8:17 | file_path | src/main.rs:10:24:10:32 | file_path | provenance | | -| src/main.rs:8:21:8:54 | ...::from(...) | src/main.rs:8:9:8:17 | file_path | provenance | | -| src/main.rs:8:35:8:53 | file_name as String | src/main.rs:8:21:8:54 | ...::from(...) | provenance | MaD:2 | -| src/main.rs:8:35:8:53 | file_name as String | src/main.rs:8:21:8:54 | ...::from(...) | provenance | MaD:2 | +| src/main.rs:8:21:8:44 | ...::from(...) | src/main.rs:8:9:8:17 | file_path | provenance | | +| src/main.rs:8:35:8:43 | file_name | src/main.rs:8:21:8:44 | ...::from(...) | provenance | MaD:2 | +| src/main.rs:8:35:8:43 | file_name | src/main.rs:8:21:8:44 | ...::from(...) | provenance | MaD:2 | | src/main.rs:10:24:10:32 | file_path | src/main.rs:10:5:10:22 | ...::read_to_string | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: std::fs::read_to_string; Argument[0]; path-injection | @@ -13,8 +13,8 @@ models nodes | src/main.rs:6:11:6:19 | file_name | semmle.label | file_name | | src/main.rs:8:9:8:17 | file_path | semmle.label | file_path | -| src/main.rs:8:21:8:54 | ...::from(...) | semmle.label | ...::from(...) | -| src/main.rs:8:35:8:53 | file_name as String | semmle.label | file_name as String | +| src/main.rs:8:21:8:44 | ...::from(...) | semmle.label | ...::from(...) | +| src/main.rs:8:35:8:43 | file_name | semmle.label | file_name | | src/main.rs:10:5:10:22 | ...::read_to_string | semmle.label | ...::read_to_string | | src/main.rs:10:24:10:32 | file_path | semmle.label | file_path | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-022/src/main.rs b/rust/ql/test/query-tests/security/CWE-022/src/main.rs index 42ed08e3086..972ac8e7b6a 100644 --- a/rust/ql/test/query-tests/security/CWE-022/src/main.rs +++ b/rust/ql/test/query-tests/security/CWE-022/src/main.rs @@ -5,8 +5,8 @@ use std::{fs, path::Path, path::PathBuf}; fn tainted_path_handler_bad( Query(file_name): Query, // $ Source=remote1 ) -> Result { - let file_path = PathBuf::from(file_name as String); // TODO: Remove `as String` when type inference handles patterns - // BAD: This could read any file on the filesystem. + let file_path = PathBuf::from(file_name); + // BAD: This could read any file on the filesystem. fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink Alert[rust/path-injection]=remote1 } From ac13f408e44913affa8b3b13f90187d2721563fa Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 11 Jul 2025 10:42:50 +0200 Subject: [PATCH 73/96] Add change note --- .../ql/lib/change-notes/2025-07-11-type-inference-patterns.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rust/ql/lib/change-notes/2025-07-11-type-inference-patterns.md diff --git a/rust/ql/lib/change-notes/2025-07-11-type-inference-patterns.md b/rust/ql/lib/change-notes/2025-07-11-type-inference-patterns.md new file mode 100644 index 00000000000..d1d586fc71a --- /dev/null +++ b/rust/ql/lib/change-notes/2025-07-11-type-inference-patterns.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Type inference has been extended to support pattern matching. \ No newline at end of file From df241ad4f60fdf4a04798543575039b750fc7c98 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 21:08:07 +0100 Subject: [PATCH 74/96] C++: Fix lambda creation for objects with no constructor. --- .../cpp/ir/dataflow/internal/DataFlowPrivate.qll | 13 +++++++++++++ .../dataflow/external-models/flow.expected | 10 ++++++++++ .../library-tests/dataflow/external-models/test.cpp | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index ff0512f44e1..e98adbf0ce7 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -1414,6 +1414,17 @@ private class OperatorCall extends Cpp::MemberFunction { OperatorCall() { this.hasName("operator()") } } +private predicate isFunctorCreationWithoutConstructor(Node creation, OperatorCall operator) { + exists(UninitializedInstruction init, Instruction dest | + // A construction of an object with no constructor. In this case we use + // the `UninitializedInstruction` as the creation node. + init = creation.asInstruction() and + dest = init.getDestinationAddress() and + not any(ConstructorCallInstruction constructorCall).getThisArgument() = dest and + operator.getDeclaringType() = init.getResultType() + ) +} + private predicate isFunctorCreationWithConstructor(Node creation, OperatorCall operator) { exists(DataFlowCall constructorCall, IndirectionPosition pos | // A construction of an object with a constructor. In this case we use @@ -1432,6 +1443,8 @@ predicate lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c) or kind.isFunctor() and exists(OperatorCall operator | operator = c.asSourceCallable() | + isFunctorCreationWithoutConstructor(creation, operator) + or isFunctorCreationWithConstructor(creation, operator) ) } diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index b0e32bc9b92..a8133da92ac 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -76,14 +76,19 @@ edges | test.cpp:59:55:59:64 | *& ... [x] | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | provenance | | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:68:22:68:22 | y | provenance | | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:74:22:74:22 | y | provenance | | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:82:22:82:22 | y | provenance | | | test.cpp:68:22:68:22 | y | test.cpp:69:11:69:11 | y | provenance | Sink:MaD:1 | +| test.cpp:74:22:74:22 | y | test.cpp:75:11:75:11 | y | provenance | Sink:MaD:1 | | test.cpp:82:22:82:22 | y | test.cpp:83:11:83:11 | y | provenance | Sink:MaD:1 | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:16 | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:97:26:97:26 | x | provenance | | +| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:101:26:101:26 | x | provenance | | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:103:63:103:63 | x | provenance | | | test.cpp:97:26:97:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | +| test.cpp:101:26:101:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | test.cpp:103:63:103:63 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 | @@ -223,15 +228,20 @@ nodes | test.cpp:59:55:59:64 | *& ... [x] | semmle.label | *& ... [x] | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:68:22:68:22 | y | semmle.label | y | | test.cpp:69:11:69:11 | y | semmle.label | y | +| test.cpp:74:22:74:22 | y | semmle.label | y | +| test.cpp:75:11:75:11 | y | semmle.label | y | | test.cpp:82:22:82:22 | y | semmle.label | y | | test.cpp:83:11:83:11 | y | semmle.label | y | | test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | | test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | | test.cpp:97:26:97:26 | x | semmle.label | x | +| test.cpp:101:26:101:26 | x | semmle.label | x | | test.cpp:103:63:103:63 | x | semmle.label | x | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | semmle.label | [summary param] *0 in CommandLineToArgvA | | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | semmle.label | [summary] to write: ReturnValue[**] in CommandLineToArgvA | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index 8e76fe8d6d5..56098efe23a 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -72,7 +72,7 @@ struct StructWithOperatorCall_has_constructor { struct StructWithOperatorCall_no_constructor { void operator()(int y) { - ymlSink(y); // $ MISSING: ir + ymlSink(y); // $ ir } }; From 6d0c8c6d775b075f1cbe3b74dd589fac36963143 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Jul 2025 21:16:23 +0100 Subject: [PATCH 75/96] C++: Work around an extractor bug. --- .../cpp/ir/dataflow/internal/DataFlowPrivate.qll | 13 +++++++++++++ .../dataflow/external-models/flow.expected | 10 ++++++++++ .../library-tests/dataflow/external-models/test.cpp | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index e98adbf0ce7..d7f26dd0051 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -1423,6 +1423,19 @@ private predicate isFunctorCreationWithoutConstructor(Node creation, OperatorCal not any(ConstructorCallInstruction constructorCall).getThisArgument() = dest and operator.getDeclaringType() = init.getResultType() ) + or + // Workaround for an extractor bug. In this snippet: + // ``` + // struct S { }; + // void f(S); + // f(S()); + // ``` + // The expression `S()` is represented as a 0 literal in the database. + exists(ConstantValueInstruction constant | + constant.getValue() = "0" and + creation.asInstruction() = constant and + constant.getResultType() = operator.getDeclaringType() + ) } private predicate isFunctorCreationWithConstructor(Node creation, OperatorCall operator) { diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index a8133da92ac..bf9a4ed28d0 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -77,19 +77,24 @@ edges | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:68:22:68:22 | y | provenance | | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:74:22:74:22 | y | provenance | | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:82:22:82:22 | y | provenance | | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:88:22:88:22 | y | provenance | | | test.cpp:68:22:68:22 | y | test.cpp:69:11:69:11 | y | provenance | Sink:MaD:1 | | test.cpp:74:22:74:22 | y | test.cpp:75:11:75:11 | y | provenance | Sink:MaD:1 | | test.cpp:82:22:82:22 | y | test.cpp:83:11:83:11 | y | provenance | Sink:MaD:1 | +| test.cpp:88:22:88:22 | y | test.cpp:89:11:89:11 | y | provenance | Sink:MaD:1 | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:16 | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:97:26:97:26 | x | provenance | | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:101:26:101:26 | x | provenance | | | test.cpp:94:10:94:18 | call to ymlSource | test.cpp:103:63:103:63 | x | provenance | | +| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:104:62:104:62 | x | provenance | | | test.cpp:97:26:97:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | test.cpp:101:26:101:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | test.cpp:103:63:103:63 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | +| test.cpp:104:62:104:62 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | | @@ -229,6 +234,8 @@ nodes | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument | +| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument | @@ -238,11 +245,14 @@ nodes | test.cpp:75:11:75:11 | y | semmle.label | y | | test.cpp:82:22:82:22 | y | semmle.label | y | | test.cpp:83:11:83:11 | y | semmle.label | y | +| test.cpp:88:22:88:22 | y | semmle.label | y | +| test.cpp:89:11:89:11 | y | semmle.label | y | | test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | | test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource | | test.cpp:97:26:97:26 | x | semmle.label | x | | test.cpp:101:26:101:26 | x | semmle.label | x | | test.cpp:103:63:103:63 | x | semmle.label | x | +| test.cpp:104:62:104:62 | x | semmle.label | x | | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | semmle.label | [summary param] *0 in CommandLineToArgvA | | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | semmle.label | [summary] to write: ReturnValue[**] in CommandLineToArgvA | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | semmle.label | *call to GetCommandLineA | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index 56098efe23a..f357b934b2f 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -86,7 +86,7 @@ struct StructWithOperatorCall_has_constructor_2 { struct StructWithOperatorCall_no_constructor_2 { void operator()(int y) { - ymlSink(y); // $ MISSING: ir + ymlSink(y); // $ ir } }; From 4f538a2b1fa935135a9b11304609ce9792dfdbef Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Jul 2025 00:07:40 +0100 Subject: [PATCH 76/96] C++: Accept taint test changes. --- cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp index 81320a26e8a..5a39669d1c6 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/thread.cpp @@ -28,6 +28,6 @@ void test_thread() { std::thread t3(thread_function_3, &s, 42); std::thread t4([](S* p) { - sink(p->x); // $ MISSING: ir + sink(p->x); // $ ir }, &s); } \ No newline at end of file From 34fae324a051f63a856eaec738aa10e9e38fdfb3 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 11 Jul 2025 10:16:25 +0100 Subject: [PATCH 77/96] Add test for ObjectInput.readObject --- .../test/query-tests/security/CWE-502/A.java | 29 ++- .../CWE-502/UnsafeDeserialization.expected | 212 +++++++++--------- .../CWE-502/UnsafeDeserialization.ext.yml | 7 + .../CWE-502/com/example/MyObjectInput.java | 109 +++++++++ 4 files changed, 245 insertions(+), 112 deletions(-) create mode 100644 java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.ext.yml create mode 100644 java/ql/test/query-tests/security/CWE-502/com/example/MyObjectInput.java diff --git a/java/ql/test/query-tests/security/CWE-502/A.java b/java/ql/test/query-tests/security/CWE-502/A.java index 81974edf283..d36d1d3c0b8 100644 --- a/java/ql/test/query-tests/security/CWE-502/A.java +++ b/java/ql/test/query-tests/security/CWE-502/A.java @@ -1,6 +1,9 @@ +package unsafedeserialization; + import java.io.*; import java.net.Socket; import java.beans.XMLDecoder; +import com.example.MyObjectInput; import com.thoughtworks.xstream.XStream; import com.esotericsoftware.kryo.Kryo; import com.esotericsoftware.kryo.io.Input; @@ -10,13 +13,23 @@ import org.yaml.snakeyaml.Yaml; import org.nibblesec.tools.SerialKiller; public class A { - public Object deserialize1(Socket sock) throws java.io.IOException, ClassNotFoundException { + public Object deserialize1a(Socket sock) throws java.io.IOException, ClassNotFoundException { InputStream inputStream = sock.getInputStream(); // $ Source ObjectInputStream in = new ObjectInputStream(inputStream); return in.readObject(); // $ Alert } - public Object deserialize2(Socket sock) throws java.io.IOException, ClassNotFoundException { + public Object deserialize2() throws java.io.IOException, ClassNotFoundException { + ObjectInput objectInput = A.getTaintedObjectInput(); // $ MISSING: Source + return objectInput.readObject(); // $ MISSING: Alert + } + + public Object deserialize3() throws java.io.IOException, ClassNotFoundException { + MyObjectInput objectInput = A.getTaintedMyObjectInput(); // $ MISSING: Source + return objectInput.readObject(); // $ MISSING: Alert + } + + public Object deserialize4(Socket sock) throws java.io.IOException, ClassNotFoundException { InputStream inputStream = sock.getInputStream(); // $ Source ObjectInputStream in = new ObjectInputStream(inputStream); return in.readUnshared(); // $ Alert @@ -28,20 +41,20 @@ public class A { return in.readUnshared(); // OK } - public Object deserialize3(Socket sock) throws java.io.IOException { + public Object deserialize5(Socket sock) throws java.io.IOException { InputStream inputStream = sock.getInputStream(); // $ Source XMLDecoder d = new XMLDecoder(inputStream); return d.readObject(); // $ Alert } - public Object deserialize4(Socket sock) throws java.io.IOException { + public Object deserialize6(Socket sock) throws java.io.IOException { XStream xs = new XStream(); InputStream inputStream = sock.getInputStream(); // $ Source Reader reader = new InputStreamReader(inputStream); return xs.fromXML(reader); // $ Alert } - public void deserialize5(Socket sock) throws java.io.IOException { + public void deserialize7(Socket sock) throws java.io.IOException { Kryo kryo = new Kryo(); Input input = new Input(sock.getInputStream()); // $ Source A a1 = kryo.readObject(input, A.class); // $ Alert @@ -56,7 +69,7 @@ public class A { return kryo; } - public void deserialize6(Socket sock) throws java.io.IOException { + public void deserialize8(Socket sock) throws java.io.IOException { Kryo kryo = getSafeKryo(); Input input = new Input(sock.getInputStream()); Object o = kryo.readClassAndObject(input); // OK @@ -101,4 +114,8 @@ public class A { A o4 = yaml.loadAs(input, A.class); // $ Alert A o5 = yaml.loadAs(new InputStreamReader(input), A.class); // $ Alert } + + static ObjectInput getTaintedObjectInput() { return null; } + + static MyObjectInput getTaintedMyObjectInput() { return null; } } diff --git a/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected index b4064231bec..599b85603c8 100644 --- a/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected +++ b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected @@ -1,26 +1,26 @@ #select -| A.java:16:12:16:26 | readObject(...) | A.java:14:31:14:51 | getInputStream(...) : InputStream | A.java:16:12:16:13 | in | Unsafe deserialization depends on a $@. | A.java:14:31:14:51 | getInputStream(...) | user-provided value | -| A.java:22:12:22:28 | readUnshared(...) | A.java:20:31:20:51 | getInputStream(...) : InputStream | A.java:22:12:22:13 | in | Unsafe deserialization depends on a $@. | A.java:20:31:20:51 | getInputStream(...) | user-provided value | -| A.java:34:12:34:25 | readObject(...) | A.java:32:31:32:51 | getInputStream(...) : InputStream | A.java:34:12:34:12 | d | Unsafe deserialization depends on a $@. | A.java:32:31:32:51 | getInputStream(...) | user-provided value | -| A.java:41:12:41:29 | fromXML(...) | A.java:39:31:39:51 | getInputStream(...) : InputStream | A.java:41:23:41:28 | reader | Unsafe deserialization depends on a $@. | A.java:39:31:39:51 | getInputStream(...) | user-provided value | -| A.java:47:12:47:42 | readObject(...) | A.java:46:29:46:49 | getInputStream(...) : InputStream | A.java:47:28:47:32 | input | Unsafe deserialization depends on a $@. | A.java:46:29:46:49 | getInputStream(...) | user-provided value | -| A.java:48:12:48:48 | readObjectOrNull(...) | A.java:46:29:46:49 | getInputStream(...) : InputStream | A.java:48:34:48:38 | input | Unsafe deserialization depends on a $@. | A.java:46:29:46:49 | getInputStream(...) | user-provided value | -| A.java:49:16:49:45 | readClassAndObject(...) | A.java:46:29:46:49 | getInputStream(...) : InputStream | A.java:49:40:49:44 | input | Unsafe deserialization depends on a $@. | A.java:46:29:46:49 | getInputStream(...) | user-provided value | -| A.java:68:16:68:31 | load(...) | A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:68:26:68:30 | input | Unsafe deserialization depends on a $@. | A.java:67:25:67:45 | getInputStream(...) | user-provided value | -| A.java:69:17:69:35 | loadAll(...) | A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:69:30:69:34 | input | Unsafe deserialization depends on a $@. | A.java:67:25:67:45 | getInputStream(...) | user-provided value | -| A.java:70:17:70:56 | parse(...) | A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:70:28:70:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:67:25:67:45 | getInputStream(...) | user-provided value | -| A.java:71:12:71:38 | loadAs(...) | A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:71:24:71:28 | input | Unsafe deserialization depends on a $@. | A.java:67:25:67:45 | getInputStream(...) | user-provided value | -| A.java:72:12:72:61 | loadAs(...) | A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:72:24:72:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:67:25:67:45 | getInputStream(...) | user-provided value | -| A.java:78:16:78:31 | load(...) | A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:78:26:78:30 | input | Unsafe deserialization depends on a $@. | A.java:77:25:77:45 | getInputStream(...) | user-provided value | -| A.java:79:17:79:35 | loadAll(...) | A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:79:30:79:34 | input | Unsafe deserialization depends on a $@. | A.java:77:25:77:45 | getInputStream(...) | user-provided value | -| A.java:80:17:80:56 | parse(...) | A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:80:28:80:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:77:25:77:45 | getInputStream(...) | user-provided value | -| A.java:81:12:81:38 | loadAs(...) | A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:81:24:81:28 | input | Unsafe deserialization depends on a $@. | A.java:77:25:77:45 | getInputStream(...) | user-provided value | -| A.java:82:12:82:61 | loadAs(...) | A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:82:24:82:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:77:25:77:45 | getInputStream(...) | user-provided value | -| A.java:98:16:98:31 | load(...) | A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:98:26:98:30 | input | Unsafe deserialization depends on a $@. | A.java:97:25:97:45 | getInputStream(...) | user-provided value | -| A.java:99:17:99:35 | loadAll(...) | A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:99:30:99:34 | input | Unsafe deserialization depends on a $@. | A.java:97:25:97:45 | getInputStream(...) | user-provided value | -| A.java:100:17:100:56 | parse(...) | A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:100:28:100:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:97:25:97:45 | getInputStream(...) | user-provided value | -| A.java:101:12:101:38 | loadAs(...) | A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:101:24:101:28 | input | Unsafe deserialization depends on a $@. | A.java:97:25:97:45 | getInputStream(...) | user-provided value | -| A.java:102:12:102:61 | loadAs(...) | A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:102:24:102:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:97:25:97:45 | getInputStream(...) | user-provided value | +| A.java:19:12:19:26 | readObject(...) | A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:19:12:19:13 | in | Unsafe deserialization depends on a $@. | A.java:17:31:17:51 | getInputStream(...) | user-provided value | +| A.java:35:12:35:28 | readUnshared(...) | A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:35:12:35:13 | in | Unsafe deserialization depends on a $@. | A.java:33:31:33:51 | getInputStream(...) | user-provided value | +| A.java:47:12:47:25 | readObject(...) | A.java:45:31:45:51 | getInputStream(...) : InputStream | A.java:47:12:47:12 | d | Unsafe deserialization depends on a $@. | A.java:45:31:45:51 | getInputStream(...) | user-provided value | +| A.java:54:12:54:29 | fromXML(...) | A.java:52:31:52:51 | getInputStream(...) : InputStream | A.java:54:23:54:28 | reader | Unsafe deserialization depends on a $@. | A.java:52:31:52:51 | getInputStream(...) | user-provided value | +| A.java:60:12:60:42 | readObject(...) | A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:60:28:60:32 | input | Unsafe deserialization depends on a $@. | A.java:59:29:59:49 | getInputStream(...) | user-provided value | +| A.java:61:12:61:48 | readObjectOrNull(...) | A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:61:34:61:38 | input | Unsafe deserialization depends on a $@. | A.java:59:29:59:49 | getInputStream(...) | user-provided value | +| A.java:62:16:62:45 | readClassAndObject(...) | A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:62:40:62:44 | input | Unsafe deserialization depends on a $@. | A.java:59:29:59:49 | getInputStream(...) | user-provided value | +| A.java:81:16:81:31 | load(...) | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:81:26:81:30 | input | Unsafe deserialization depends on a $@. | A.java:80:25:80:45 | getInputStream(...) | user-provided value | +| A.java:82:17:82:35 | loadAll(...) | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:82:30:82:34 | input | Unsafe deserialization depends on a $@. | A.java:80:25:80:45 | getInputStream(...) | user-provided value | +| A.java:83:17:83:56 | parse(...) | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:83:28:83:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:80:25:80:45 | getInputStream(...) | user-provided value | +| A.java:84:12:84:38 | loadAs(...) | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:84:24:84:28 | input | Unsafe deserialization depends on a $@. | A.java:80:25:80:45 | getInputStream(...) | user-provided value | +| A.java:85:12:85:61 | loadAs(...) | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:85:24:85:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:80:25:80:45 | getInputStream(...) | user-provided value | +| A.java:91:16:91:31 | load(...) | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:91:26:91:30 | input | Unsafe deserialization depends on a $@. | A.java:90:25:90:45 | getInputStream(...) | user-provided value | +| A.java:92:17:92:35 | loadAll(...) | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:92:30:92:34 | input | Unsafe deserialization depends on a $@. | A.java:90:25:90:45 | getInputStream(...) | user-provided value | +| A.java:93:17:93:56 | parse(...) | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:93:28:93:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:90:25:90:45 | getInputStream(...) | user-provided value | +| A.java:94:12:94:38 | loadAs(...) | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:94:24:94:28 | input | Unsafe deserialization depends on a $@. | A.java:90:25:90:45 | getInputStream(...) | user-provided value | +| A.java:95:12:95:61 | loadAs(...) | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:95:24:95:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:90:25:90:45 | getInputStream(...) | user-provided value | +| A.java:111:16:111:31 | load(...) | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:111:26:111:30 | input | Unsafe deserialization depends on a $@. | A.java:110:25:110:45 | getInputStream(...) | user-provided value | +| A.java:112:17:112:35 | loadAll(...) | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:112:30:112:34 | input | Unsafe deserialization depends on a $@. | A.java:110:25:110:45 | getInputStream(...) | user-provided value | +| A.java:113:17:113:56 | parse(...) | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:113:28:113:55 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:110:25:110:45 | getInputStream(...) | user-provided value | +| A.java:114:12:114:38 | loadAs(...) | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:114:24:114:28 | input | Unsafe deserialization depends on a $@. | A.java:110:25:110:45 | getInputStream(...) | user-provided value | +| A.java:115:12:115:61 | loadAs(...) | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:115:24:115:51 | new InputStreamReader(...) | Unsafe deserialization depends on a $@. | A.java:110:25:110:45 | getInputStream(...) | user-provided value | | B.java:8:12:8:46 | parseObject(...) | B.java:7:31:7:51 | getInputStream(...) : InputStream | B.java:8:29:8:39 | inputStream | Unsafe deserialization depends on a $@. | B.java:7:31:7:51 | getInputStream(...) | user-provided value | | B.java:15:12:15:28 | parse(...) | B.java:12:31:12:51 | getInputStream(...) : InputStream | B.java:15:23:15:27 | bytes | Unsafe deserialization depends on a $@. | B.java:12:31:12:51 | getInputStream(...) | user-provided value | | B.java:23:12:23:30 | parseObject(...) | B.java:19:31:19:51 | getInputStream(...) : InputStream | B.java:23:29:23:29 | s | Unsafe deserialization depends on a $@. | B.java:19:31:19:51 | getInputStream(...) | user-provided value | @@ -72,45 +72,45 @@ | ParcelableEntity.java:32:30:32:70 | fromJson(...) | GsonActivity.java:15:54:15:64 | getIntent(...) : Intent | ParcelableEntity.java:32:44:32:62 | readString(...) | Unsafe deserialization depends on a $@. | GsonActivity.java:15:54:15:64 | getIntent(...) | user-provided value | | TestMessageBodyReader.java:22:18:22:65 | readObject(...) | TestMessageBodyReader.java:20:55:20:78 | entityStream : InputStream | TestMessageBodyReader.java:22:18:22:52 | new ObjectInputStream(...) | Unsafe deserialization depends on a $@. | TestMessageBodyReader.java:20:55:20:78 | entityStream | user-provided value | edges -| A.java:14:31:14:51 | getInputStream(...) : InputStream | A.java:15:50:15:60 | inputStream : InputStream | provenance | Src:MaD:1 | -| A.java:14:31:14:51 | getInputStream(...) : InputStream | A.java:16:12:16:13 | in | provenance | Src:MaD:1 inputStreamWrapper | -| A.java:15:28:15:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:16:12:16:13 | in | provenance | | -| A.java:15:50:15:60 | inputStream : InputStream | A.java:15:28:15:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | -| A.java:20:31:20:51 | getInputStream(...) : InputStream | A.java:21:50:21:60 | inputStream : InputStream | provenance | Src:MaD:1 | -| A.java:20:31:20:51 | getInputStream(...) : InputStream | A.java:22:12:22:13 | in | provenance | Src:MaD:1 inputStreamWrapper | -| A.java:21:28:21:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:22:12:22:13 | in | provenance | | -| A.java:21:50:21:60 | inputStream : InputStream | A.java:21:28:21:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | -| A.java:32:31:32:51 | getInputStream(...) : InputStream | A.java:33:35:33:45 | inputStream : InputStream | provenance | Src:MaD:1 | -| A.java:33:20:33:46 | new XMLDecoder(...) : XMLDecoder | A.java:34:12:34:12 | d | provenance | | -| A.java:33:35:33:45 | inputStream : InputStream | A.java:33:20:33:46 | new XMLDecoder(...) : XMLDecoder | provenance | MaD:7 | -| A.java:39:31:39:51 | getInputStream(...) : InputStream | A.java:40:43:40:53 | inputStream : InputStream | provenance | Src:MaD:1 | -| A.java:40:21:40:54 | new InputStreamReader(...) : InputStreamReader | A.java:41:23:41:28 | reader | provenance | | -| A.java:40:43:40:53 | inputStream : InputStream | A.java:40:21:40:54 | new InputStreamReader(...) : InputStreamReader | provenance | MaD:10 | -| A.java:46:19:46:50 | new Input(...) : Input | A.java:47:28:47:32 | input | provenance | | -| A.java:46:19:46:50 | new Input(...) : Input | A.java:48:34:48:38 | input | provenance | | -| A.java:46:19:46:50 | new Input(...) : Input | A.java:49:40:49:44 | input | provenance | | -| A.java:46:29:46:49 | getInputStream(...) : InputStream | A.java:46:19:46:50 | new Input(...) : Input | provenance | Src:MaD:1 MaD:5 | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:68:26:68:30 | input | provenance | Src:MaD:1 | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:69:30:69:34 | input | provenance | Src:MaD:1 | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:70:50:70:54 | input : InputStream | provenance | Src:MaD:1 | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:71:24:71:28 | input | provenance | Src:MaD:1 | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | A.java:72:46:72:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:70:50:70:54 | input : InputStream | A.java:70:28:70:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:72:46:72:50 | input : InputStream | A.java:72:24:72:51 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:78:26:78:30 | input | provenance | Src:MaD:1 | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:79:30:79:34 | input | provenance | Src:MaD:1 | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:80:50:80:54 | input : InputStream | provenance | Src:MaD:1 | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:81:24:81:28 | input | provenance | Src:MaD:1 | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | A.java:82:46:82:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:80:50:80:54 | input : InputStream | A.java:80:28:80:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:82:46:82:50 | input : InputStream | A.java:82:24:82:51 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:98:26:98:30 | input | provenance | Src:MaD:1 | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:99:30:99:34 | input | provenance | Src:MaD:1 | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:100:50:100:54 | input : InputStream | provenance | Src:MaD:1 | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:101:24:101:28 | input | provenance | Src:MaD:1 | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | A.java:102:46:102:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:100:50:100:54 | input : InputStream | A.java:100:28:100:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:102:46:102:50 | input : InputStream | A.java:102:24:102:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:18:50:18:60 | inputStream : InputStream | provenance | Src:MaD:1 | +| A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:19:12:19:13 | in | provenance | Src:MaD:1 inputStreamWrapper | +| A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:19:12:19:13 | in | provenance | | +| A.java:18:50:18:60 | inputStream : InputStream | A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | +| A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:34:50:34:60 | inputStream : InputStream | provenance | Src:MaD:1 | +| A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:35:12:35:13 | in | provenance | Src:MaD:1 inputStreamWrapper | +| A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:35:12:35:13 | in | provenance | | +| A.java:34:50:34:60 | inputStream : InputStream | A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | +| A.java:45:31:45:51 | getInputStream(...) : InputStream | A.java:46:35:46:45 | inputStream : InputStream | provenance | Src:MaD:1 | +| A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | A.java:47:12:47:12 | d | provenance | | +| A.java:46:35:46:45 | inputStream : InputStream | A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | provenance | MaD:7 | +| A.java:52:31:52:51 | getInputStream(...) : InputStream | A.java:53:43:53:53 | inputStream : InputStream | provenance | Src:MaD:1 | +| A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | A.java:54:23:54:28 | reader | provenance | | +| A.java:53:43:53:53 | inputStream : InputStream | A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | provenance | MaD:10 | +| A.java:59:19:59:50 | new Input(...) : Input | A.java:60:28:60:32 | input | provenance | | +| A.java:59:19:59:50 | new Input(...) : Input | A.java:61:34:61:38 | input | provenance | | +| A.java:59:19:59:50 | new Input(...) : Input | A.java:62:40:62:44 | input | provenance | | +| A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:59:19:59:50 | new Input(...) : Input | provenance | Src:MaD:1 MaD:5 | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:81:26:81:30 | input | provenance | Src:MaD:1 | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:82:30:82:34 | input | provenance | Src:MaD:1 | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:83:50:83:54 | input : InputStream | provenance | Src:MaD:1 | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:84:24:84:28 | input | provenance | Src:MaD:1 | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:85:46:85:50 | input : InputStream | provenance | Src:MaD:1 | +| A.java:83:50:83:54 | input : InputStream | A.java:83:28:83:55 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:85:46:85:50 | input : InputStream | A.java:85:24:85:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:91:26:91:30 | input | provenance | Src:MaD:1 | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:92:30:92:34 | input | provenance | Src:MaD:1 | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:93:50:93:54 | input : InputStream | provenance | Src:MaD:1 | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:94:24:94:28 | input | provenance | Src:MaD:1 | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:95:46:95:50 | input : InputStream | provenance | Src:MaD:1 | +| A.java:93:50:93:54 | input : InputStream | A.java:93:28:93:55 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:95:46:95:50 | input : InputStream | A.java:95:24:95:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:111:26:111:30 | input | provenance | Src:MaD:1 | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:112:30:112:34 | input | provenance | Src:MaD:1 | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:113:50:113:54 | input : InputStream | provenance | Src:MaD:1 | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:114:24:114:28 | input | provenance | Src:MaD:1 | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:115:46:115:50 | input : InputStream | provenance | Src:MaD:1 | +| A.java:113:50:113:54 | input : InputStream | A.java:113:28:113:55 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:115:46:115:50 | input : InputStream | A.java:115:24:115:51 | new InputStreamReader(...) | provenance | MaD:10 | | B.java:7:31:7:51 | getInputStream(...) : InputStream | B.java:8:29:8:39 | inputStream | provenance | Src:MaD:1 | | B.java:12:31:12:51 | getInputStream(...) : InputStream | B.java:14:5:14:15 | inputStream : InputStream | provenance | Src:MaD:1 | | B.java:14:5:14:15 | inputStream : InputStream | B.java:14:22:14:26 | bytes [post update] : byte[] | provenance | MaD:9 | @@ -235,51 +235,51 @@ models | 15 | Summary: java.lang; String; false; split; ; ; Argument[this]; ReturnValue; taint; manual | | 16 | Summary: org.json; JSONObject; false; JSONObject; (String); ; Argument[0]; Argument[this]; taint; manual | nodes -| A.java:14:31:14:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:15:28:15:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | -| A.java:15:50:15:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | -| A.java:16:12:16:13 | in | semmle.label | in | -| A.java:20:31:20:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:21:28:21:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | -| A.java:21:50:21:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | -| A.java:22:12:22:13 | in | semmle.label | in | -| A.java:32:31:32:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:33:20:33:46 | new XMLDecoder(...) : XMLDecoder | semmle.label | new XMLDecoder(...) : XMLDecoder | -| A.java:33:35:33:45 | inputStream : InputStream | semmle.label | inputStream : InputStream | -| A.java:34:12:34:12 | d | semmle.label | d | -| A.java:39:31:39:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:40:21:40:54 | new InputStreamReader(...) : InputStreamReader | semmle.label | new InputStreamReader(...) : InputStreamReader | -| A.java:40:43:40:53 | inputStream : InputStream | semmle.label | inputStream : InputStream | -| A.java:41:23:41:28 | reader | semmle.label | reader | -| A.java:46:19:46:50 | new Input(...) : Input | semmle.label | new Input(...) : Input | -| A.java:46:29:46:49 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:47:28:47:32 | input | semmle.label | input | -| A.java:48:34:48:38 | input | semmle.label | input | -| A.java:49:40:49:44 | input | semmle.label | input | -| A.java:67:25:67:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:68:26:68:30 | input | semmle.label | input | -| A.java:69:30:69:34 | input | semmle.label | input | -| A.java:70:28:70:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:70:50:70:54 | input : InputStream | semmle.label | input : InputStream | -| A.java:71:24:71:28 | input | semmle.label | input | -| A.java:72:24:72:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:72:46:72:50 | input : InputStream | semmle.label | input : InputStream | -| A.java:77:25:77:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:78:26:78:30 | input | semmle.label | input | -| A.java:79:30:79:34 | input | semmle.label | input | -| A.java:80:28:80:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:80:50:80:54 | input : InputStream | semmle.label | input : InputStream | -| A.java:81:24:81:28 | input | semmle.label | input | -| A.java:82:24:82:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:82:46:82:50 | input : InputStream | semmle.label | input : InputStream | -| A.java:97:25:97:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | -| A.java:98:26:98:30 | input | semmle.label | input | -| A.java:99:30:99:34 | input | semmle.label | input | -| A.java:100:28:100:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:100:50:100:54 | input : InputStream | semmle.label | input : InputStream | -| A.java:101:24:101:28 | input | semmle.label | input | -| A.java:102:24:102:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | -| A.java:102:46:102:50 | input : InputStream | semmle.label | input : InputStream | +| A.java:17:31:17:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | +| A.java:18:50:18:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | +| A.java:19:12:19:13 | in | semmle.label | in | +| A.java:33:31:33:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | +| A.java:34:50:34:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | +| A.java:35:12:35:13 | in | semmle.label | in | +| A.java:45:31:45:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | semmle.label | new XMLDecoder(...) : XMLDecoder | +| A.java:46:35:46:45 | inputStream : InputStream | semmle.label | inputStream : InputStream | +| A.java:47:12:47:12 | d | semmle.label | d | +| A.java:52:31:52:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | semmle.label | new InputStreamReader(...) : InputStreamReader | +| A.java:53:43:53:53 | inputStream : InputStream | semmle.label | inputStream : InputStream | +| A.java:54:23:54:28 | reader | semmle.label | reader | +| A.java:59:19:59:50 | new Input(...) : Input | semmle.label | new Input(...) : Input | +| A.java:59:29:59:49 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:60:28:60:32 | input | semmle.label | input | +| A.java:61:34:61:38 | input | semmle.label | input | +| A.java:62:40:62:44 | input | semmle.label | input | +| A.java:80:25:80:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:81:26:81:30 | input | semmle.label | input | +| A.java:82:30:82:34 | input | semmle.label | input | +| A.java:83:28:83:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:83:50:83:54 | input : InputStream | semmle.label | input : InputStream | +| A.java:84:24:84:28 | input | semmle.label | input | +| A.java:85:24:85:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:85:46:85:50 | input : InputStream | semmle.label | input : InputStream | +| A.java:90:25:90:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:91:26:91:30 | input | semmle.label | input | +| A.java:92:30:92:34 | input | semmle.label | input | +| A.java:93:28:93:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:93:50:93:54 | input : InputStream | semmle.label | input : InputStream | +| A.java:94:24:94:28 | input | semmle.label | input | +| A.java:95:24:95:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:95:46:95:50 | input : InputStream | semmle.label | input : InputStream | +| A.java:110:25:110:45 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | +| A.java:111:26:111:30 | input | semmle.label | input | +| A.java:112:30:112:34 | input | semmle.label | input | +| A.java:113:28:113:55 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:113:50:113:54 | input : InputStream | semmle.label | input : InputStream | +| A.java:114:24:114:28 | input | semmle.label | input | +| A.java:115:24:115:51 | new InputStreamReader(...) | semmle.label | new InputStreamReader(...) | +| A.java:115:46:115:50 | input : InputStream | semmle.label | input : InputStream | | B.java:7:31:7:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | | B.java:8:29:8:39 | inputStream | semmle.label | inputStream | | B.java:12:31:12:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | diff --git a/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.ext.yml b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.ext.yml new file mode 100644 index 00000000000..2bc52cf78fd --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.ext.yml @@ -0,0 +1,7 @@ +extensions: + - addsTo: + pack: codeql/java-all + extensible: sourceModel + data: + - ["unsafedeserialization", "A", False, "getTaintedObjectInput", "()", "", "ReturnValue", "remote", "manual"] + - ["unsafedeserialization", "A", False, "getTaintedMyObjectInput", "()", "", "ReturnValue", "remote", "manual"] diff --git a/java/ql/test/query-tests/security/CWE-502/com/example/MyObjectInput.java b/java/ql/test/query-tests/security/CWE-502/com/example/MyObjectInput.java new file mode 100644 index 00000000000..20eef41ed29 --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-502/com/example/MyObjectInput.java @@ -0,0 +1,109 @@ +package com.example; +import java.io.*; + +public final class MyObjectInput implements ObjectInput { + + @Override + public Object readObject() throws ClassNotFoundException, IOException { + return null; + } + + @Override + public int read() throws IOException { + return 0; + } + + @Override + public int read(byte[] b) throws IOException { + return 0; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + return 0; + } + + @Override + public long skip(long n) throws IOException { + return 0; + } + + @Override + public int available() throws IOException { + return 0; + } + + @Override + public void close() throws IOException {} + + @Override + public void readFully(byte[] b) throws IOException {} + + @Override + public void readFully(byte[] b, int off, int len) throws IOException {} + + @Override + public int skipBytes(int n) throws IOException { + return 0; + } + + @Override + public boolean readBoolean() throws IOException { + return false; + } + + @Override + public byte readByte() throws IOException { + return 0; + } + + @Override + public int readUnsignedByte() throws IOException { + return 0; + } + + @Override + public short readShort() throws IOException { + return 0; + } + + @Override + public int readUnsignedShort() throws IOException { + return 0; + } + + @Override + public char readChar() throws IOException { + return 0; + } + + @Override + public int readInt() throws IOException { + return 0; + } + + @Override + public long readLong() throws IOException { + return 0; + } + + @Override + public float readFloat() throws IOException { + return 0; + } + + @Override + public double readDouble() throws IOException { + return 0; + } + + @Override + public String readLine() throws IOException { + return null; + } + + @Override + public String readUTF() throws IOException { + return null; + } +} From 8e4bd1a102bcb47f2552b09ce021edbc9c672cd1 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 11 Jul 2025 10:23:41 +0100 Subject: [PATCH 78/96] Add sink for ObjectInput.readObject to make test pass --- java/ql/lib/semmle/code/java/JDK.qll | 5 + .../security/UnsafeDeserializationQuery.qll | 19 +++- .../test/query-tests/security/CWE-502/A.java | 8 +- .../CWE-502/UnsafeDeserialization.expected | 98 ++++++++++--------- 4 files changed, 78 insertions(+), 52 deletions(-) diff --git a/java/ql/lib/semmle/code/java/JDK.qll b/java/ql/lib/semmle/code/java/JDK.qll index 897e857ba10..bdc2fb92fa0 100644 --- a/java/ql/lib/semmle/code/java/JDK.qll +++ b/java/ql/lib/semmle/code/java/JDK.qll @@ -211,6 +211,11 @@ class TypeObjectOutputStream extends RefType { TypeObjectOutputStream() { this.hasQualifiedName("java.io", "ObjectOutputStream") } } +/** The type `java.io.ObjectInput`. */ +class TypeObjectInput extends RefType { + TypeObjectInput() { this.hasQualifiedName("java.io", "ObjectInput") } +} + /** The type `java.io.ObjectInputStream`. */ class TypeObjectInputStream extends RefType { TypeObjectInputStream() { this.hasQualifiedName("java.io", "ObjectInputStream") } diff --git a/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll b/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll index 541942c6036..7489fbd00ef 100644 --- a/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll +++ b/java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll @@ -23,10 +23,17 @@ private import semmle.code.java.frameworks.google.Gson private import semmle.code.java.frameworks.apache.Lang private import semmle.code.java.Reflection -private class ObjectInputStreamReadObjectMethod extends Method { - ObjectInputStreamReadObjectMethod() { +private class ObjectInputReadObjectMethod extends Method { + ObjectInputReadObjectMethod() { + this.getDeclaringType().getASourceSupertype*() instanceof TypeObjectInput and + this.hasName("readObject") + } +} + +private class ObjectInputStreamReadUnsharedMethod extends Method { + ObjectInputStreamReadUnsharedMethod() { this.getDeclaringType().getASourceSupertype*() instanceof TypeObjectInputStream and - (this.hasName("readObject") or this.hasName("readUnshared")) + this.hasName("readUnshared") } } @@ -147,7 +154,11 @@ private module SafeKryoFlow = DataFlow::Global; */ predicate unsafeDeserialization(MethodCall ma, Expr sink) { exists(Method m | m = ma.getMethod() | - m instanceof ObjectInputStreamReadObjectMethod and + m instanceof ObjectInputReadObjectMethod and + sink = ma.getQualifier() and + not DataFlow::exprNode(sink).getTypeBound() instanceof SafeObjectInputStreamType + or + m instanceof ObjectInputStreamReadUnsharedMethod and sink = ma.getQualifier() and not DataFlow::exprNode(sink).getTypeBound() instanceof SafeObjectInputStreamType or diff --git a/java/ql/test/query-tests/security/CWE-502/A.java b/java/ql/test/query-tests/security/CWE-502/A.java index d36d1d3c0b8..6d52babf693 100644 --- a/java/ql/test/query-tests/security/CWE-502/A.java +++ b/java/ql/test/query-tests/security/CWE-502/A.java @@ -20,13 +20,13 @@ public class A { } public Object deserialize2() throws java.io.IOException, ClassNotFoundException { - ObjectInput objectInput = A.getTaintedObjectInput(); // $ MISSING: Source - return objectInput.readObject(); // $ MISSING: Alert + ObjectInput objectInput = A.getTaintedObjectInput(); // $ Source + return objectInput.readObject(); // $ Alert } public Object deserialize3() throws java.io.IOException, ClassNotFoundException { - MyObjectInput objectInput = A.getTaintedMyObjectInput(); // $ MISSING: Source - return objectInput.readObject(); // $ MISSING: Alert + MyObjectInput objectInput = A.getTaintedMyObjectInput(); // $ Source + return objectInput.readObject(); // $ Alert } public Object deserialize4(Socket sock) throws java.io.IOException, ClassNotFoundException { diff --git a/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected index 599b85603c8..89ddc0c1bf9 100644 --- a/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected +++ b/java/ql/test/query-tests/security/CWE-502/UnsafeDeserialization.expected @@ -1,5 +1,7 @@ #select | A.java:19:12:19:26 | readObject(...) | A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:19:12:19:13 | in | Unsafe deserialization depends on a $@. | A.java:17:31:17:51 | getInputStream(...) | user-provided value | +| A.java:24:12:24:35 | readObject(...) | A.java:23:31:23:55 | getTaintedObjectInput(...) : ObjectInput | A.java:24:12:24:22 | objectInput | Unsafe deserialization depends on a $@. | A.java:23:31:23:55 | getTaintedObjectInput(...) | user-provided value | +| A.java:29:12:29:35 | readObject(...) | A.java:28:33:28:59 | getTaintedMyObjectInput(...) : MyObjectInput | A.java:29:12:29:22 | objectInput | Unsafe deserialization depends on a $@. | A.java:28:33:28:59 | getTaintedMyObjectInput(...) | user-provided value | | A.java:35:12:35:28 | readUnshared(...) | A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:35:12:35:13 | in | Unsafe deserialization depends on a $@. | A.java:33:31:33:51 | getInputStream(...) | user-provided value | | A.java:47:12:47:25 | readObject(...) | A.java:45:31:45:51 | getInputStream(...) : InputStream | A.java:47:12:47:12 | d | Unsafe deserialization depends on a $@. | A.java:45:31:45:51 | getInputStream(...) | user-provided value | | A.java:54:12:54:29 | fromXML(...) | A.java:52:31:52:51 | getInputStream(...) : InputStream | A.java:54:23:54:28 | reader | Unsafe deserialization depends on a $@. | A.java:52:31:52:51 | getInputStream(...) | user-provided value | @@ -75,56 +77,58 @@ edges | A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:18:50:18:60 | inputStream : InputStream | provenance | Src:MaD:1 | | A.java:17:31:17:51 | getInputStream(...) : InputStream | A.java:19:12:19:13 | in | provenance | Src:MaD:1 inputStreamWrapper | | A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:19:12:19:13 | in | provenance | | -| A.java:18:50:18:60 | inputStream : InputStream | A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | +| A.java:18:50:18:60 | inputStream : InputStream | A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:13 | +| A.java:23:31:23:55 | getTaintedObjectInput(...) : ObjectInput | A.java:24:12:24:22 | objectInput | provenance | Src:MaD:5 | +| A.java:28:33:28:59 | getTaintedMyObjectInput(...) : MyObjectInput | A.java:29:12:29:22 | objectInput | provenance | Src:MaD:4 | | A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:34:50:34:60 | inputStream : InputStream | provenance | Src:MaD:1 | | A.java:33:31:33:51 | getInputStream(...) : InputStream | A.java:35:12:35:13 | in | provenance | Src:MaD:1 inputStreamWrapper | | A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | A.java:35:12:35:13 | in | provenance | | -| A.java:34:50:34:60 | inputStream : InputStream | A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:11 | +| A.java:34:50:34:60 | inputStream : InputStream | A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | provenance | MaD:13 | | A.java:45:31:45:51 | getInputStream(...) : InputStream | A.java:46:35:46:45 | inputStream : InputStream | provenance | Src:MaD:1 | | A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | A.java:47:12:47:12 | d | provenance | | -| A.java:46:35:46:45 | inputStream : InputStream | A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | provenance | MaD:7 | +| A.java:46:35:46:45 | inputStream : InputStream | A.java:46:20:46:46 | new XMLDecoder(...) : XMLDecoder | provenance | MaD:9 | | A.java:52:31:52:51 | getInputStream(...) : InputStream | A.java:53:43:53:53 | inputStream : InputStream | provenance | Src:MaD:1 | | A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | A.java:54:23:54:28 | reader | provenance | | -| A.java:53:43:53:53 | inputStream : InputStream | A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | provenance | MaD:10 | +| A.java:53:43:53:53 | inputStream : InputStream | A.java:53:21:53:54 | new InputStreamReader(...) : InputStreamReader | provenance | MaD:12 | | A.java:59:19:59:50 | new Input(...) : Input | A.java:60:28:60:32 | input | provenance | | | A.java:59:19:59:50 | new Input(...) : Input | A.java:61:34:61:38 | input | provenance | | | A.java:59:19:59:50 | new Input(...) : Input | A.java:62:40:62:44 | input | provenance | | -| A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:59:19:59:50 | new Input(...) : Input | provenance | Src:MaD:1 MaD:5 | +| A.java:59:29:59:49 | getInputStream(...) : InputStream | A.java:59:19:59:50 | new Input(...) : Input | provenance | Src:MaD:1 MaD:7 | | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:81:26:81:30 | input | provenance | Src:MaD:1 | | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:82:30:82:34 | input | provenance | Src:MaD:1 | | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:83:50:83:54 | input : InputStream | provenance | Src:MaD:1 | | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:84:24:84:28 | input | provenance | Src:MaD:1 | | A.java:80:25:80:45 | getInputStream(...) : InputStream | A.java:85:46:85:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:83:50:83:54 | input : InputStream | A.java:83:28:83:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:85:46:85:50 | input : InputStream | A.java:85:24:85:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:83:50:83:54 | input : InputStream | A.java:83:28:83:55 | new InputStreamReader(...) | provenance | MaD:12 | +| A.java:85:46:85:50 | input : InputStream | A.java:85:24:85:51 | new InputStreamReader(...) | provenance | MaD:12 | | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:91:26:91:30 | input | provenance | Src:MaD:1 | | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:92:30:92:34 | input | provenance | Src:MaD:1 | | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:93:50:93:54 | input : InputStream | provenance | Src:MaD:1 | | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:94:24:94:28 | input | provenance | Src:MaD:1 | | A.java:90:25:90:45 | getInputStream(...) : InputStream | A.java:95:46:95:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:93:50:93:54 | input : InputStream | A.java:93:28:93:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:95:46:95:50 | input : InputStream | A.java:95:24:95:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:93:50:93:54 | input : InputStream | A.java:93:28:93:55 | new InputStreamReader(...) | provenance | MaD:12 | +| A.java:95:46:95:50 | input : InputStream | A.java:95:24:95:51 | new InputStreamReader(...) | provenance | MaD:12 | | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:111:26:111:30 | input | provenance | Src:MaD:1 | | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:112:30:112:34 | input | provenance | Src:MaD:1 | | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:113:50:113:54 | input : InputStream | provenance | Src:MaD:1 | | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:114:24:114:28 | input | provenance | Src:MaD:1 | | A.java:110:25:110:45 | getInputStream(...) : InputStream | A.java:115:46:115:50 | input : InputStream | provenance | Src:MaD:1 | -| A.java:113:50:113:54 | input : InputStream | A.java:113:28:113:55 | new InputStreamReader(...) | provenance | MaD:10 | -| A.java:115:46:115:50 | input : InputStream | A.java:115:24:115:51 | new InputStreamReader(...) | provenance | MaD:10 | +| A.java:113:50:113:54 | input : InputStream | A.java:113:28:113:55 | new InputStreamReader(...) | provenance | MaD:12 | +| A.java:115:46:115:50 | input : InputStream | A.java:115:24:115:51 | new InputStreamReader(...) | provenance | MaD:12 | | B.java:7:31:7:51 | getInputStream(...) : InputStream | B.java:8:29:8:39 | inputStream | provenance | Src:MaD:1 | | B.java:12:31:12:51 | getInputStream(...) : InputStream | B.java:14:5:14:15 | inputStream : InputStream | provenance | Src:MaD:1 | -| B.java:14:5:14:15 | inputStream : InputStream | B.java:14:22:14:26 | bytes [post update] : byte[] | provenance | MaD:9 | +| B.java:14:5:14:15 | inputStream : InputStream | B.java:14:22:14:26 | bytes [post update] : byte[] | provenance | MaD:11 | | B.java:14:22:14:26 | bytes [post update] : byte[] | B.java:15:23:15:27 | bytes | provenance | | | B.java:19:31:19:51 | getInputStream(...) : InputStream | B.java:21:5:21:15 | inputStream : InputStream | provenance | Src:MaD:1 | -| B.java:21:5:21:15 | inputStream : InputStream | B.java:21:22:21:26 | bytes [post update] : byte[] | provenance | MaD:9 | +| B.java:21:5:21:15 | inputStream : InputStream | B.java:21:22:21:26 | bytes [post update] : byte[] | provenance | MaD:11 | | B.java:21:22:21:26 | bytes [post update] : byte[] | B.java:22:27:22:31 | bytes : byte[] | provenance | | | B.java:22:16:22:32 | new String(...) : String | B.java:23:29:23:29 | s | provenance | | -| B.java:22:27:22:31 | bytes : byte[] | B.java:22:16:22:32 | new String(...) : String | provenance | MaD:13 | +| B.java:22:27:22:31 | bytes : byte[] | B.java:22:16:22:32 | new String(...) : String | provenance | MaD:15 | | B.java:27:31:27:51 | getInputStream(...) : InputStream | B.java:29:5:29:15 | inputStream : InputStream | provenance | Src:MaD:1 | -| B.java:29:5:29:15 | inputStream : InputStream | B.java:29:22:29:26 | bytes [post update] : byte[] | provenance | MaD:9 | +| B.java:29:5:29:15 | inputStream : InputStream | B.java:29:22:29:26 | bytes [post update] : byte[] | provenance | MaD:11 | | B.java:29:22:29:26 | bytes [post update] : byte[] | B.java:30:27:30:31 | bytes : byte[] | provenance | | | B.java:30:16:30:32 | new String(...) : String | B.java:31:23:31:23 | s | provenance | | -| B.java:30:27:30:31 | bytes : byte[] | B.java:30:16:30:32 | new String(...) : String | provenance | MaD:13 | +| B.java:30:27:30:31 | bytes : byte[] | B.java:30:16:30:32 | new String(...) : String | provenance | MaD:15 | | C.java:23:17:23:44 | getParameter(...) : String | C.java:24:13:24:16 | data | provenance | Src:MaD:3 | | C.java:23:17:23:44 | getParameter(...) : String | C.java:25:19:25:22 | data | provenance | Src:MaD:3 | | C.java:23:17:23:44 | getParameter(...) : String | C.java:26:25:26:28 | data | provenance | Src:MaD:3 | @@ -142,28 +146,28 @@ edges | C.java:52:18:52:37 | new YamlReader(...) : YamlReader | C.java:54:3:54:3 | r | provenance | | | C.java:52:18:52:37 | new YamlReader(...) : YamlReader | C.java:55:3:55:3 | r | provenance | | | C.java:52:33:52:36 | data : String | C.java:52:18:52:37 | new YamlReader(...) : YamlReader | provenance | Config | -| C.java:60:18:60:45 | getParameter(...) : String | C.java:60:18:60:56 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:14 | +| C.java:60:18:60:45 | getParameter(...) : String | C.java:60:18:60:56 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:16 | | C.java:60:18:60:56 | getBytes(...) : byte[] | C.java:61:55:61:59 | bytes : byte[] | provenance | | | C.java:60:18:60:56 | getBytes(...) : byte[] | C.java:62:48:62:50 | bis : ByteArrayInputStream | provenance | inputStreamWrapper | | C.java:61:30:61:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | C.java:62:48:62:50 | bis : ByteArrayInputStream | provenance | | -| C.java:61:55:61:59 | bytes : byte[] | C.java:61:30:61:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:8 | +| C.java:61:55:61:59 | bytes : byte[] | C.java:61:30:61:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:10 | | C.java:62:31:62:51 | new HessianInput(...) : HessianInput | C.java:63:3:63:14 | hessianInput | provenance | | | C.java:62:31:62:51 | new HessianInput(...) : HessianInput | C.java:64:3:64:14 | hessianInput | provenance | | | C.java:62:48:62:50 | bis : ByteArrayInputStream | C.java:62:31:62:51 | new HessianInput(...) : HessianInput | provenance | Config | -| C.java:69:18:69:45 | getParameter(...) : String | C.java:69:18:69:56 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:14 | +| C.java:69:18:69:45 | getParameter(...) : String | C.java:69:18:69:56 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:16 | | C.java:69:18:69:56 | getBytes(...) : byte[] | C.java:70:55:70:59 | bytes : byte[] | provenance | | | C.java:69:18:69:56 | getBytes(...) : byte[] | C.java:71:50:71:52 | bis : ByteArrayInputStream | provenance | inputStreamWrapper | | C.java:70:30:70:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | C.java:71:50:71:52 | bis : ByteArrayInputStream | provenance | | -| C.java:70:55:70:59 | bytes : byte[] | C.java:70:30:70:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:8 | +| C.java:70:55:70:59 | bytes : byte[] | C.java:70:30:70:60 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:10 | | C.java:71:32:71:53 | new Hessian2Input(...) : Hessian2Input | C.java:72:3:72:14 | hessianInput | provenance | | | C.java:71:32:71:53 | new Hessian2Input(...) : Hessian2Input | C.java:73:3:73:14 | hessianInput | provenance | | | C.java:71:50:71:52 | bis : ByteArrayInputStream | C.java:71:32:71:53 | new Hessian2Input(...) : Hessian2Input | provenance | Config | -| C.java:79:43:79:70 | getParameter(...) : String | C.java:79:26:79:71 | new StringReader(...) | provenance | Src:MaD:3 MaD:12 | -| C.java:84:27:84:54 | getParameter(...) : String | C.java:84:27:84:65 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:14 | +| C.java:79:43:79:70 | getParameter(...) : String | C.java:79:26:79:71 | new StringReader(...) | provenance | Src:MaD:3 MaD:14 | +| C.java:84:27:84:54 | getParameter(...) : String | C.java:84:27:84:65 | getBytes(...) : byte[] | provenance | Src:MaD:3 MaD:16 | | C.java:84:27:84:65 | getBytes(...) : byte[] | C.java:85:54:85:67 | serializedData : byte[] | provenance | | | C.java:84:27:84:65 | getBytes(...) : byte[] | C.java:86:45:86:46 | is : ByteArrayInputStream | provenance | inputStreamWrapper | | C.java:85:29:85:68 | new ByteArrayInputStream(...) : ByteArrayInputStream | C.java:86:45:86:46 | is : ByteArrayInputStream | provenance | | -| C.java:85:54:85:67 | serializedData : byte[] | C.java:85:29:85:68 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:8 | +| C.java:85:54:85:67 | serializedData : byte[] | C.java:85:29:85:68 | new ByteArrayInputStream(...) : ByteArrayInputStream | provenance | MaD:10 | | C.java:86:29:86:47 | new BurlapInput(...) : BurlapInput | C.java:87:3:87:13 | burlapInput | provenance | | | C.java:86:45:86:46 | is : ByteArrayInputStream | C.java:86:29:86:47 | new BurlapInput(...) : BurlapInput | provenance | Config | | C.java:86:45:86:46 | is : ByteArrayInputStream | C.java:90:21:90:22 | is : ByteArrayInputStream | provenance | | @@ -177,12 +181,12 @@ edges | GsonServlet.java:53:23:53:46 | getParameter(...) : String | GsonServlet.java:60:40:60:43 | json | provenance | Src:MaD:3 | | JabsorbServlet.java:89:23:89:46 | getParameter(...) : String | JabsorbServlet.java:93:48:93:51 | json : String | provenance | Src:MaD:3 | | JabsorbServlet.java:93:33:93:52 | new JSONObject(...) : JSONObject | JabsorbServlet.java:102:83:102:92 | jsonObject | provenance | | -| JabsorbServlet.java:93:48:93:51 | json : String | JabsorbServlet.java:93:33:93:52 | new JSONObject(...) : JSONObject | provenance | MaD:16 | +| JabsorbServlet.java:93:48:93:51 | json : String | JabsorbServlet.java:93:33:93:52 | new JSONObject(...) : JSONObject | provenance | MaD:18 | | JabsorbServlet.java:110:23:110:46 | getParameter(...) : String | JabsorbServlet.java:116:52:116:55 | json | provenance | Src:MaD:3 | -| JacksonTest.java:20:25:20:47 | getInputStream(...) : InputStream | JacksonTest.java:20:54:20:58 | bytes [post update] : byte[] | provenance | Src:MaD:1 MaD:9 | +| JacksonTest.java:20:25:20:47 | getInputStream(...) : InputStream | JacksonTest.java:20:54:20:58 | bytes [post update] : byte[] | provenance | Src:MaD:1 MaD:11 | | JacksonTest.java:20:54:20:58 | bytes [post update] : byte[] | JacksonTest.java:21:46:21:50 | bytes : byte[] | provenance | | | JacksonTest.java:21:35:21:57 | new String(...) : String | JacksonTest.java:22:28:22:35 | jexlExpr : String | provenance | | -| JacksonTest.java:21:46:21:50 | bytes : byte[] | JacksonTest.java:21:35:21:57 | new String(...) : String | provenance | MaD:13 | +| JacksonTest.java:21:46:21:50 | bytes : byte[] | JacksonTest.java:21:35:21:57 | new String(...) : String | provenance | MaD:15 | | JacksonTest.java:22:28:22:35 | jexlExpr : String | JacksonTest.java:74:32:74:37 | string : String | provenance | | | JacksonTest.java:22:28:22:35 | jexlExpr : String | JacksonTest.java:83:32:83:37 | string : String | provenance | | | JacksonTest.java:22:28:22:35 | jexlExpr : String | JacksonTest.java:92:32:92:37 | string : String | provenance | | @@ -197,14 +201,14 @@ edges | JacksonTest.java:139:32:139:37 | string : String | JacksonTest.java:142:30:142:35 | string | provenance | | | JacksonTest.java:148:32:148:37 | string : String | JacksonTest.java:151:62:151:67 | string : String | provenance | | | JacksonTest.java:151:62:151:67 | string : String | JacksonTest.java:151:31:151:68 | createParser(...) | provenance | Config | -| JacksonTest.java:151:62:151:67 | string : String | JacksonTest.java:151:31:151:68 | createParser(...) | provenance | MaD:6 | +| JacksonTest.java:151:62:151:67 | string : String | JacksonTest.java:151:31:151:68 | createParser(...) | provenance | MaD:8 | | JacksonTest.java:157:32:157:37 | string : String | JacksonTest.java:160:48:160:53 | string : String | provenance | | | JacksonTest.java:160:48:160:53 | string : String | JacksonTest.java:160:32:160:54 | readTree(...) | provenance | Config | | JacksonTest.java:166:32:166:36 | input : String | JacksonTest.java:167:30:167:34 | input : String | provenance | | -| JacksonTest.java:167:30:167:34 | input : String | JacksonTest.java:167:30:167:45 | split(...) : String[] | provenance | MaD:15 | +| JacksonTest.java:167:30:167:34 | input : String | JacksonTest.java:167:30:167:45 | split(...) : String[] | provenance | MaD:17 | | JacksonTest.java:167:30:167:45 | split(...) : String[] | JacksonTest.java:172:30:172:33 | data | provenance | | | JacksonTest.java:178:32:178:36 | input : String | JacksonTest.java:179:30:179:34 | input : String | provenance | | -| JacksonTest.java:179:30:179:34 | input : String | JacksonTest.java:179:30:179:45 | split(...) : String[] | provenance | MaD:15 | +| JacksonTest.java:179:30:179:34 | input : String | JacksonTest.java:179:30:179:45 | split(...) : String[] | provenance | MaD:17 | | JacksonTest.java:179:30:179:45 | split(...) : String[] | JacksonTest.java:183:30:183:33 | data | provenance | | | JoddJsonServlet.java:32:23:32:46 | getParameter(...) : String | JoddJsonServlet.java:45:37:45:40 | json | provenance | Src:MaD:3 | | JoddJsonServlet.java:32:23:32:46 | getParameter(...) : String | JoddJsonServlet.java:47:56:47:59 | json | provenance | Src:MaD:3 | @@ -213,32 +217,38 @@ edges | JoddJsonServlet.java:58:23:58:46 | getParameter(...) : String | JoddJsonServlet.java:63:39:63:42 | json | provenance | Src:MaD:3 | | ObjectMessageTest.java:6:27:6:41 | message : Message | ObjectMessageTest.java:7:26:7:32 | message | provenance | Src:MaD:2 | | ParcelableEntity.java:29:50:29:62 | parcel : Parcel | ParcelableEntity.java:32:44:32:49 | parcel : Parcel | provenance | | -| ParcelableEntity.java:32:44:32:49 | parcel : Parcel | ParcelableEntity.java:32:44:32:62 | readString(...) | provenance | MaD:4 | +| ParcelableEntity.java:32:44:32:49 | parcel : Parcel | ParcelableEntity.java:32:44:32:62 | readString(...) | provenance | MaD:6 | | TestMessageBodyReader.java:20:55:20:78 | entityStream : InputStream | TestMessageBodyReader.java:22:18:22:52 | new ObjectInputStream(...) | provenance | inputStreamWrapper | | TestMessageBodyReader.java:20:55:20:78 | entityStream : InputStream | TestMessageBodyReader.java:22:40:22:51 | entityStream : InputStream | provenance | | -| TestMessageBodyReader.java:22:40:22:51 | entityStream : InputStream | TestMessageBodyReader.java:22:18:22:52 | new ObjectInputStream(...) | provenance | MaD:11 | +| TestMessageBodyReader.java:22:40:22:51 | entityStream : InputStream | TestMessageBodyReader.java:22:18:22:52 | new ObjectInputStream(...) | provenance | MaD:13 | models | 1 | Source: java.net; Socket; false; getInputStream; (); ; ReturnValue; remote; manual | | 2 | Source: javax.jms; MessageListener; true; onMessage; (Message); ; Parameter[0]; remote; manual | | 3 | Source: javax.servlet; ServletRequest; false; getParameter; (String); ; ReturnValue; remote; manual | -| 4 | Summary: android.os; Parcel; false; readString; ; ; Argument[this]; ReturnValue; taint; manual | -| 5 | Summary: com.esotericsoftware.kryo.io; Input; false; Input; ; ; Argument[0]; Argument[this]; taint; manual | -| 6 | Summary: com.fasterxml.jackson.core; JsonFactory; false; createParser; ; ; Argument[0]; ReturnValue; taint; manual | -| 7 | Summary: java.beans; XMLDecoder; false; XMLDecoder; ; ; Argument[0]; Argument[this]; taint; manual | -| 8 | Summary: java.io; ByteArrayInputStream; false; ByteArrayInputStream; ; ; Argument[0]; Argument[this]; taint; manual | -| 9 | Summary: java.io; InputStream; true; read; (byte[]); ; Argument[this]; Argument[0]; taint; manual | -| 10 | Summary: java.io; InputStreamReader; false; InputStreamReader; ; ; Argument[0]; Argument[this]; taint; manual | -| 11 | Summary: java.io; ObjectInputStream; false; ObjectInputStream; ; ; Argument[0]; Argument[this]; taint; manual | -| 12 | Summary: java.io; StringReader; false; StringReader; ; ; Argument[0]; Argument[this]; taint; manual | -| 13 | Summary: java.lang; String; false; String; ; ; Argument[0]; Argument[this]; taint; manual | -| 14 | Summary: java.lang; String; false; getBytes; ; ; Argument[this]; ReturnValue; taint; manual | -| 15 | Summary: java.lang; String; false; split; ; ; Argument[this]; ReturnValue; taint; manual | -| 16 | Summary: org.json; JSONObject; false; JSONObject; (String); ; Argument[0]; Argument[this]; taint; manual | +| 4 | Source: unsafedeserialization; A; false; getTaintedMyObjectInput; (); ; ReturnValue; remote; manual | +| 5 | Source: unsafedeserialization; A; false; getTaintedObjectInput; (); ; ReturnValue; remote; manual | +| 6 | Summary: android.os; Parcel; false; readString; ; ; Argument[this]; ReturnValue; taint; manual | +| 7 | Summary: com.esotericsoftware.kryo.io; Input; false; Input; ; ; Argument[0]; Argument[this]; taint; manual | +| 8 | Summary: com.fasterxml.jackson.core; JsonFactory; false; createParser; ; ; Argument[0]; ReturnValue; taint; manual | +| 9 | Summary: java.beans; XMLDecoder; false; XMLDecoder; ; ; Argument[0]; Argument[this]; taint; manual | +| 10 | Summary: java.io; ByteArrayInputStream; false; ByteArrayInputStream; ; ; Argument[0]; Argument[this]; taint; manual | +| 11 | Summary: java.io; InputStream; true; read; (byte[]); ; Argument[this]; Argument[0]; taint; manual | +| 12 | Summary: java.io; InputStreamReader; false; InputStreamReader; ; ; Argument[0]; Argument[this]; taint; manual | +| 13 | Summary: java.io; ObjectInputStream; false; ObjectInputStream; ; ; Argument[0]; Argument[this]; taint; manual | +| 14 | Summary: java.io; StringReader; false; StringReader; ; ; Argument[0]; Argument[this]; taint; manual | +| 15 | Summary: java.lang; String; false; String; ; ; Argument[0]; Argument[this]; taint; manual | +| 16 | Summary: java.lang; String; false; getBytes; ; ; Argument[this]; ReturnValue; taint; manual | +| 17 | Summary: java.lang; String; false; split; ; ; Argument[this]; ReturnValue; taint; manual | +| 18 | Summary: org.json; JSONObject; false; JSONObject; (String); ; Argument[0]; Argument[this]; taint; manual | nodes | A.java:17:31:17:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | | A.java:18:28:18:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | | A.java:18:50:18:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | | A.java:19:12:19:13 | in | semmle.label | in | +| A.java:23:31:23:55 | getTaintedObjectInput(...) : ObjectInput | semmle.label | getTaintedObjectInput(...) : ObjectInput | +| A.java:24:12:24:22 | objectInput | semmle.label | objectInput | +| A.java:28:33:28:59 | getTaintedMyObjectInput(...) : MyObjectInput | semmle.label | getTaintedMyObjectInput(...) : MyObjectInput | +| A.java:29:12:29:22 | objectInput | semmle.label | objectInput | | A.java:33:31:33:51 | getInputStream(...) : InputStream | semmle.label | getInputStream(...) : InputStream | | A.java:34:28:34:61 | new ObjectInputStream(...) : ObjectInputStream | semmle.label | new ObjectInputStream(...) : ObjectInputStream | | A.java:34:50:34:60 | inputStream : InputStream | semmle.label | inputStream : InputStream | From 7764fbb664075a5df393eb749968d770843a218d Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 11 Jul 2025 11:01:51 +0100 Subject: [PATCH 79/96] Change note --- .../2025-07-11-unsafe-deserialization-extra-sink.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/lib/change-notes/2025-07-11-unsafe-deserialization-extra-sink.md diff --git a/java/ql/lib/change-notes/2025-07-11-unsafe-deserialization-extra-sink.md b/java/ql/lib/change-notes/2025-07-11-unsafe-deserialization-extra-sink.md new file mode 100644 index 00000000000..26f745a2bb7 --- /dev/null +++ b/java/ql/lib/change-notes/2025-07-11-unsafe-deserialization-extra-sink.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The qualifiers of a calls to `readObject` on any classes that implement `java.io.ObjectInput` are now recognised as sinks for `java/unsafe-deserialization`. Previously this was only the case for classes which extend `java.io.ObjectInputStream`. From a96d3d7be8a87678696553b7578d975e527c0127 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 11 Jul 2025 12:38:09 +0200 Subject: [PATCH 80/96] Rust: Add more type inference tests --- .../test/library-tests/type-inference/main.rs | 26 + .../type-inference/type-inference.expected | 667 +++++++++--------- 2 files changed, 372 insertions(+), 321 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 91040541f3e..399bca27d3b 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2295,6 +2295,10 @@ mod explicit_type_args { field: T5, } + fn foo(x: T) -> T { + x + } + pub fn f() { let x1: Option> = S1::assoc_fun(); // $ type=x1:T.T.S2 method=assoc_fun let x2 = S1::::assoc_fun(); // $ type=x2:T.T.S2 method=assoc_fun @@ -2315,6 +2319,7 @@ mod explicit_type_args { { field: S2::default(), // $ method=default }; + let x14 = foo::(Default::default()); // $ type=x14:i32 method=default method=foo } } @@ -2457,6 +2462,27 @@ pub mod pattern_matching { _ => (), } + let opt1 = Some(Default::default()); // $ MISSING: type=opt1:T.i32 method=default + #[rustfmt::skip] + let _ = if let Some::(x) = opt1 + { + x; // $ MISSING: type=x:i32 + }; + + let opt2 = Some(Default::default()); // $ MISSING: type=opt2:T.i32 method=default + #[rustfmt::skip] + let _ = if let Option::Some::(x) = opt2 + { + x; // $ MISSING: type=x:i32 + }; + + let opt3 = Some(Default::default()); // $ type=opt3:T.i32 method=default + #[rustfmt::skip] + let _ = if let Option::::Some(x) = opt3 + { + x; // $ type=x:i32 + }; + None } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 0439d0801ad..c1affdb6658 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -3980,327 +3980,352 @@ inferType | main.rs:2285:33:2287:9 | { ... } | T | main.rs:2276:10:2276:19 | T | | main.rs:2286:13:2286:16 | self | | main.rs:2271:5:2271:20 | S1 | | main.rs:2286:13:2286:16 | self | T | main.rs:2276:10:2276:19 | T | -| main.rs:2299:13:2299:14 | x1 | | {EXTERNAL LOCATION} | Option | -| main.rs:2299:13:2299:14 | x1 | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2299:13:2299:14 | x1 | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2299:34:2299:48 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2300:13:2300:14 | x2 | | {EXTERNAL LOCATION} | Option | -| main.rs:2300:13:2300:14 | x2 | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2300:13:2300:14 | x2 | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2300:18:2300:38 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2301:13:2301:14 | x3 | | {EXTERNAL LOCATION} | Option | -| main.rs:2301:13:2301:14 | x3 | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2301:13:2301:14 | x3 | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | -| main.rs:2301:18:2301:32 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2302:13:2302:14 | x4 | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2302:13:2302:14 | x4 | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2302:18:2302:48 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2302:18:2302:48 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2302:35:2302:47 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2302:35:2302:47 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2303:13:2303:14 | x5 | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2303:13:2303:14 | x5 | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2303:18:2303:42 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2303:18:2303:42 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2303:29:2303:41 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | -| main.rs:2303:29:2303:41 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | -| main.rs:2304:13:2304:14 | x6 | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2304:13:2304:14 | x6 | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2304:18:2304:45 | S4::<...>(...) | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2304:18:2304:45 | S4::<...>(...) | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2304:27:2304:44 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2305:13:2305:14 | x7 | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2305:13:2305:14 | x7 | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2305:18:2305:23 | S4(...) | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2305:18:2305:23 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2305:21:2305:22 | S2 | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2306:13:2306:14 | x8 | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2306:13:2306:14 | x8 | T4 | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:18:2306:22 | S4(...) | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2306:18:2306:22 | S4(...) | T4 | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:21:2306:21 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2307:13:2307:14 | x9 | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2307:13:2307:14 | x9 | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2307:18:2307:34 | S4(...) | | main.rs:2292:5:2292:27 | S4 | -| main.rs:2307:18:2307:34 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2307:21:2307:33 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2308:13:2308:15 | x10 | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2308:13:2308:15 | x10 | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2308:19:2311:9 | S5::<...> {...} | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2308:19:2311:9 | S5::<...> {...} | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2310:20:2310:37 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2312:13:2312:15 | x11 | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2312:13:2312:15 | x11 | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2312:19:2312:34 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2312:19:2312:34 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2312:31:2312:32 | S2 | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2313:13:2313:15 | x12 | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2313:13:2313:15 | x12 | T5 | {EXTERNAL LOCATION} | i32 | -| main.rs:2313:19:2313:33 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2313:19:2313:33 | S5 {...} | T5 | {EXTERNAL LOCATION} | i32 | -| main.rs:2313:31:2313:31 | 0 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2314:13:2314:15 | x13 | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2314:13:2314:15 | x13 | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2314:19:2317:9 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | -| main.rs:2314:19:2317:9 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | -| main.rs:2316:20:2316:32 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | -| main.rs:2326:14:2326:18 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | -| main.rs:2326:21:2326:25 | S1 {...} | | main.rs:2322:5:2322:16 | S1 | -| main.rs:2328:16:2328:19 | SelfParam | | main.rs:2322:5:2322:16 | S1 | -| main.rs:2362:30:2461:5 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2363:13:2363:17 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2363:13:2363:17 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2363:21:2363:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2363:21:2363:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2363:26:2363:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2364:16:2364:25 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2364:16:2364:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2364:21:2364:24 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2364:29:2364:33 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2364:29:2364:33 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2365:17:2365:20 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2365:24:2365:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2366:22:2366:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2366:22:2366:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2366:22:2366:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2366:22:2366:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2366:24:2366:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2368:15:2368:19 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2368:15:2368:19 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2369:13:2369:22 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2369:13:2369:22 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2369:18:2369:21 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2370:21:2370:24 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2370:28:2370:31 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2371:26:2371:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2371:26:2371:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2371:26:2371:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2371:26:2371:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2371:28:2371:31 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2373:13:2373:16 | None | | {EXTERNAL LOCATION} | Option | -| main.rs:2373:13:2373:16 | None | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2375:13:2375:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2375:20:2375:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2375:20:2375:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2375:20:2375:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | -| main.rs:2376:13:2376:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2376:20:2376:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2377:18:2377:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2377:18:2377:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2377:18:2377:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2377:18:2377:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2377:20:2377:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2378:13:2378:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2378:20:2378:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2378:20:2378:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2378:20:2378:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | -| main.rs:2379:18:2379:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2379:18:2379:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2379:18:2379:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2379:18:2379:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2379:20:2379:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:13:2381:18 | value2 | | file://:0:0:0:0 | & | -| main.rs:2381:13:2381:18 | value2 | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2381:13:2381:18 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:22:2381:30 | &... | | file://:0:0:0:0 | & | -| main.rs:2381:22:2381:30 | &... | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2381:22:2381:30 | &... | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:23:2381:30 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2381:23:2381:30 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:28:2381:29 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:16:2382:26 | &... | | file://:0:0:0:0 | & | -| main.rs:2382:16:2382:26 | &... | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2382:16:2382:26 | &... | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:17:2382:26 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2382:17:2382:26 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:22:2382:25 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:30:2382:35 | value2 | | file://:0:0:0:0 | & | -| main.rs:2382:30:2382:35 | value2 | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2382:30:2382:35 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2383:17:2383:20 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2383:24:2383:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2384:22:2384:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2384:22:2384:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2384:22:2384:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2384:22:2384:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2384:24:2384:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:13:2387:18 | value3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:22:2387:23 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2388:20:2388:23 | mesg | | file://:0:0:0:0 | & | -| main.rs:2388:20:2388:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2388:27:2388:32 | value3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2389:17:2389:20 | mesg | | file://:0:0:0:0 | & | -| main.rs:2389:17:2389:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2389:24:2389:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2389:24:2389:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2390:22:2390:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2390:22:2390:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2390:22:2390:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2390:22:2390:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2390:24:2390:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2390:24:2390:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:13:2393:18 | value4 | | {EXTERNAL LOCATION} | Option | -| main.rs:2393:13:2393:18 | value4 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:22:2393:29 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2393:22:2393:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:27:2393:28 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:16:2394:29 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2394:16:2394:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:25:2394:28 | mesg | | file://:0:0:0:0 | & | -| main.rs:2394:25:2394:28 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:33:2394:38 | value4 | | {EXTERNAL LOCATION} | Option | -| main.rs:2394:33:2394:38 | value4 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2395:17:2395:20 | mesg | | file://:0:0:0:0 | & | -| main.rs:2395:17:2395:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2298:15:2298:15 | x | | main.rs:2298:12:2298:12 | T | +| main.rs:2298:26:2300:5 | { ... } | | main.rs:2298:12:2298:12 | T | +| main.rs:2299:9:2299:9 | x | | main.rs:2298:12:2298:12 | T | +| main.rs:2303:13:2303:14 | x1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2303:13:2303:14 | x1 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2303:13:2303:14 | x1 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2303:34:2303:48 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2303:34:2303:48 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2303:34:2303:48 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2304:13:2304:14 | x2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2304:13:2304:14 | x2 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2304:13:2304:14 | x2 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2304:18:2304:38 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2304:18:2304:38 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2304:18:2304:38 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2305:13:2305:14 | x3 | | {EXTERNAL LOCATION} | Option | +| main.rs:2305:13:2305:14 | x3 | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2305:13:2305:14 | x3 | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2305:18:2305:32 | ...::assoc_fun(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2305:18:2305:32 | ...::assoc_fun(...) | T | main.rs:2271:5:2271:20 | S1 | +| main.rs:2305:18:2305:32 | ...::assoc_fun(...) | T.T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2306:13:2306:14 | x4 | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2306:13:2306:14 | x4 | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2306:18:2306:48 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2306:18:2306:48 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2306:35:2306:47 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2306:35:2306:47 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2307:13:2307:14 | x5 | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2307:13:2307:14 | x5 | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2307:18:2307:42 | ...::method(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2307:18:2307:42 | ...::method(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2307:29:2307:41 | ...::default(...) | | main.rs:2271:5:2271:20 | S1 | +| main.rs:2307:29:2307:41 | ...::default(...) | T | main.rs:2273:5:2274:14 | S2 | +| main.rs:2308:13:2308:14 | x6 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2308:13:2308:14 | x6 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2308:18:2308:45 | S4::<...>(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2308:18:2308:45 | S4::<...>(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2308:27:2308:44 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2309:13:2309:14 | x7 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2309:13:2309:14 | x7 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2309:18:2309:23 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2309:18:2309:23 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2309:21:2309:22 | S2 | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2310:13:2310:14 | x8 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2310:13:2310:14 | x8 | T4 | {EXTERNAL LOCATION} | i32 | +| main.rs:2310:18:2310:22 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2310:18:2310:22 | S4(...) | T4 | {EXTERNAL LOCATION} | i32 | +| main.rs:2310:21:2310:21 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2311:13:2311:14 | x9 | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2311:13:2311:14 | x9 | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2311:18:2311:34 | S4(...) | | main.rs:2292:5:2292:27 | S4 | +| main.rs:2311:18:2311:34 | S4(...) | T4 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2311:21:2311:33 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2312:13:2312:15 | x10 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2312:13:2312:15 | x10 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2312:19:2315:9 | S5::<...> {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2312:19:2315:9 | S5::<...> {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2314:20:2314:37 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2316:13:2316:15 | x11 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2316:13:2316:15 | x11 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2316:19:2316:34 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2316:19:2316:34 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2316:31:2316:32 | S2 | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2317:13:2317:15 | x12 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2317:13:2317:15 | x12 | T5 | {EXTERNAL LOCATION} | i32 | +| main.rs:2317:19:2317:33 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2317:19:2317:33 | S5 {...} | T5 | {EXTERNAL LOCATION} | i32 | +| main.rs:2317:31:2317:31 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2318:13:2318:15 | x13 | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2318:13:2318:15 | x13 | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2318:19:2321:9 | S5 {...} | | main.rs:2294:5:2296:5 | S5 | +| main.rs:2318:19:2321:9 | S5 {...} | T5 | main.rs:2273:5:2274:14 | S2 | +| main.rs:2320:20:2320:32 | ...::default(...) | | main.rs:2273:5:2274:14 | S2 | +| main.rs:2322:13:2322:15 | x14 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2322:19:2322:48 | foo::<...>(...) | | {EXTERNAL LOCATION} | i32 | +| main.rs:2322:30:2322:47 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | +| main.rs:2331:14:2331:18 | S1 {...} | | main.rs:2327:5:2327:16 | S1 | +| main.rs:2331:21:2331:25 | S1 {...} | | main.rs:2327:5:2327:16 | S1 | +| main.rs:2333:16:2333:19 | SelfParam | | main.rs:2327:5:2327:16 | S1 | +| main.rs:2367:30:2487:5 | { ... } | | {EXTERNAL LOCATION} | Option | +| main.rs:2368:13:2368:17 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2368:13:2368:17 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2368:21:2368:28 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2368:21:2368:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2368:26:2368:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2369:16:2369:25 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2369:16:2369:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2369:21:2369:24 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2369:29:2369:33 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2369:29:2369:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2370:17:2370:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2370:24:2370:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2371:22:2371:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2371:22:2371:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2371:22:2371:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2371:22:2371:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2371:24:2371:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2373:15:2373:19 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2373:15:2373:19 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2374:13:2374:22 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2374:13:2374:22 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2374:18:2374:21 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2375:21:2375:24 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2375:28:2375:31 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2376:26:2376:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2376:26:2376:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2376:26:2376:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2376:26:2376:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2376:28:2376:31 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2378:13:2378:16 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2378:13:2378:16 | None | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2380:13:2380:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2380:20:2380:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2380:20:2380:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2380:20:2380:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:13:2381:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2381:20:2381:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2382:18:2382:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2382:18:2382:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2382:18:2382:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2382:18:2382:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2382:20:2382:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:13:2383:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:20:2383:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2383:20:2383:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:20:2383:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | +| main.rs:2384:18:2384:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2384:18:2384:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2384:18:2384:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2384:18:2384:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2384:20:2384:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2386:13:2386:18 | value2 | | file://:0:0:0:0 | & | +| main.rs:2386:13:2386:18 | value2 | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2386:13:2386:18 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2386:22:2386:30 | &... | | file://:0:0:0:0 | & | +| main.rs:2386:22:2386:30 | &... | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2386:22:2386:30 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2386:23:2386:30 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2386:23:2386:30 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2386:28:2386:29 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2387:16:2387:26 | &... | | file://:0:0:0:0 | & | +| main.rs:2387:16:2387:26 | &... | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2387:16:2387:26 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2387:17:2387:26 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2387:17:2387:26 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2387:22:2387:25 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2387:30:2387:35 | value2 | | file://:0:0:0:0 | & | +| main.rs:2387:30:2387:35 | value2 | &T | {EXTERNAL LOCATION} | Option | +| main.rs:2387:30:2387:35 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2388:17:2388:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2388:24:2388:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2389:22:2389:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2389:22:2389:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2389:22:2389:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2389:22:2389:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2389:24:2389:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2392:13:2392:18 | value3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2392:22:2392:23 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:20:2393:23 | mesg | | file://:0:0:0:0 | & | +| main.rs:2393:20:2393:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2393:27:2393:32 | value3 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:17:2394:20 | mesg | | file://:0:0:0:0 | & | +| main.rs:2394:17:2394:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2394:24:2394:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2394:24:2394:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2395:22:2395:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2395:22:2395:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2395:22:2395:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2395:22:2395:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2395:24:2395:27 | mesg | | file://:0:0:0:0 | & | | main.rs:2395:24:2395:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2396:22:2396:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2396:22:2396:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2396:22:2396:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2396:22:2396:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2396:24:2396:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2396:24:2396:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2399:17:2399:22 | value5 | | file://:0:0:0:0 | & | -| main.rs:2399:17:2399:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2399:26:2399:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:13:2400:13 | x | | file://:0:0:0:0 | & | -| main.rs:2400:13:2400:13 | x | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:17:2400:22 | value5 | | file://:0:0:0:0 | & | -| main.rs:2400:17:2400:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2402:13:2402:28 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2402:13:2402:28 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2402:13:2402:28 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2402:32:2405:9 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2402:32:2405:9 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2402:32:2405:9 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2403:21:2403:22 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2404:21:2404:25 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2406:16:2406:48 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2406:16:2406:48 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2406:16:2406:48 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2406:33:2406:38 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2406:41:2406:46 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2406:52:2406:67 | my_record_struct | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2406:52:2406:67 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2406:52:2406:67 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2407:17:2407:17 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2407:21:2407:26 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2408:17:2408:17 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2408:21:2408:26 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2412:13:2412:27 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | -| main.rs:2412:13:2412:27 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2412:13:2412:27 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2412:31:2412:54 | MyTupleStruct(...) | | main.rs:2355:5:2355:41 | MyTupleStruct | -| main.rs:2412:31:2412:54 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2412:31:2412:54 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2412:45:2412:46 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2412:49:2412:53 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2413:16:2413:44 | MyTupleStruct(...) | | main.rs:2355:5:2355:41 | MyTupleStruct | -| main.rs:2413:16:2413:44 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2413:16:2413:44 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2413:30:2413:35 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2413:38:2413:43 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2413:48:2413:62 | my_tuple_struct | | main.rs:2355:5:2355:41 | MyTupleStruct | -| main.rs:2413:48:2413:62 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2413:48:2413:62 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2414:17:2414:17 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2414:21:2414:26 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2415:17:2415:17 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2415:21:2415:26 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2419:13:2419:20 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2419:13:2419:20 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2419:13:2419:20 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2419:24:2422:9 | ...::Variant1 {...} | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2419:24:2422:9 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2419:24:2422:9 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2420:21:2420:22 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2421:21:2421:25 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2423:15:2423:22 | my_enum1 | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2423:15:2423:22 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2423:15:2423:22 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2424:13:2424:47 | ...::Variant1 {...} | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2424:13:2424:47 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2424:13:2424:47 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2424:32:2424:37 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2424:40:2424:45 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2425:21:2425:21 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2425:25:2425:30 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2426:21:2426:21 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2426:25:2426:30 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2429:13:2429:44 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2429:13:2429:44 | ...::Variant2(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2429:13:2429:44 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2429:30:2429:35 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2429:38:2429:43 | value2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2430:21:2430:21 | x | | {EXTERNAL LOCATION} | bool | -| main.rs:2430:25:2430:30 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2431:21:2431:21 | y | | {EXTERNAL LOCATION} | i32 | -| main.rs:2431:25:2431:30 | value2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2436:13:2436:26 | my_nested_enum | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2436:13:2436:26 | my_nested_enum | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2436:13:2436:26 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2436:13:2436:26 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2436:13:2436:26 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2436:13:2436:26 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2436:30:2442:9 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2437:13:2437:17 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2438:13:2441:13 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | -| main.rs:2438:13:2441:13 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2439:25:2439:26 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2440:25:2440:32 | "string" | | file://:0:0:0:0 | & | -| main.rs:2440:25:2440:32 | "string" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2444:15:2444:28 | my_nested_enum | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2444:15:2444:28 | my_nested_enum | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2444:15:2444:28 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2444:15:2444:28 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2444:15:2444:28 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2444:15:2444:28 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2445:13:2451:13 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2446:17:2446:22 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2447:17:2450:17 | MyRecordStruct {...} | | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | -| main.rs:2447:17:2450:17 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2448:29:2448:29 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2449:29:2449:29 | y | | file://:0:0:0:0 | & | -| main.rs:2449:29:2449:29 | y | &T | {EXTERNAL LOCATION} | str | -| main.rs:2452:21:2452:21 | a | | {EXTERNAL LOCATION} | bool | -| main.rs:2452:25:2452:30 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2453:21:2453:21 | b | | {EXTERNAL LOCATION} | i32 | -| main.rs:2453:25:2453:25 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2454:21:2454:21 | c | | file://:0:0:0:0 | & | -| main.rs:2454:21:2454:21 | c | &T | {EXTERNAL LOCATION} | str | -| main.rs:2454:25:2454:25 | y | | file://:0:0:0:0 | & | -| main.rs:2454:25:2454:25 | y | &T | {EXTERNAL LOCATION} | str | -| main.rs:2457:13:2457:13 | _ | | main.rs:2357:5:2360:5 | MyEnum | -| main.rs:2457:13:2457:13 | _ | T1 | main.rs:2350:5:2353:5 | MyRecordStruct | -| main.rs:2457:13:2457:13 | _ | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2457:13:2457:13 | _ | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2457:13:2457:13 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2457:13:2457:13 | _ | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2460:9:2460:12 | None | | {EXTERNAL LOCATION} | Option | -| main.rs:2466:5:2466:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2467:5:2467:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2467:20:2467:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2467:41:2467:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2483:5:2483:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | -| main.rs:2492:5:2492:25 | ...::f(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2398:13:2398:18 | value4 | | {EXTERNAL LOCATION} | Option | +| main.rs:2398:13:2398:18 | value4 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2398:22:2398:29 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2398:22:2398:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2398:27:2398:28 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2399:16:2399:29 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2399:16:2399:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2399:25:2399:28 | mesg | | file://:0:0:0:0 | & | +| main.rs:2399:25:2399:28 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2399:33:2399:38 | value4 | | {EXTERNAL LOCATION} | Option | +| main.rs:2399:33:2399:38 | value4 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:17:2400:20 | mesg | | file://:0:0:0:0 | & | +| main.rs:2400:17:2400:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2400:24:2400:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2400:24:2400:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2401:22:2401:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2401:22:2401:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2401:22:2401:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2401:22:2401:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2401:24:2401:27 | mesg | | file://:0:0:0:0 | & | +| main.rs:2401:24:2401:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2404:17:2404:22 | value5 | | file://:0:0:0:0 | & | +| main.rs:2404:17:2404:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2404:26:2404:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2405:13:2405:13 | x | | file://:0:0:0:0 | & | +| main.rs:2405:13:2405:13 | x | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2405:17:2405:22 | value5 | | file://:0:0:0:0 | & | +| main.rs:2405:17:2405:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | +| main.rs:2407:13:2407:28 | my_record_struct | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2407:13:2407:28 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2407:13:2407:28 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2407:32:2410:9 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2407:32:2410:9 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2407:32:2410:9 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2408:21:2408:22 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2409:21:2409:25 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2411:16:2411:48 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2411:16:2411:48 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2411:16:2411:48 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2411:33:2411:38 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2411:41:2411:46 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2411:52:2411:67 | my_record_struct | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2411:52:2411:67 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2411:52:2411:67 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2412:17:2412:17 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2412:21:2412:26 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2413:17:2413:17 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2413:21:2413:26 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2417:13:2417:27 | my_tuple_struct | | main.rs:2360:5:2360:41 | MyTupleStruct | +| main.rs:2417:13:2417:27 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2417:13:2417:27 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2417:31:2417:54 | MyTupleStruct(...) | | main.rs:2360:5:2360:41 | MyTupleStruct | +| main.rs:2417:31:2417:54 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2417:31:2417:54 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2417:45:2417:46 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2417:49:2417:53 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2418:16:2418:44 | MyTupleStruct(...) | | main.rs:2360:5:2360:41 | MyTupleStruct | +| main.rs:2418:16:2418:44 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2418:16:2418:44 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2418:30:2418:35 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2418:38:2418:43 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2418:48:2418:62 | my_tuple_struct | | main.rs:2360:5:2360:41 | MyTupleStruct | +| main.rs:2418:48:2418:62 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2418:48:2418:62 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2419:17:2419:17 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2419:21:2419:26 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2420:17:2420:17 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2420:21:2420:26 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2424:13:2424:20 | my_enum1 | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2424:13:2424:20 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2424:13:2424:20 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2424:24:2427:9 | ...::Variant1 {...} | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2424:24:2427:9 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2424:24:2427:9 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2425:21:2425:22 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2426:21:2426:25 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2428:15:2428:22 | my_enum1 | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2428:15:2428:22 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2428:15:2428:22 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2429:13:2429:47 | ...::Variant1 {...} | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2429:13:2429:47 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2429:13:2429:47 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2429:32:2429:37 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2429:40:2429:45 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2430:21:2430:21 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2430:25:2430:30 | value1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2431:21:2431:21 | y | | {EXTERNAL LOCATION} | bool | +| main.rs:2431:25:2431:30 | value2 | | {EXTERNAL LOCATION} | bool | +| main.rs:2434:13:2434:44 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2434:13:2434:44 | ...::Variant2(...) | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2434:13:2434:44 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2434:30:2434:35 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2434:38:2434:43 | value2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2435:21:2435:21 | x | | {EXTERNAL LOCATION} | bool | +| main.rs:2435:25:2435:30 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2436:21:2436:21 | y | | {EXTERNAL LOCATION} | i32 | +| main.rs:2436:25:2436:30 | value2 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2441:13:2441:26 | my_nested_enum | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2441:13:2441:26 | my_nested_enum | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2441:13:2441:26 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2441:13:2441:26 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2441:13:2441:26 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2441:13:2441:26 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2441:30:2447:9 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2442:13:2442:17 | false | | {EXTERNAL LOCATION} | bool | +| main.rs:2443:13:2446:13 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2444:25:2444:26 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2445:25:2445:32 | "string" | | file://:0:0:0:0 | & | +| main.rs:2445:25:2445:32 | "string" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2449:15:2449:28 | my_nested_enum | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2449:15:2449:28 | my_nested_enum | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2449:15:2449:28 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2449:15:2449:28 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2449:15:2449:28 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2449:15:2449:28 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2450:13:2456:13 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2451:17:2451:22 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2452:17:2455:17 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2453:29:2453:29 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2454:29:2454:29 | y | | file://:0:0:0:0 | & | +| main.rs:2454:29:2454:29 | y | &T | {EXTERNAL LOCATION} | str | +| main.rs:2457:21:2457:21 | a | | {EXTERNAL LOCATION} | bool | +| main.rs:2457:25:2457:30 | value1 | | {EXTERNAL LOCATION} | bool | +| main.rs:2458:21:2458:21 | b | | {EXTERNAL LOCATION} | i32 | +| main.rs:2458:25:2458:25 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2459:21:2459:21 | c | | file://:0:0:0:0 | & | +| main.rs:2459:21:2459:21 | c | &T | {EXTERNAL LOCATION} | str | +| main.rs:2459:25:2459:25 | y | | file://:0:0:0:0 | & | +| main.rs:2459:25:2459:25 | y | &T | {EXTERNAL LOCATION} | str | +| main.rs:2462:13:2462:13 | _ | | main.rs:2362:5:2365:5 | MyEnum | +| main.rs:2462:13:2462:13 | _ | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | +| main.rs:2462:13:2462:13 | _ | T1.T1 | {EXTERNAL LOCATION} | i32 | +| main.rs:2462:13:2462:13 | _ | T1.T2 | file://:0:0:0:0 | & | +| main.rs:2462:13:2462:13 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | +| main.rs:2462:13:2462:13 | _ | T2 | {EXTERNAL LOCATION} | bool | +| main.rs:2465:13:2465:16 | opt1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2465:20:2465:43 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2467:24:2467:37 | Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2467:41:2467:44 | opt1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2472:13:2472:16 | opt2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2472:20:2472:43 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2474:24:2474:45 | ...::Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2474:49:2474:52 | opt2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2479:13:2479:16 | opt3 | | {EXTERNAL LOCATION} | Option | +| main.rs:2479:13:2479:16 | opt3 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2479:20:2479:43 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2479:20:2479:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2479:25:2479:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | +| main.rs:2481:24:2481:45 | ...::Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2481:24:2481:45 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2481:44:2481:44 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2481:49:2481:52 | opt3 | | {EXTERNAL LOCATION} | Option | +| main.rs:2481:49:2481:52 | opt3 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2483:13:2483:13 | x | | {EXTERNAL LOCATION} | i32 | +| main.rs:2486:9:2486:12 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2492:5:2492:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2493:5:2493:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2493:20:2493:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2493:41:2493:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2509:5:2509:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| main.rs:2518:5:2518:25 | ...::f(...) | | {EXTERNAL LOCATION} | Option | testFailures From edf6c7fbd66acaedfa49d4d648b9622fdd7f66ad Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 11 Jul 2025 12:40:14 +0200 Subject: [PATCH 81/96] Rust: Handle `(Enum::)Variant::` type mentions --- .../codeql/rust/internal/TypeInference.qll | 23 ++++--------------- .../lib/codeql/rust/internal/TypeMention.qll | 12 ++++++++-- .../test/library-tests/type-inference/main.rs | 8 +++---- .../type-inference/type-inference.expected | 14 +++++++++++ 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index 43097c8f760..5ebb8eaa317 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -509,12 +509,7 @@ private module StructExprMatchingInput implements MatchingInputSig { // The struct/enum type is supplied explicitly as a type qualifier, e.g. // `Foo::Variant { ... }`. apos.isStructPos() and - exists(Path p, TypeMention tm | - p = this.getPath() and - if resolvePath(p) instanceof Variant then tm = p.getQualifier() else tm = p - | - result = tm.resolveTypeAt(path) - ) + result = this.getPath().(TypeMention).resolveTypeAt(path) } Declaration getTarget() { result = resolvePath(this.getPath()) } @@ -1242,12 +1237,7 @@ private module StructPatMatchingInput implements MatchingInputSig { // The struct/enum type is supplied explicitly as a type qualifier, e.g. // `let Foo::Variant { ... } = ...`. apos.isStructPos() and - exists(Path p, TypeMention tm | - p = this.getPath() and - if resolvePath(p) instanceof Variant then tm = p.getQualifier() else tm = p - | - result = tm.resolveTypeAt(path) - ) + result = this.getPath().(TypeMention).resolveTypeAt(path) } Declaration getTarget() { result = resolvePath(this.getPath()) } @@ -1297,14 +1287,9 @@ private module TupleStructPatMatchingInput implements MatchingInputSig { result = inferType(this.getNodeAt(apos), path) or // The struct/enum type is supplied explicitly as a type qualifier, e.g. - // `let Option::(x) = ...`. + // `let Option::::Some(x) = ...`. apos.isSelf() and - exists(Path p, TypeMention tm | - p = this.getPath() and - if resolvePath(p) instanceof Variant then tm = p.getQualifier() else tm = p - | - result = tm.resolveTypeAt(path) - ) + result = this.getPath().(TypeMention).resolveTypeAt(path) } Declaration getTarget() { result = resolvePath(this.getPath()) } diff --git a/rust/ql/lib/codeql/rust/internal/TypeMention.qll b/rust/ql/lib/codeql/rust/internal/TypeMention.qll index b2ba77bd35c..6dd69ef49fc 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeMention.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeMention.qll @@ -53,9 +53,13 @@ class SliceTypeReprMention extends TypeMention instanceof SliceTypeRepr { class PathTypeMention extends TypeMention, Path { TypeItemNode resolved; - PathTypeMention() { resolved = resolvePath(this) } + PathTypeMention() { + resolved = resolvePath(this) + or + resolved = resolvePath(this).(Variant).getEnum() + } - ItemNode getResolved() { result = resolved } + TypeItemNode getResolved() { result = resolved } pragma[nomagic] private TypeAlias getResolvedTraitAlias(string name) { @@ -99,6 +103,10 @@ class PathTypeMention extends TypeMention, Path { this = node.getASelfPath() and result = node.(ImplItemNode).getSelfPath().getSegment().getGenericArgList().getTypeArg(i) ) + or + // `Option::::Some` is valid in addition to `Option::Some::` + resolvePath(this) instanceof Variant and + result = this.getQualifier().getSegment().getGenericArgList().getTypeArg(i) } private TypeMention getPositionalTypeArgument(int i) { diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 399bca27d3b..68085609aab 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2462,18 +2462,18 @@ pub mod pattern_matching { _ => (), } - let opt1 = Some(Default::default()); // $ MISSING: type=opt1:T.i32 method=default + let opt1 = Some(Default::default()); // $ type=opt1:T.i32 method=default #[rustfmt::skip] let _ = if let Some::(x) = opt1 { - x; // $ MISSING: type=x:i32 + x; // $ type=x:i32 }; - let opt2 = Some(Default::default()); // $ MISSING: type=opt2:T.i32 method=default + let opt2 = Some(Default::default()); // $ type=opt2:T.i32 method=default #[rustfmt::skip] let _ = if let Option::Some::(x) = opt2 { - x; // $ MISSING: type=x:i32 + x; // $ type=x:i32 }; let opt3 = Some(Default::default()); // $ type=opt3:T.i32 method=default diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index c1affdb6658..b8431097bc3 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -4303,13 +4303,27 @@ inferType | main.rs:2462:13:2462:13 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | | main.rs:2462:13:2462:13 | _ | T2 | {EXTERNAL LOCATION} | bool | | main.rs:2465:13:2465:16 | opt1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2465:13:2465:16 | opt1 | T | {EXTERNAL LOCATION} | i32 | | main.rs:2465:20:2465:43 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2465:20:2465:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2465:25:2465:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | | main.rs:2467:24:2467:37 | Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2467:24:2467:37 | Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2467:36:2467:36 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:2467:41:2467:44 | opt1 | | {EXTERNAL LOCATION} | Option | +| main.rs:2467:41:2467:44 | opt1 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2469:13:2469:13 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:2472:13:2472:16 | opt2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2472:13:2472:16 | opt2 | T | {EXTERNAL LOCATION} | i32 | | main.rs:2472:20:2472:43 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2472:20:2472:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2472:25:2472:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | | main.rs:2474:24:2474:45 | ...::Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2474:24:2474:45 | ...::Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2474:44:2474:44 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:2474:49:2474:52 | opt2 | | {EXTERNAL LOCATION} | Option | +| main.rs:2474:49:2474:52 | opt2 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2476:13:2476:13 | x | | {EXTERNAL LOCATION} | i32 | | main.rs:2479:13:2479:16 | opt3 | | {EXTERNAL LOCATION} | Option | | main.rs:2479:13:2479:16 | opt3 | T | {EXTERNAL LOCATION} | i32 | | main.rs:2479:20:2479:43 | Some(...) | | {EXTERNAL LOCATION} | Option | From 232377a583aff09c77ab6f61fee67a768043d1b0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 11 Jul 2025 13:38:06 +0200 Subject: [PATCH 82/96] C++: Fix C++20 concept related class extensions --- cpp/ql/lib/semmle/code/cpp/Concept.qll | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Concept.qll b/cpp/ql/lib/semmle/code/cpp/Concept.qll index 5d7cd96ee38..1770c1965ed 100644 --- a/cpp/ql/lib/semmle/code/cpp/Concept.qll +++ b/cpp/ql/lib/semmle/code/cpp/Concept.qll @@ -57,7 +57,9 @@ class RequiresExpr extends Expr, @requires_expr { /** * A C++ requirement in a requires expression. */ -class RequirementExpr extends Expr { } +class RequirementExpr extends Expr { + RequirementExpr() { this.getParent() instanceof RequiresExpr } +} /** * A C++ simple requirement in a requires expression. @@ -70,7 +72,6 @@ class RequirementExpr extends Expr { } */ class SimpleRequirementExpr extends RequirementExpr { SimpleRequirementExpr() { - this.getParent() instanceof RequiresExpr and not this instanceof TypeRequirementExpr and not this instanceof CompoundRequirementExpr and not this instanceof NestedRequirementExpr @@ -89,8 +90,6 @@ class SimpleRequirementExpr extends RequirementExpr { * with `T` a template parameter, then `typename T::a_field;` is a type requirement. */ class TypeRequirementExpr extends RequirementExpr, TypeName { - TypeRequirementExpr() { this.getParent() instanceof RequiresExpr } - override string getAPrimaryQlClass() { result = "TypeRequirementExpr" } } @@ -140,7 +139,7 @@ class CompoundRequirementExpr extends RequirementExpr, @compound_requirement { * with `T` a template parameter, then `requires std::is_same::value;` is * a nested requirement. */ -class NestedRequirementExpr extends Expr, @nested_requirement { +class NestedRequirementExpr extends RequirementExpr, @nested_requirement { override string toString() { result = "requires ..." } override string getAPrimaryQlClass() { result = "NestedRequirementExpr" } @@ -163,7 +162,7 @@ class NestedRequirementExpr extends Expr, @nested_requirement { * then `C` is a concept id expression that refers to * the concept `C`. */ -class ConceptIdExpr extends RequirementExpr, @concept_id { +class ConceptIdExpr extends Expr, @concept_id { override string toString() { result = this.getConcept().getName() + "<...>" or From d1cf7f0624819bd653f335f58c7a90c9110c609a Mon Sep 17 00:00:00 2001 From: Taus Date: Wed, 4 Jun 2025 14:40:07 +0000 Subject: [PATCH 83/96] Python: Support type annotations in call graph Adds support for tracking instances via type annotations. Also adds a convenience method to the newly added `Annotation` class, `getAnnotatedExpression`, that returns the expression that is annotated with the given type. For return annotations this is any value returned from the annotated function in question. Co-authored-by: Napalys Klicius --- python/ql/lib/semmle/python/Exprs.qll | 11 +++++++++++ .../python/dataflow/new/internal/DataFlowDispatch.qll | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/python/ql/lib/semmle/python/Exprs.qll b/python/ql/lib/semmle/python/Exprs.qll index accc370481a..9e00e4f794b 100644 --- a/python/ql/lib/semmle/python/Exprs.qll +++ b/python/ql/lib/semmle/python/Exprs.qll @@ -762,6 +762,17 @@ class Annotation extends Expr { or this = any(FunctionExpr f).getReturns() } + + /** Gets the expression that this annotation annotates. */ + Expr getAnnotatedExpression() { + result = any(AnnAssign a | a.getAnnotation() = this).getTarget() + or + result = any(Parameter p | p.getAnnotation() = this) + or + exists(FunctionExpr f | + this = f.getReturns() and result = f.getInnerScope().getReturnNode().getNode() + ) + } } /* Expression Contexts */ diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll index 1a38593bce4..781023a9658 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll @@ -580,6 +580,11 @@ private module TrackClassInstanceInput implements CallGraphConstruction::Simple: class State = Class; predicate start(Node start, Class cls) { + exists(Annotation ann | + ann = classTracker(cls).asExpr() and + start.asExpr() = ann.getAnnotatedExpression() + ) + or resolveClassCall(start.(CallCfgNode).asCfgNode(), cls) or // result of `super().__new__` as used in a `__new__` method implementation From 2c45550a9f5d1b775fa2d17e74fd6bb3a2699380 Mon Sep 17 00:00:00 2001 From: Taus Date: Wed, 4 Jun 2025 14:44:32 +0000 Subject: [PATCH 84/96] Python: Add change note Co-authored-by: Napalys Klicius --- .../change-notes/2025-06-04-call-graph-type-annotations.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 python/ql/lib/change-notes/2025-06-04-call-graph-type-annotations.md diff --git a/python/ql/lib/change-notes/2025-06-04-call-graph-type-annotations.md b/python/ql/lib/change-notes/2025-06-04-call-graph-type-annotations.md new file mode 100644 index 00000000000..2aa17e57632 --- /dev/null +++ b/python/ql/lib/change-notes/2025-06-04-call-graph-type-annotations.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Type annotations such as `foo : Bar` are now treated by the call graph as an indication that `foo` may be an instance of `Bar`. From c6c6a857df244e5e83742bf2e020f2ca17f06eae Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 11 Jul 2025 12:03:00 +0000 Subject: [PATCH 85/96] Python: Add tests Also fixes an issue with the return type annotations that caused these to not work properly. Currently, annotated assignments don't work properly, due to the fact that our flow relation doesn't consider flow going to the "type" part of an annotated assignment. This means that in `x : Foo`, we do correctly note that `x` is annotated with `Foo`, but we have no idea what `Foo` is, since it has no incoming flow. To fix this we should probably just extend the flow relation, but this may need to be done with some care, so I have left it as future work. --- python/ql/lib/semmle/python/Exprs.qll | 4 +-- .../InlineCallGraphTest.expected | 6 ++++ .../InlineCallGraphTest.qlref | 1 + .../type_annotations.py | 33 +++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.expected create mode 100644 python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.qlref create mode 100644 python/ql/test/experimental/library-tests/CallGraph-type-annotations/type_annotations.py diff --git a/python/ql/lib/semmle/python/Exprs.qll b/python/ql/lib/semmle/python/Exprs.qll index 9e00e4f794b..a7f67b0b80e 100644 --- a/python/ql/lib/semmle/python/Exprs.qll +++ b/python/ql/lib/semmle/python/Exprs.qll @@ -769,8 +769,8 @@ class Annotation extends Expr { or result = any(Parameter p | p.getAnnotation() = this) or - exists(FunctionExpr f | - this = f.getReturns() and result = f.getInnerScope().getReturnNode().getNode() + exists(FunctionExpr f, Return r | + this = f.getReturns() and r.getScope() = f.getInnerScope() and result = r.getValue() ) } } diff --git a/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.expected b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.expected new file mode 100644 index 00000000000..a08ad78be2e --- /dev/null +++ b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.expected @@ -0,0 +1,6 @@ +testFailures +debug_callableNotUnique +pointsTo_found_typeTracker_notFound +typeTracker_found_pointsTo_notFound +| type_annotations.py:6:5:6:14 | ControlFlowNode for Attribute() | Foo.method | +| type_annotations.py:16:5:16:14 | ControlFlowNode for Attribute() | Foo.method | diff --git a/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.qlref b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.qlref new file mode 100644 index 00000000000..25117a4582b --- /dev/null +++ b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/InlineCallGraphTest.qlref @@ -0,0 +1 @@ +../CallGraph/InlineCallGraphTest.ql diff --git a/python/ql/test/experimental/library-tests/CallGraph-type-annotations/type_annotations.py b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/type_annotations.py new file mode 100644 index 00000000000..51c08d1675e --- /dev/null +++ b/python/ql/test/experimental/library-tests/CallGraph-type-annotations/type_annotations.py @@ -0,0 +1,33 @@ +class Foo: + def method(self): + pass + +def test_parameter_annotation(x: Foo): + x.method() #$ tt=Foo.method + +def test_no_parameter_annotation(x): + x.method() + +def function_with_return_annotation() -> Foo: + return eval("Foo()") + +def test_return_annotation(): + x = function_with_return_annotation() #$ pt,tt=function_with_return_annotation + x.method() #$ tt=Foo.method + +def function_without_return_annotation(): + return eval("Foo()") + +def test_no_return_annotation(): + x = function_without_return_annotation() #$ pt,tt=function_without_return_annotation + x.method() + +def test_variable_annotation(): + x = eval("Foo()") + x : Foo + # Currently fails because there is no flow from the class definition to the type annotation. + x.method() #$ MISSING: tt=Foo.method + +def test_no_variable_annotation(): + x = eval("Foo()") + x.method() From 655b3de6bb39ed195a13babd3ad55a26adddb062 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 11 Jul 2025 14:17:03 +0200 Subject: [PATCH 86/96] Rust: Remove `Resolvable.resolvesAsItem` Removes one more use of extractor-based resolution. --- rust/ql/.generated.list | 1 + rust/ql/.gitattributes | 1 + .../rust/elements/internal/ResolvableImpl.qll | 20 ++----------------- .../telemetry/RustAnalyzerComparison.qll | 14 +++++++++++-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 7461f8e0131..1d2b69ce32e 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -371,6 +371,7 @@ lib/codeql/rust/elements/internal/RefTypeReprConstructor.qll 8e7012b456ebf1cc7a2 lib/codeql/rust/elements/internal/RefTypeReprImpl.qll 553dd95e1a49ab7aef5db08e7bb550104c604ec33c9a3c7529370cd47c6a0965 8902db7c814f631c2a995df5911a7b13b6a38c524417e4bbbf2bda74ad53e14c lib/codeql/rust/elements/internal/RenameConstructor.qll 65fa2e938978d154701e6cac05b56320b176ee014ef5c20a7b66f3e94fd5c4a7 dfc0ff4606b8e1c14003cc93a0811f4d62ec993b07ff3c1aa0776746577ed103 lib/codeql/rust/elements/internal/RenameImpl.qll 61c681055f1f86402af0772539f702e9e19a123f8cfcfca225535c3a1a4cb1d7 1aa1c78616c4b54a31c8af74de141aef9e5ada53f3859df631ecb4238faabdbf +lib/codeql/rust/elements/internal/ResolvableImpl.qll 7d6d02eceef54d588de6204abbcf7a6454916e49180e3db8a72131032cec5837 9c3a28ea0d293b449c69982e3695903a10510096e765a53c1b34ac3ad009a9f4 lib/codeql/rust/elements/internal/RestPatConstructor.qll 45430925ddf08fba70ede44c7f413ddb41b3113c149b7efc276e0c2bf72507b4 25c678898d72446e7a975bb8b7f2fde51e55b59dbd42f2cca997c833b1a995f1 lib/codeql/rust/elements/internal/RetTypeReprConstructor.qll 6dcb56c92a13f5ca2c9a8344bc05638cc611543896c578cd6ca185054f155537 3fe34953ba397dc31533bd28b48df76693e86b51c4a89c26ad4dfdbd816a0874 lib/codeql/rust/elements/internal/RetTypeReprImpl.qll 799e55ffcf27bf6f010419e1d61ebbbf3448e37b903b0f13984d0b44d6b7a999 be774bb09d121c35f40c75d5bee08918e7a6b5fccb4fd573fc55a650466b46e0 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index b083b6e6ab5..43819916ce0 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -373,6 +373,7 @@ /lib/codeql/rust/elements/internal/RefTypeReprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/RenameConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/RenameImpl.qll linguist-generated +/lib/codeql/rust/elements/internal/ResolvableImpl.qll linguist-generated /lib/codeql/rust/elements/internal/RestPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/RetTypeReprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/RetTypeReprImpl.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll index 86304cd23de..893708164d8 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ResolvableImpl.qll @@ -1,3 +1,4 @@ +// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `Resolvable`. * @@ -11,25 +12,8 @@ private import codeql.rust.elements.internal.generated.Resolvable * be referenced directly. */ module Impl { - private import codeql.rust.elements.internal.ItemImpl::Impl - - // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * One of `PathExpr`, `RecordExpr`, `PathPat`, `RecordPat`, `TupleStructPat` or `MethodCallExpr`. */ - class Resolvable extends Generated::Resolvable { - /** - * Holds if this resolvable and the item `i` resolves to the same canonical - * path in the same crate - */ - pragma[nomagic] - predicate resolvesAsItem(Item i) { - this.getResolvedPath() = i.getExtendedCanonicalPath() and - ( - this.getResolvedCrateOrigin() = i.getCrateOrigin() - or - not this.hasResolvedCrateOrigin() and not i.hasCrateOrigin() - ) - } - } + class Resolvable extends Generated::Resolvable { } } diff --git a/rust/ql/src/queries/telemetry/RustAnalyzerComparison.qll b/rust/ql/src/queries/telemetry/RustAnalyzerComparison.qll index e68306a3cf9..65acc978eee 100644 --- a/rust/ql/src/queries/telemetry/RustAnalyzerComparison.qll +++ b/rust/ql/src/queries/telemetry/RustAnalyzerComparison.qll @@ -7,6 +7,16 @@ import rust +pragma[nomagic] +private predicate resolvesAsItem(Resolvable r, Item i) { + r.getResolvedPath() = i.getExtendedCanonicalPath() and + ( + r.getResolvedCrateOrigin() = i.getCrateOrigin() + or + not r.hasResolvedCrateOrigin() and not i.hasCrateOrigin() + ) +} + private signature module ResolvableSig { class Source { string toString(); @@ -94,7 +104,7 @@ private module PathResolution implements ResolvableSig { private module RustAnalyzerPathResolution implements CompareSig { predicate isResolvable(PathResolution::Source s) { s.hasResolvedPath() } - Item resolve(PathResolution::Source s) { s.resolvesAsItem(result) } + Item resolve(PathResolution::Source s) { resolvesAsItem(s, result) } } private module QlPathResolution implements CompareSig { @@ -133,7 +143,7 @@ private module RustAnalyzerCallGraph implements CompareSig { CallExprBaseImpl::getCallResolvable(c).hasResolvedPath() } - Item resolve(CallExprBase c) { CallExprBaseImpl::getCallResolvable(c).resolvesAsItem(result) } + Item resolve(CallExprBase c) { resolvesAsItem(CallExprBaseImpl::getCallResolvable(c), result) } } private module QlCallGraph implements CompareSig { From 053a749e1437c406b92d0a365386afac1f976bb0 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Jul 2025 13:43:01 +0100 Subject: [PATCH 87/96] C++: Add change note. --- cpp/ql/src/change-notes/2025-07-11-function-objects.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/src/change-notes/2025-07-11-function-objects.md diff --git a/cpp/ql/src/change-notes/2025-07-11-function-objects.md b/cpp/ql/src/change-notes/2025-07-11-function-objects.md new file mode 100644 index 00000000000..48bc71f27ca --- /dev/null +++ b/cpp/ql/src/change-notes/2025-07-11-function-objects.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Improved support for dataflow through function objects and lambda expressions. \ No newline at end of file From 32e7a9d445cbbfdca13b47c0e89b52053a1f5f18 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Jul 2025 11:14:23 +0200 Subject: [PATCH 88/96] Rust: type inference: more pattern matching tests Thanks to co-pilot for generating the examples --- .../test/library-tests/type-inference/main.rs | 148 +- .../library-tests/type-inference/options.yml | 1 + .../type-inference/pattern_matching.rs | 833 ++++++++ .../type-inference/type-inference.expected | 1677 ++++++++++++++--- 4 files changed, 2222 insertions(+), 437 deletions(-) create mode 100644 rust/ql/test/library-tests/type-inference/options.yml create mode 100755 rust/ql/test/library-tests/type-inference/pattern_matching.rs diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 68085609aab..bdce6f53326 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -1,7 +1,7 @@ +#![feature(box_patterns)] mod field_access { #[derive(Debug)] struct S; - #[derive(Debug)] struct MyThing { a: S, @@ -2351,139 +2351,30 @@ mod tuples { } } -pub mod pattern_matching { - struct MyRecordStruct { - value1: T1, - value2: T2, - } +pub mod pattern_matching; +pub mod pattern_matching_experimental { + pub fn box_patterns() { + let boxed_value = Box::new(100i32); // $ method=new - struct MyTupleStruct(T1, T2); - - enum MyEnum { - Variant1 { value1: T1, value2: T2 }, - Variant2(T2, T1), - } - - pub fn f() -> Option<()> { - let value = Some(42); - if let Some(mesg) = value { - let mesg = mesg; // $ type=mesg:i32 - println!("{mesg}"); - } - match value { - Some(mesg) => { - let mesg = mesg; // $ type=mesg:i32 - println!("{mesg}"); + // BoxPat - Box patterns (requires feature flag) + match boxed_value { + box 100 => { + println!("Boxed 100"); } - None => (), - }; - let mesg = value.unwrap(); // $ method=unwrap - let mesg = mesg; // $ type=mesg:i32 - println!("{mesg}"); - let mesg = value?; // $ type=mesg:i32 - println!("{mesg}"); - - let value2 = &Some(42); - if let &Some(mesg) = value2 { - let mesg = mesg; // $ type=mesg:i32 - println!("{mesg}"); - } - - let value3 = 42; - if let ref mesg = value3 { - let mesg = mesg; // $ type=mesg:&T.i32 - println!("{mesg}"); - } - - let value4 = Some(42); - if let Some(ref mesg) = value4 { - let mesg = mesg; // $ type=mesg:&T.i32 - println!("{mesg}"); - } - - let ref value5 = 42; - let x = value5; // $ type=x:&T.i32 - - let my_record_struct = MyRecordStruct { - value1: 42, - value2: false, - }; - if let MyRecordStruct { value1, value2 } = my_record_struct { - let x = value1; // $ type=x:i32 - let y = value2; // $ type=y:bool - (); - } - - let my_tuple_struct = MyTupleStruct(42, false); - if let MyTupleStruct(value1, value2) = my_tuple_struct { - let x = value1; // $ type=x:i32 - let y = value2; // $ type=y:bool - (); - } - - let my_enum1 = MyEnum::Variant1 { - value1: 42, - value2: false, - }; - match my_enum1 { - MyEnum::Variant1 { value1, value2 } => { - let x = value1; // $ type=x:i32 - let y = value2; // $ type=y:bool - (); - } - MyEnum::Variant2(value1, value2) => { - let x = value1; // $ type=x:bool - let y = value2; // $ type=y:i32 - (); + box x => { + let unboxed = x; // $ MISSING: type=unboxed:i32 + println!("Boxed value: {}", unboxed); } } - let my_nested_enum = MyEnum::Variant2( - false, - MyRecordStruct { - value1: 42, - value2: "string", - }, - ); - - match my_nested_enum { - MyEnum::Variant2( - value1, - MyRecordStruct { - value1: x, - value2: y, - }, - ) => { - let a = value1; // $ type=a:bool - let b = x; // $ type=b:i32 - let c = y; // $ type=c:&T.str - (); + // Nested box pattern + let nested_box = Box::new(Box::new(42i32)); // $ method=new + match nested_box { + box box x => { + let nested_unboxed = x; // $ MISSING: type=nested_unboxed:i32 + println!("Nested boxed: {}", nested_unboxed); } - _ => (), } - - let opt1 = Some(Default::default()); // $ type=opt1:T.i32 method=default - #[rustfmt::skip] - let _ = if let Some::(x) = opt1 - { - x; // $ type=x:i32 - }; - - let opt2 = Some(Default::default()); // $ type=opt2:T.i32 method=default - #[rustfmt::skip] - let _ = if let Option::Some::(x) = opt2 - { - x; // $ type=x:i32 - }; - - let opt3 = Some(Default::default()); // $ type=opt3:T.i32 method=default - #[rustfmt::skip] - let _ = if let Option::::Some(x) = opt3 - { - x; // $ type=x:i32 - }; - - None } } @@ -2515,5 +2406,6 @@ fn main() { method_determined_by_argument_type::f(); // $ method=f tuples::f(); // $ method=f dereference::test(); // $ method=test - pattern_matching::f(); // $ method=f + pattern_matching::test_all_patterns(); // $ method=test_all_patterns + pattern_matching_experimental::box_patterns(); // $ method=box_patterns } diff --git a/rust/ql/test/library-tests/type-inference/options.yml b/rust/ql/test/library-tests/type-inference/options.yml new file mode 100644 index 00000000000..a394083e521 --- /dev/null +++ b/rust/ql/test/library-tests/type-inference/options.yml @@ -0,0 +1 @@ +qltest_use_nightly: true diff --git a/rust/ql/test/library-tests/type-inference/pattern_matching.rs b/rust/ql/test/library-tests/type-inference/pattern_matching.rs new file mode 100755 index 00000000000..6f205439f8d --- /dev/null +++ b/rust/ql/test/library-tests/type-inference/pattern_matching.rs @@ -0,0 +1,833 @@ +struct MyRecordStruct { + value1: T1, + value2: T2, +} + +struct MyTupleStruct(T1, T2); + +enum MyEnum { + Variant1 { value1: T1, value2: T2 }, + Variant2(T2, T1), +} + +pub fn f() -> Option<()> { + let value = Some(42); + if let Some(mesg) = value { + let mesg = mesg; // $ type=mesg:i32 + println!("{mesg}"); + } + match value { + Some(mesg) => { + let mesg = mesg; // $ type=mesg:i32 + println!("{mesg}"); + } + None => (), + }; + let mesg = value.unwrap(); // $ method=unwrap + let mesg = mesg; // $ type=mesg:i32 + println!("{mesg}"); + let mesg = value?; // $ type=mesg:i32 + println!("{mesg}"); + + let value2 = &Some(42); + if let &Some(mesg) = value2 { + let mesg = mesg; // $ type=mesg:i32 + println!("{mesg}"); + } + + let value3 = 42; + if let ref mesg = value3 { + let mesg = mesg; // $ type=mesg:&T.i32 + println!("{mesg}"); + } + + let value4 = Some(42); + if let Some(ref mesg) = value4 { + let mesg = mesg; // $ type=mesg:&T.i32 + println!("{mesg}"); + } + + let ref value5 = 42; + let x = value5; // $ type=x:&T.i32 + + let my_record_struct = MyRecordStruct { + value1: 42, + value2: false, + }; + if let MyRecordStruct { value1, value2 } = my_record_struct { + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool + (); + } + + let my_tuple_struct = MyTupleStruct(42, false); + if let MyTupleStruct(value1, value2) = my_tuple_struct { + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool + (); + } + + let my_enum1 = MyEnum::Variant1 { + value1: 42, + value2: false, + }; + match my_enum1 { + MyEnum::Variant1 { value1, value2 } => { + let x = value1; // $ type=x:i32 + let y = value2; // $ type=y:bool + (); + } + MyEnum::Variant2(value1, value2) => { + let x = value1; // $ type=x:bool + let y = value2; // $ type=y:i32 + (); + } + } + + let my_nested_enum = MyEnum::Variant2( + false, + MyRecordStruct { + value1: 42, + value2: "string", + }, + ); + + match my_nested_enum { + MyEnum::Variant2( + value1, + MyRecordStruct { + value1: x, + value2: y, + }, + ) => { + let a = value1; // $ type=a:bool + let b = x; // $ type=b:i32 + let c = y; // $ type=c:&T.str + (); + } + _ => (), + } + + let opt1 = Some(Default::default()); // $ type=opt1:T.i32 method=default + #[rustfmt::skip] + let _ = if let Some::(x) = opt1 + { + x; // $ type=x:i32 + }; + + let opt2 = Some(Default::default()); // $ type=opt2:T.i32 method=default + #[rustfmt::skip] + let _ = if let Option::Some::(x) = opt2 + { + x; // $ type=x:i32 + }; + + let opt3 = Some(Default::default()); // $ type=opt3:T.i32 method=default + #[rustfmt::skip] + let _ = if let Option::::Some(x) = opt3 + { + x; // $ type=x:i32 + }; + + None +} + +// Struct and enum definitions for examples +#[derive(Debug)] +struct Point { + x: i32, + y: i32, +} + +#[derive(Debug, Clone, Copy)] +struct Color(u8, u8, u8); + +#[derive(Debug)] +enum Shape { + Circle(f64), + Rectangle { width: f64, height: f64 }, + Triangle(Point, Point, Point), +} + +#[derive(Debug)] +enum MyOption { + Some(T), + None, +} + +// Macro for pattern examples +macro_rules! my_pattern { + ($x:pat) => { + match 42i32 { + $x => println!("Matched macro pattern"), + _ => println!("No match"), + } + }; +} + +pub fn literal_patterns() { + let value = 42i32; + + match value { + // LiteralPat - Literal patterns (including negative literals) + 42 => { + let literal_match = value; // $ type=literal_match:i32 + println!("Literal pattern: {}", literal_match); + } + -1 => { + let negative_literal = value; // $ type=negative_literal:i32 + println!("Negative literal: {}", negative_literal); + } + 0 => { + let zero_literal = value; // $ type=zero_literal:i32 + println!("Zero literal: {}", zero_literal); + } + _ => {} + } + + let float_val = 3.14f64; + match float_val { + 3.14 => { + let pi_match = float_val; // $ type=pi_match:f64 + println!("Pi matched: {}", pi_match); + } + _ => {} + } + + let string_val = "hello"; + match string_val { + "hello" => { + let hello_match = string_val; // $ type=hello_match:&T.str + println!("String literal: {}", hello_match); + } + _ => {} + } + + let bool_val = true; + match bool_val { + true => { + let true_match = bool_val; // $ type=true_match:bool + println!("True literal: {}", true_match); + } + false => { + let false_match = bool_val; // $ type=false_match:bool + println!("False literal: {}", false_match); + } + } +} + +pub fn identifier_patterns() { + let value = 42i32; + + // IdentPat - Simple identifier pattern + match value { + x => { + let bound_value = x; // $ type=bound_value:i32 + println!("Identifier pattern: {}", bound_value); + } + } + + // IdentPat with ref + match &value { + ref x => { + let ref_bound = x; // $ type=ref_bound:&T.&T.i32 + println!("Reference identifier: {:?}", ref_bound); + } + } + + // IdentPat with mut + let mut mutable_value = 10i32; + match mutable_value { + mut x => { + let mut_bound = x; // $ type=mut_bound:i32 + x += 1; // $ method=add_assign + println!("Mutable identifier: {}", mut_bound); + } + } + + // IdentPat with @ pattern (subpattern binding) + let option_value = MyOption::Some(42i32); + match option_value { + MyOption::Some(x @ 42) => { + let at_bound = x; // $ type=at_bound:i32 + println!("@ pattern with literal: {}", at_bound); + } + MyOption::Some(x @ 1..=100) => { + let range_at_bound = x; // $ type=range_at_bound:i32 + println!("@ pattern with range: {}", range_at_bound); + } + MyOption::Some(x) => { + let some_bound = x; // $ type=some_bound:i32 + println!("Some value: {}", some_bound); + } + MyOption::None => { + println!("None value"); + } + } + + // IdentPat with ref mut + let mut ref_mut_val = 5i32; + match &mut ref_mut_val { + ref mut x => { + let ref_mut_bound = x; // $ type=ref_mut_bound:&T.&T.i32 + **ref_mut_bound += 1; // $ method=deref method=add_assign + println!("Ref mut pattern"); + } + } +} + +pub fn wildcard_patterns() { + let value = 42i32; + + match value { + 42 => println!("Specific match"), + // WildcardPat - Wildcard pattern + _ => { + let wildcard_context = value; // $ type=wildcard_context:i32 + println!("Wildcard pattern for: {}", wildcard_context); + } + } +} + +pub fn range_patterns() { + let value = 42i32; + + match value { + // RangePat - Range patterns + 1..=10 => { + let range_inclusive = value; // $ type=range_inclusive:i32 + println!("Range inclusive: {}", range_inclusive); + } + 11.. => { + let range_from = value; // $ type=range_from:i32 + println!("Range from 11: {}", range_from); + } + ..=0 => { + let range_to_inclusive = value; // $ type=range_to_inclusive:i32 + println!("Range to 0 inclusive: {}", range_to_inclusive); + } + _ => {} + } + + let char_val = 'c'; + match char_val { + 'a'..='z' => { + let lowercase_char = char_val; // $ type=lowercase_char:char + println!("Lowercase char: {}", lowercase_char); + } + 'A'..='Z' => { + let uppercase_char = char_val; // $ type=uppercase_char:char + println!("Uppercase char: {}", uppercase_char); + } + _ => {} + } +} + +pub fn reference_patterns() { + let value = 42i32; + let mut mutable_value = 10i32; + + // RefPat - Reference patterns + match &value { + &42 => { + let deref_match = value; // $ type=deref_match:i32 + println!("Dereferenced match: {}", deref_match); + } + &x => { + let deref_bound = x; // $ type=deref_bound:i32 + println!("Dereferenced binding: {}", deref_bound); + } + } + + match &mut mutable_value { + &mut ref x => { + let mut_ref_bound = x; // $ type=mut_ref_bound:&T.i32 + println!("Mutable ref pattern: {}", mut_ref_bound); + } + } + + match &value { + ref x => { + let ref_pattern = x; // $ type=ref_pattern:&T.&T.i32 + println!("Reference pattern: {}", ref_pattern); + } + } +} + +pub fn record_patterns() { + let point = Point { x: 10, y: 20 }; + + // RecordPat - Record (struct) patterns + match point { + Point { x: 0, y: 0 } => { + let origin = point; // $ type=origin:Point + println!("Origin point: {:?}", origin); + } + Point { x, y: 0 } => { + let x_axis_x = x; // $ type=x_axis_x:i32 + let x_axis_point = point; // $ type=x_axis_point:Point + println!("Point on x-axis: x={}, point={:?}", x_axis_x, x_axis_point); + } + Point { x: 10, .. } => { + let ten_x_point = point; // $ type=ten_x_point:Point + println!("Point with x=10: {:?}", ten_x_point); + } + Point { x, y } => { + let general_x = x; // $ type=general_x:i32 + let general_y = y; // $ type=general_y:i32 + println!("General point: ({}, {})", general_x, general_y); + } + } + + // Nested record patterns + let shape = Shape::Rectangle { + width: 10.0, + height: 20.0, + }; + match shape { + Shape::Rectangle { + width: w, + height: h, + } => { + let rect_width = w; // $ type=rect_width:f64 + let rect_height = h; // $ type=rect_height:f64 + println!("Rectangle: {}x{}", rect_width, rect_height); + } + _ => {} + } +} + +pub fn tuple_struct_patterns() { + let color = Color(255, 128, 0); + + // TupleStructPat - Tuple struct patterns + match color { + Color(255, 0, 0) => { + let red_color = color; // $ type=red_color:Color + println!("Pure red: {:?}", red_color); + } + Color(r, g, b) => { + let red_component = r; // $ type=red_component:u8 + let green_component = g; // $ type=green_component:u8 + let blue_component = b; // $ type=blue_component:u8 + println!( + "Color: ({}, {}, {})", + red_component, green_component, blue_component + ); + } + } + + // With rest pattern + match color { + Color(255, ..) => { + let reddish_color = color; // $ type=reddish_color:Color + println!("Reddish color: {:?}", reddish_color); + } + Color(r, ..) => { + let any_red = r; // $ type=any_red:u8 + println!("Any color with red: {}", any_red); + } + } + + // Single element tuple struct + struct Wrapper(i32); + let wrapper = Wrapper(42); + match wrapper { + Wrapper(x) => { + let wrapped_value = x; // $ type=wrapped_value:i32 + println!("Wrapped: {}", wrapped_value); + } + } +} + +pub fn tuple_patterns() { + let tuple = (1i32, 2i64, 3.0f32); + + // TuplePat - Tuple patterns + match tuple { + (1, 2, 3.0) => { + let exact_tuple = tuple; // $ MISSING: type=exact_tuple:? + println!("Exact tuple: {:?}", exact_tuple); + } + (a, b, c) => { + let first_elem = a; // $ MISSING: type=first_elem:i32 + let second_elem = b; // $ MISSING: type=second_elem:i64 + let third_elem = c; // $ MISSING: type=third_elem:f32 + println!("Tuple: ({}, {}, {})", first_elem, second_elem, third_elem); + } + } + + // With rest pattern + match tuple { + (first, ..) => { + let tuple_first = first; // $ MISSING: type=tuple_first:i32 + println!("First element: {}", tuple_first); + } + } + + // Empty tuple + let unit = (); + match unit { + () => { + let unit_value = unit; // $ MISSING: type=unit_value:? + println!("Unit value: {:?}", unit_value); + } + } + + // Single element tuple (needs comma) + let single = (42i32,); + match single { + (x,) => { + let single_elem = x; // $ MISSING: type=single_elem:i32 + println!("Single element tuple: {}", single_elem); + } + } +} + +pub fn parenthesized_patterns() { + let value = 42i32; + + // ParenPat - Parenthesized patterns + match value { + (x) => { + let paren_bound = x; // $ type=paren_bound:i32 + println!("Parenthesized pattern: {}", paren_bound); + } + } + + // More complex parenthesized pattern + let tuple = (1i32, 2i32); + match tuple { + (x, (y)) => { + let paren_x = x; // $ MISSING: type=paren_x:i32 + let paren_y = y; // $ MISSING: type=paren_y:i32 + println!("Parenthesized in tuple: {}, {}", paren_x, paren_y); + } + } +} + +pub fn slice_patterns() { + let slice: &[i32] = &[1, 2, 3, 4, 5]; + + // SlicePat - Slice patterns + match slice { + [] => { + let empty_slice = slice; // $ type=empty_slice:&T.[T].i32 + println!("Empty slice: {:?}", empty_slice); + } + [x] => { + let single_elem = *x; // $ MISSING: type=single_elem:i32 + println!("Single element: {}", single_elem); + } + [first, second] => { + let slice_first = *first; // $ MISSING: type=slice_first:i32 + let slice_second = *second; // $ MISSING: type=slice_second:i32 + println!("Two elements: {}, {}", slice_first, slice_second); + } + [first, middle @ .., last] => { + let slice_start = *first; // $ MISSING: type=slice_start:i32 + let slice_end = *last; // $ MISSING: type=slice_end:i32 + let slice_middle = middle; // $ MISSING: type=slice_middle:&T.[T].i32 + println!( + "First: {}, last: {}, middle len: {}", + slice_start, + slice_end, + slice_middle.len() + ); + } + } + + // Array patterns + let array = [1i32, 2, 3]; + match array { + [a, b, c] => { + let arr_a = a; // $ MISSING: type=arr_a:i32 + let arr_b = b; // $ MISSING: type=arr_b:i32 + let arr_c = c; // $ MISSING: type=arr_c:i32 + println!("Array elements: {}, {}, {}", arr_a, arr_b, arr_c); + } + } +} + +pub fn path_patterns() { + // PathPat - Path patterns (for enums, constants, etc.) + const CONSTANT: i32 = 42; + let value = 42i32; + + match value { + CONSTANT => { + let const_match = value; // $ type=const_match:i32 + println!("Matches constant: {}", const_match); + } + _ => {} + } + + // Enum variants as path patterns + let option = MyOption::Some(10i32); + match option { + MyOption::None => { + println!("None variant"); + } + MyOption::Some(x) => { + let some_value = x; // $ type=some_value:i32 + println!("Some value: {}", some_value); + } + } + + // Module path patterns + match std::result::Result::Ok::(42) { + std::result::Result::Ok(x) => { + let ok_value = x; // $ type=ok_value:i32 + println!("Ok value: {}", ok_value); + } + std::result::Result::Err(e) => { + let err_value = e; // $ type=err_value:usize + println!("Error: {}", err_value); + } + } +} + +pub fn or_patterns() { + let value = 42i32; + + // OrPat - Or patterns + match value { + 1 | 2 | 3 => { + let small_num = value; // $ type=small_num:i32 + println!("Small number: {}", small_num); + } + 10 | 20 => { + let round_num = value; // $ type=round_num:i32 + println!("Round number: {}", round_num); + } + _ => {} + } + + // Complex or pattern with structs + let point = Point { x: 0, y: 5 }; + match point { + Point { x: x @ 0, y } | Point { x, y: y @ 0 } => { + let axis_x = x; // $ type=axis_x:i32 + let axis_y = y; // $ type=axis_y:i32 + println!("Point on axis: ({}, {})", axis_x, axis_y); + } + _ => {} + } + + // Or pattern with ranges + match value { + 1..=10 | 90..=100 => { + let range_or_value = value; // $ type=range_or_value:i32 + println!("In range: {}", range_or_value); + } + _ => {} + } +} + +pub fn rest_patterns() { + let tuple = (1i32, 2i64, 3.0f32, 4u8); + + // RestPat - Rest patterns (..) + match tuple { + (first, ..) => { + let rest_first = first; // $ MISSING: type=rest_first:i32 + println!("First with rest: {}", rest_first); + } + } + + match tuple { + (.., last) => { + let rest_last = last; // $ MISSING: type=rest_last:u8 + println!("Last with rest: {}", rest_last); + } + } + + match tuple { + (first, .., last) => { + let rest_start = first; // $ MISSING: type=rest_start:i32 + let rest_end = last; // $ MISSING: type=rest_end:u8 + println!("First and last: {}, {}", rest_start, rest_end); + } + } + + // Rest in struct + let point = Point { x: 10, y: 20 }; + match point { + Point { x, .. } => { + let rest_x = x; // $ type=rest_x:i32 + println!("X coordinate: {}", rest_x); + } + } +} + +pub fn macro_patterns() { + // MacroPat - Macro patterns + my_pattern!(42); + my_pattern!(x); + + // More complex macro pattern + macro_rules! match_and_bind { + ($val:expr, $pat:pat) => { + match $val { + $pat => { + let macro_bound = $val; // $ type=macro_bound:i32 + println!("Macro pattern matched: {}", macro_bound); + } + _ => {} + } + }; + } + + match_and_bind!(42i32, 42); + match_and_bind!(10i32, x); +} + +pub fn complex_nested_patterns() { + // Complex nested patterns combining multiple pattern types + let complex_data = (Point { x: 1, y: 2 }, MyOption::Some(Color(255, 0, 0))); + + match complex_data { + // Combining TuplePat, RecordPat, PathPat, TupleStructPat + (Point { x: 1, y }, MyOption::Some(Color(255, g, b))) => { + let nested_y = y; // $ type=nested_y:i32 + let nested_g = g; // $ type=nested_g:u8 + let nested_b = b; // $ type=nested_b:u8 + println!( + "Complex nested: y={}, green={}, blue={}", + nested_y, nested_g, nested_b + ); + } + // Or pattern with tuple and wildcard + (Point { x, .. }, MyOption::None) | (Point { x: x@0, .. }, _) => { + let alt_complex_x = x; // $ type=alt_complex_x:i32 + println!("Alternative complex: x={:?}", alt_complex_x); + } + // Catch-all with identifier pattern + other => { + let other_complex = other; // $ MISSING: type=other_complex:? + println!("Other complex data: {:?}", other_complex); + } + } +} + +pub fn patterns_in_let_statements() { + // Patterns in let statements + let point = Point { x: 10, y: 20 }; + let Point { x, y } = point; // RecordPat in let + let let_x = x; // $ type=let_x:i32 + let let_y = y; // $ type=let_y:i32 + + let tuple = (1i32, 2i64, 3.0f32); + let (a, b, c) = tuple; // TuplePat in let + let let_a = a; // $ MISSING: type=let_a:i32 + let let_b = b; // $ MISSING: type=let_b:i64 + let let_c = c; // $ MISSING: type=let_c:f32 + + let array = [1i32, 2, 3, 4, 5]; + let [first, .., last] = array; // SlicePat in let + let let_first = first; // $ MISSING: type=let_first:i32 + let let_last = last; // $ MISSING: type=let_last:i32 + + let color = Color(255, 128, 0); + let Color(r, g, b) = color; // TupleStructPat in let + let let_r = r; // $ type=let_r:u8 + let let_g = g; // $ type=let_g:u8 + let let_b = b; // $ type=let_b:u8 + + // Let with reference pattern + let value = 42i32; + let ref ref_val = value; + let let_ref = ref_val; // $ type=let_ref:&T.i32 + + // Let with mutable pattern + let mut mut_val = 10i32; + let let_mut = mut_val; // $ type=let_mut:i32 +} + +pub fn patterns_in_function_parameters() { + // Patterns in function parameters + + fn extract_point(Point { x, y }: Point) -> (i32, i32) { + let param_x = x; // $ type=param_x:i32 + let param_y = y; // $ type=param_y:i32 + (param_x, param_y) + } + + fn extract_color(Color(r, _, _): Color) -> u8 { + let param_r = r; // $ type=param_r:u8 + param_r + } + + fn extract_tuple((first, _, third): (i32, f64, bool)) -> (i32, bool) { + let param_first = first; // $ MISSING: type=param_first:i32 + let param_third = third; // $ MISSING: type=param_third:bool + (param_first, param_third) + } + + // Call the functions to use them + let point = Point { x: 5, y: 10 }; + let extracted = extract_point(point); // $ method=extract_point MISSING: type=extracted:? + + let color = Color(200, 100, 50); + let red = extract_color(color); // $ method=extract_color type=red:u8 + + let tuple = (42i32, 3.14f64, true); + let tuple_extracted = extract_tuple(tuple); // $ method=extract_tuple MISSING: type=tuple_extracted:? +} + +pub fn patterns_in_control_flow() { + // Patterns in for loops + let points = vec![Point { x: 1, y: 2 }, Point { x: 3, y: 4 }]; + for Point { x, y } in points { + let loop_x = x; // $ type=loop_x:i32 + let loop_y = y; // $ type=loop_y:i32 + println!("Point in loop: ({}, {})", loop_x, loop_y); + } + + // Patterns in if let + let option_value = MyOption::Some(42i32); + if let MyOption::Some(x @ 42) = option_value { + let if_let_x = x; // $ type=if_let_x:i32 + println!("If let with @ pattern: {}", if_let_x); + } + + // Patterns in while let + let mut stack: Vec = vec![1i32, 2, 3]; + while let Some(x) = stack.pop() { // $ method=pop + let while_let_x = x; // $ type=while_let_x:i32 + println!("Popped: {}", while_let_x); + } + + // Patterns in match guards + let value = 42i32; + match value { + x if x > 0 => { // $ method=gt + let guard_x = x; // $ type=guard_x:i32 + println!("Positive: {}", guard_x); + } + _ => {} + } +} + +pub fn test_all_patterns() { + f(); // $ method=f + literal_patterns(); // $ method=literal_patterns + identifier_patterns(); // $ method=identifier_patterns + wildcard_patterns(); // $ method=wildcard_patterns + range_patterns(); // $ method=range_patterns + reference_patterns(); // $ method=reference_patterns + record_patterns(); // $ method=record_patterns + tuple_struct_patterns(); // $ method=tuple_struct_patterns + tuple_patterns(); // $ method=tuple_patterns + parenthesized_patterns(); // $ method=parenthesized_patterns + slice_patterns(); // $ method=slice_patterns + path_patterns(); // $ method=path_patterns + or_patterns(); // $ method=or_patterns + rest_patterns(); // $ method=rest_patterns + macro_patterns(); // $ method=macro_patterns + complex_nested_patterns(); // $ method=complex_nested_patterns + patterns_in_let_statements(); // $ method=patterns_in_let_statements + patterns_in_function_parameters(); // $ method=patterns_in_function_parameters + patterns_in_control_flow(); // $ method=patterns_in_control_flow +} + diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index b8431097bc3..d6b21fe08b7 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -161,13 +161,13 @@ inferType | loop/main.rs:12:9:12:12 | self | | loop/main.rs:10:1:14:1 | Self [trait T2] | | main.rs:26:13:26:13 | x | | main.rs:5:5:8:5 | MyThing | | main.rs:26:17:26:32 | MyThing {...} | | main.rs:5:5:8:5 | MyThing | -| main.rs:26:30:26:30 | S | | main.rs:2:5:3:13 | S | +| main.rs:26:30:26:30 | S | | main.rs:3:5:4:13 | S | | main.rs:27:18:27:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:27:18:27:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:27:18:27:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:27:18:27:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:27:26:27:26 | x | | main.rs:5:5:8:5 | MyThing | -| main.rs:27:26:27:28 | x.a | | main.rs:2:5:3:13 | S | +| main.rs:27:26:27:28 | x.a | | main.rs:3:5:4:13 | S | | main.rs:30:29:30:29 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:30:29:30:29 | x | A | {EXTERNAL LOCATION} | bool | | main.rs:31:13:31:13 | a | | {EXTERNAL LOCATION} | bool | @@ -180,78 +180,78 @@ inferType | main.rs:32:18:32:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:32:26:32:26 | a | | {EXTERNAL LOCATION} | bool | | main.rs:37:13:37:13 | x | | main.rs:16:5:19:5 | GenericThing | -| main.rs:37:13:37:13 | x | A | main.rs:2:5:3:13 | S | +| main.rs:37:13:37:13 | x | A | main.rs:3:5:4:13 | S | | main.rs:37:17:37:42 | GenericThing::<...> {...} | | main.rs:16:5:19:5 | GenericThing | -| main.rs:37:17:37:42 | GenericThing::<...> {...} | A | main.rs:2:5:3:13 | S | -| main.rs:37:40:37:40 | S | | main.rs:2:5:3:13 | S | +| main.rs:37:17:37:42 | GenericThing::<...> {...} | A | main.rs:3:5:4:13 | S | +| main.rs:37:40:37:40 | S | | main.rs:3:5:4:13 | S | | main.rs:38:18:38:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:38:18:38:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:38:18:38:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:38:18:38:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:38:26:38:26 | x | | main.rs:16:5:19:5 | GenericThing | -| main.rs:38:26:38:26 | x | A | main.rs:2:5:3:13 | S | -| main.rs:38:26:38:28 | x.a | | main.rs:2:5:3:13 | S | +| main.rs:38:26:38:26 | x | A | main.rs:3:5:4:13 | S | +| main.rs:38:26:38:28 | x.a | | main.rs:3:5:4:13 | S | | main.rs:41:13:41:13 | y | | main.rs:16:5:19:5 | GenericThing | -| main.rs:41:13:41:13 | y | A | main.rs:2:5:3:13 | S | +| main.rs:41:13:41:13 | y | A | main.rs:3:5:4:13 | S | | main.rs:41:17:41:37 | GenericThing {...} | | main.rs:16:5:19:5 | GenericThing | -| main.rs:41:17:41:37 | GenericThing {...} | A | main.rs:2:5:3:13 | S | -| main.rs:41:35:41:35 | S | | main.rs:2:5:3:13 | S | +| main.rs:41:17:41:37 | GenericThing {...} | A | main.rs:3:5:4:13 | S | +| main.rs:41:35:41:35 | S | | main.rs:3:5:4:13 | S | | main.rs:42:18:42:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:42:18:42:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:42:18:42:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:42:18:42:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:42:26:42:26 | x | | main.rs:16:5:19:5 | GenericThing | -| main.rs:42:26:42:26 | x | A | main.rs:2:5:3:13 | S | -| main.rs:42:26:42:28 | x.a | | main.rs:2:5:3:13 | S | +| main.rs:42:26:42:26 | x | A | main.rs:3:5:4:13 | S | +| main.rs:42:26:42:28 | x.a | | main.rs:3:5:4:13 | S | | main.rs:46:13:46:13 | x | | main.rs:21:5:23:5 | OptionS | | main.rs:46:17:48:9 | OptionS {...} | | main.rs:21:5:23:5 | OptionS | | main.rs:47:16:47:33 | ...::MyNone(...) | | main.rs:10:5:14:5 | MyOption | -| main.rs:47:16:47:33 | ...::MyNone(...) | T | main.rs:2:5:3:13 | S | +| main.rs:47:16:47:33 | ...::MyNone(...) | T | main.rs:3:5:4:13 | S | | main.rs:49:18:49:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:49:18:49:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:49:18:49:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:49:18:49:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:49:26:49:26 | x | | main.rs:21:5:23:5 | OptionS | | main.rs:49:26:49:28 | x.a | | main.rs:10:5:14:5 | MyOption | -| main.rs:49:26:49:28 | x.a | T | main.rs:2:5:3:13 | S | +| main.rs:49:26:49:28 | x.a | T | main.rs:3:5:4:13 | S | | main.rs:52:13:52:13 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:52:13:52:13 | x | A | main.rs:10:5:14:5 | MyOption | -| main.rs:52:13:52:13 | x | A.T | main.rs:2:5:3:13 | S | +| main.rs:52:13:52:13 | x | A.T | main.rs:3:5:4:13 | S | | main.rs:52:17:54:9 | GenericThing::<...> {...} | | main.rs:16:5:19:5 | GenericThing | | main.rs:52:17:54:9 | GenericThing::<...> {...} | A | main.rs:10:5:14:5 | MyOption | -| main.rs:52:17:54:9 | GenericThing::<...> {...} | A.T | main.rs:2:5:3:13 | S | +| main.rs:52:17:54:9 | GenericThing::<...> {...} | A.T | main.rs:3:5:4:13 | S | | main.rs:53:16:53:33 | ...::MyNone(...) | | main.rs:10:5:14:5 | MyOption | -| main.rs:53:16:53:33 | ...::MyNone(...) | T | main.rs:2:5:3:13 | S | +| main.rs:53:16:53:33 | ...::MyNone(...) | T | main.rs:3:5:4:13 | S | | main.rs:55:18:55:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:55:18:55:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:55:18:55:28 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:55:18:55:28 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:55:26:55:26 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:55:26:55:26 | x | A | main.rs:10:5:14:5 | MyOption | -| main.rs:55:26:55:26 | x | A.T | main.rs:2:5:3:13 | S | +| main.rs:55:26:55:26 | x | A.T | main.rs:3:5:4:13 | S | | main.rs:55:26:55:28 | x.a | | main.rs:10:5:14:5 | MyOption | -| main.rs:55:26:55:28 | x.a | T | main.rs:2:5:3:13 | S | +| main.rs:55:26:55:28 | x.a | T | main.rs:3:5:4:13 | S | | main.rs:57:17:57:17 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:57:17:57:17 | x | A | main.rs:10:5:14:5 | MyOption | -| main.rs:57:17:57:17 | x | A.T | main.rs:2:5:3:13 | S | +| main.rs:57:17:57:17 | x | A.T | main.rs:3:5:4:13 | S | | main.rs:57:21:59:9 | GenericThing {...} | | main.rs:16:5:19:5 | GenericThing | | main.rs:57:21:59:9 | GenericThing {...} | A | main.rs:10:5:14:5 | MyOption | -| main.rs:57:21:59:9 | GenericThing {...} | A.T | main.rs:2:5:3:13 | S | +| main.rs:57:21:59:9 | GenericThing {...} | A.T | main.rs:3:5:4:13 | S | | main.rs:58:16:58:33 | ...::MyNone(...) | | main.rs:10:5:14:5 | MyOption | -| main.rs:58:16:58:33 | ...::MyNone(...) | T | main.rs:2:5:3:13 | S | +| main.rs:58:16:58:33 | ...::MyNone(...) | T | main.rs:3:5:4:13 | S | | main.rs:61:13:61:13 | a | | main.rs:10:5:14:5 | MyOption | -| main.rs:61:13:61:13 | a | T | main.rs:2:5:3:13 | S | +| main.rs:61:13:61:13 | a | T | main.rs:3:5:4:13 | S | | main.rs:61:30:61:30 | x | | main.rs:16:5:19:5 | GenericThing | | main.rs:61:30:61:30 | x | A | main.rs:10:5:14:5 | MyOption | -| main.rs:61:30:61:30 | x | A.T | main.rs:2:5:3:13 | S | +| main.rs:61:30:61:30 | x | A.T | main.rs:3:5:4:13 | S | | main.rs:61:30:61:32 | x.a | | main.rs:10:5:14:5 | MyOption | -| main.rs:61:30:61:32 | x.a | T | main.rs:2:5:3:13 | S | +| main.rs:61:30:61:32 | x.a | T | main.rs:3:5:4:13 | S | | main.rs:62:18:62:23 | "{:?}\\n" | | file://:0:0:0:0 | & | | main.rs:62:18:62:23 | "{:?}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:62:18:62:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:62:18:62:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:62:26:62:26 | a | | main.rs:10:5:14:5 | MyOption | -| main.rs:62:26:62:26 | a | T | main.rs:2:5:3:13 | S | +| main.rs:62:26:62:26 | a | T | main.rs:3:5:4:13 | S | | main.rs:75:19:75:22 | SelfParam | | main.rs:72:5:72:21 | Foo | | main.rs:75:33:77:9 | { ... } | | main.rs:72:5:72:21 | Foo | | main.rs:76:13:76:16 | self | | main.rs:72:5:72:21 | Foo | @@ -4059,287 +4059,1346 @@ inferType | main.rs:2331:14:2331:18 | S1 {...} | | main.rs:2327:5:2327:16 | S1 | | main.rs:2331:21:2331:25 | S1 {...} | | main.rs:2327:5:2327:16 | S1 | | main.rs:2333:16:2333:19 | SelfParam | | main.rs:2327:5:2327:16 | S1 | -| main.rs:2367:30:2487:5 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2368:13:2368:17 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2368:13:2368:17 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2368:21:2368:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2368:21:2368:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2368:26:2368:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2369:16:2369:25 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2369:16:2369:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2369:21:2369:24 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2369:29:2369:33 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2369:29:2369:33 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2370:17:2370:20 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2370:24:2370:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2371:22:2371:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2371:22:2371:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2371:22:2371:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2371:22:2371:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2371:24:2371:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2373:15:2373:19 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2373:15:2373:19 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2374:13:2374:22 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2374:13:2374:22 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2374:18:2374:21 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2375:21:2375:24 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2375:28:2375:31 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2376:26:2376:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2376:26:2376:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2376:26:2376:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2376:26:2376:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2376:28:2376:31 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2378:13:2378:16 | None | | {EXTERNAL LOCATION} | Option | -| main.rs:2378:13:2378:16 | None | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2380:13:2380:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2380:20:2380:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2380:20:2380:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2380:20:2380:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:13:2381:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2381:20:2381:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2382:18:2382:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2382:18:2382:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2382:18:2382:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2382:18:2382:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2382:20:2382:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2383:13:2383:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2383:20:2383:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2383:20:2383:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2383:20:2383:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | -| main.rs:2384:18:2384:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2384:18:2384:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2384:18:2384:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2384:18:2384:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2384:20:2384:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2386:13:2386:18 | value2 | | file://:0:0:0:0 | & | -| main.rs:2386:13:2386:18 | value2 | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2386:13:2386:18 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2386:22:2386:30 | &... | | file://:0:0:0:0 | & | -| main.rs:2386:22:2386:30 | &... | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2386:22:2386:30 | &... | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2386:23:2386:30 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2386:23:2386:30 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2386:28:2386:29 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:16:2387:26 | &... | | file://:0:0:0:0 | & | -| main.rs:2387:16:2387:26 | &... | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2387:16:2387:26 | &... | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:17:2387:26 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2387:17:2387:26 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:22:2387:25 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2387:30:2387:35 | value2 | | file://:0:0:0:0 | & | -| main.rs:2387:30:2387:35 | value2 | &T | {EXTERNAL LOCATION} | Option | -| main.rs:2387:30:2387:35 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | -| main.rs:2388:17:2388:20 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2388:24:2388:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2389:22:2389:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2389:22:2389:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2389:22:2389:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2389:22:2389:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2389:24:2389:27 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2392:13:2392:18 | value3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2392:22:2392:23 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:20:2393:23 | mesg | | file://:0:0:0:0 | & | -| main.rs:2393:20:2393:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2393:27:2393:32 | value3 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:17:2394:20 | mesg | | file://:0:0:0:0 | & | -| main.rs:2394:17:2394:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2394:24:2394:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2394:24:2394:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2395:22:2395:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2395:22:2395:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2395:22:2395:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2395:22:2395:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2395:24:2395:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2395:24:2395:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2398:13:2398:18 | value4 | | {EXTERNAL LOCATION} | Option | -| main.rs:2398:13:2398:18 | value4 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2398:22:2398:29 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2398:22:2398:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2398:27:2398:28 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2399:16:2399:29 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2399:16:2399:29 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2399:25:2399:28 | mesg | | file://:0:0:0:0 | & | -| main.rs:2399:25:2399:28 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2399:33:2399:38 | value4 | | {EXTERNAL LOCATION} | Option | -| main.rs:2399:33:2399:38 | value4 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:17:2400:20 | mesg | | file://:0:0:0:0 | & | -| main.rs:2400:17:2400:20 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2400:24:2400:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2400:24:2400:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2401:22:2401:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2401:22:2401:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2401:22:2401:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2401:22:2401:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2401:24:2401:27 | mesg | | file://:0:0:0:0 | & | -| main.rs:2401:24:2401:27 | mesg | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2404:17:2404:22 | value5 | | file://:0:0:0:0 | & | -| main.rs:2404:17:2404:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2404:26:2404:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2405:13:2405:13 | x | | file://:0:0:0:0 | & | -| main.rs:2405:13:2405:13 | x | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2405:17:2405:22 | value5 | | file://:0:0:0:0 | & | -| main.rs:2405:17:2405:22 | value5 | &T | {EXTERNAL LOCATION} | i32 | -| main.rs:2407:13:2407:28 | my_record_struct | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2407:13:2407:28 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2407:13:2407:28 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2407:32:2410:9 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2407:32:2410:9 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2407:32:2410:9 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2408:21:2408:22 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2409:21:2409:25 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2411:16:2411:48 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2411:16:2411:48 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2411:16:2411:48 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2411:33:2411:38 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2411:41:2411:46 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2411:52:2411:67 | my_record_struct | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2411:52:2411:67 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2411:52:2411:67 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2412:17:2412:17 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2412:21:2412:26 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2413:17:2413:17 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2413:21:2413:26 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2417:13:2417:27 | my_tuple_struct | | main.rs:2360:5:2360:41 | MyTupleStruct | -| main.rs:2417:13:2417:27 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2417:13:2417:27 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2417:31:2417:54 | MyTupleStruct(...) | | main.rs:2360:5:2360:41 | MyTupleStruct | -| main.rs:2417:31:2417:54 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2417:31:2417:54 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2417:45:2417:46 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2417:49:2417:53 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2418:16:2418:44 | MyTupleStruct(...) | | main.rs:2360:5:2360:41 | MyTupleStruct | -| main.rs:2418:16:2418:44 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2418:16:2418:44 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2418:30:2418:35 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2418:38:2418:43 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2418:48:2418:62 | my_tuple_struct | | main.rs:2360:5:2360:41 | MyTupleStruct | -| main.rs:2418:48:2418:62 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2418:48:2418:62 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2419:17:2419:17 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2419:21:2419:26 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2420:17:2420:17 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2420:21:2420:26 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2424:13:2424:20 | my_enum1 | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2424:13:2424:20 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2424:13:2424:20 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2424:24:2427:9 | ...::Variant1 {...} | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2424:24:2427:9 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2424:24:2427:9 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2425:21:2425:22 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2426:21:2426:25 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2428:15:2428:22 | my_enum1 | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2428:15:2428:22 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2428:15:2428:22 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2429:13:2429:47 | ...::Variant1 {...} | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2429:13:2429:47 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2429:13:2429:47 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2429:32:2429:37 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2429:40:2429:45 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2430:21:2430:21 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2430:25:2430:30 | value1 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2431:21:2431:21 | y | | {EXTERNAL LOCATION} | bool | -| main.rs:2431:25:2431:30 | value2 | | {EXTERNAL LOCATION} | bool | -| main.rs:2434:13:2434:44 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2434:13:2434:44 | ...::Variant2(...) | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2434:13:2434:44 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2434:30:2434:35 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2434:38:2434:43 | value2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2435:21:2435:21 | x | | {EXTERNAL LOCATION} | bool | -| main.rs:2435:25:2435:30 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2436:21:2436:21 | y | | {EXTERNAL LOCATION} | i32 | -| main.rs:2436:25:2436:30 | value2 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2441:13:2441:26 | my_nested_enum | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2441:13:2441:26 | my_nested_enum | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2441:13:2441:26 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2441:13:2441:26 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2441:13:2441:26 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2441:13:2441:26 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2441:30:2447:9 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2442:13:2442:17 | false | | {EXTERNAL LOCATION} | bool | -| main.rs:2443:13:2446:13 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | -| main.rs:2443:13:2446:13 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2444:25:2444:26 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2445:25:2445:32 | "string" | | file://:0:0:0:0 | & | -| main.rs:2445:25:2445:32 | "string" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2449:15:2449:28 | my_nested_enum | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2449:15:2449:28 | my_nested_enum | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2449:15:2449:28 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2449:15:2449:28 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2449:15:2449:28 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2449:15:2449:28 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2450:13:2456:13 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2451:17:2451:22 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2452:17:2455:17 | MyRecordStruct {...} | | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | -| main.rs:2452:17:2455:17 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2453:29:2453:29 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2454:29:2454:29 | y | | file://:0:0:0:0 | & | -| main.rs:2454:29:2454:29 | y | &T | {EXTERNAL LOCATION} | str | -| main.rs:2457:21:2457:21 | a | | {EXTERNAL LOCATION} | bool | -| main.rs:2457:25:2457:30 | value1 | | {EXTERNAL LOCATION} | bool | -| main.rs:2458:21:2458:21 | b | | {EXTERNAL LOCATION} | i32 | -| main.rs:2458:25:2458:25 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2459:21:2459:21 | c | | file://:0:0:0:0 | & | -| main.rs:2459:21:2459:21 | c | &T | {EXTERNAL LOCATION} | str | -| main.rs:2459:25:2459:25 | y | | file://:0:0:0:0 | & | -| main.rs:2459:25:2459:25 | y | &T | {EXTERNAL LOCATION} | str | -| main.rs:2462:13:2462:13 | _ | | main.rs:2362:5:2365:5 | MyEnum | -| main.rs:2462:13:2462:13 | _ | T1 | main.rs:2355:5:2358:5 | MyRecordStruct | -| main.rs:2462:13:2462:13 | _ | T1.T1 | {EXTERNAL LOCATION} | i32 | -| main.rs:2462:13:2462:13 | _ | T1.T2 | file://:0:0:0:0 | & | -| main.rs:2462:13:2462:13 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | -| main.rs:2462:13:2462:13 | _ | T2 | {EXTERNAL LOCATION} | bool | -| main.rs:2465:13:2465:16 | opt1 | | {EXTERNAL LOCATION} | Option | -| main.rs:2465:13:2465:16 | opt1 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2465:20:2465:43 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2465:20:2465:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2465:25:2465:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | -| main.rs:2467:24:2467:37 | Some::<...>(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2467:24:2467:37 | Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2467:36:2467:36 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2467:41:2467:44 | opt1 | | {EXTERNAL LOCATION} | Option | -| main.rs:2467:41:2467:44 | opt1 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2469:13:2469:13 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2472:13:2472:16 | opt2 | | {EXTERNAL LOCATION} | Option | -| main.rs:2472:13:2472:16 | opt2 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2472:20:2472:43 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2472:20:2472:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2472:25:2472:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | -| main.rs:2474:24:2474:45 | ...::Some::<...>(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2474:24:2474:45 | ...::Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2474:44:2474:44 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2474:49:2474:52 | opt2 | | {EXTERNAL LOCATION} | Option | -| main.rs:2474:49:2474:52 | opt2 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2476:13:2476:13 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2479:13:2479:16 | opt3 | | {EXTERNAL LOCATION} | Option | -| main.rs:2479:13:2479:16 | opt3 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2479:20:2479:43 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2479:20:2479:43 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2479:25:2479:42 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | -| main.rs:2481:24:2481:45 | ...::Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2481:24:2481:45 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2481:44:2481:44 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2481:49:2481:52 | opt3 | | {EXTERNAL LOCATION} | Option | -| main.rs:2481:49:2481:52 | opt3 | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2483:13:2483:13 | x | | {EXTERNAL LOCATION} | i32 | -| main.rs:2486:9:2486:12 | None | | {EXTERNAL LOCATION} | Option | -| main.rs:2492:5:2492:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2493:5:2493:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2493:20:2493:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2493:41:2493:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2509:5:2509:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | -| main.rs:2518:5:2518:25 | ...::f(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2357:13:2357:23 | boxed_value | | {EXTERNAL LOCATION} | Box | +| main.rs:2357:13:2357:23 | boxed_value | A | {EXTERNAL LOCATION} | Global | +| main.rs:2357:13:2357:23 | boxed_value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2357:27:2357:42 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| main.rs:2357:27:2357:42 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2357:27:2357:42 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2357:36:2357:41 | 100i32 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2360:15:2360:25 | boxed_value | | {EXTERNAL LOCATION} | Box | +| main.rs:2360:15:2360:25 | boxed_value | A | {EXTERNAL LOCATION} | Global | +| main.rs:2360:15:2360:25 | boxed_value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2361:13:2361:19 | box 100 | | {EXTERNAL LOCATION} | Box | +| main.rs:2361:13:2361:19 | box 100 | A | {EXTERNAL LOCATION} | Global | +| main.rs:2361:13:2361:19 | box 100 | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2361:17:2361:19 | 100 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2362:26:2362:36 | "Boxed 100\\n" | | file://:0:0:0:0 | & | +| main.rs:2362:26:2362:36 | "Boxed 100\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2362:26:2362:36 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2362:26:2362:36 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2364:13:2364:17 | box ... | | {EXTERNAL LOCATION} | Box | +| main.rs:2364:13:2364:17 | box ... | A | {EXTERNAL LOCATION} | Global | +| main.rs:2364:13:2364:17 | box ... | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2366:26:2366:42 | "Boxed value: {}\\n" | | file://:0:0:0:0 | & | +| main.rs:2366:26:2366:42 | "Boxed value: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2366:26:2366:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2366:26:2366:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2371:13:2371:22 | nested_box | | {EXTERNAL LOCATION} | Box | +| main.rs:2371:13:2371:22 | nested_box | A | {EXTERNAL LOCATION} | Global | +| main.rs:2371:13:2371:22 | nested_box | T | {EXTERNAL LOCATION} | Box | +| main.rs:2371:13:2371:22 | nested_box | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2371:13:2371:22 | nested_box | T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2371:26:2371:50 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| main.rs:2371:26:2371:50 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2371:26:2371:50 | ...::new(...) | T | {EXTERNAL LOCATION} | Box | +| main.rs:2371:26:2371:50 | ...::new(...) | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2371:26:2371:50 | ...::new(...) | T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2371:35:2371:49 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| main.rs:2371:35:2371:49 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2371:35:2371:49 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2371:44:2371:48 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2372:15:2372:24 | nested_box | | {EXTERNAL LOCATION} | Box | +| main.rs:2372:15:2372:24 | nested_box | A | {EXTERNAL LOCATION} | Global | +| main.rs:2372:15:2372:24 | nested_box | T | {EXTERNAL LOCATION} | Box | +| main.rs:2372:15:2372:24 | nested_box | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2372:15:2372:24 | nested_box | T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2373:13:2373:21 | box ... | | {EXTERNAL LOCATION} | Box | +| main.rs:2373:13:2373:21 | box ... | A | {EXTERNAL LOCATION} | Global | +| main.rs:2373:13:2373:21 | box ... | T | {EXTERNAL LOCATION} | Box | +| main.rs:2373:13:2373:21 | box ... | T.A | {EXTERNAL LOCATION} | Global | +| main.rs:2373:13:2373:21 | box ... | T.T | {EXTERNAL LOCATION} | i32 | +| main.rs:2375:26:2375:43 | "Nested boxed: {}\\n" | | file://:0:0:0:0 | & | +| main.rs:2375:26:2375:43 | "Nested boxed: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2375:26:2375:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2375:26:2375:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2383:5:2383:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2384:5:2384:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2384:20:2384:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2384:41:2384:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2400:5:2400:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| pattern_matching.rs:13:26:133:1 | { ... } | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:14:9:14:13 | value | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:14:9:14:13 | value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:14:17:14:24 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:14:17:14:24 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:14:22:14:23 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:15:12:15:21 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:15:12:15:21 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:15:17:15:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:15:25:15:29 | value | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:15:25:15:29 | value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:16:13:16:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:16:20:16:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:17:18:17:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:17:18:17:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:17:18:17:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:17:18:17:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:17:20:17:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:19:11:19:15 | value | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:19:11:19:15 | value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:20:9:20:18 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:20:9:20:18 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:20:14:20:17 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:21:17:21:20 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:21:24:21:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:22:22:22:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:22:22:22:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:22:22:22:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:22:22:22:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:22:24:22:27 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:24:9:24:12 | None | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:24:9:24:12 | None | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:26:9:26:12 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:26:16:26:20 | value | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:26:16:26:20 | value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:26:16:26:29 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:27:9:27:12 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:27:16:27:19 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:28:14:28:21 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:28:14:28:21 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:28:14:28:21 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:28:14:28:21 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:28:16:28:19 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:29:9:29:12 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:29:16:29:20 | value | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:29:16:29:20 | value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:29:16:29:21 | TryExpr | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:30:14:30:21 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:30:14:30:21 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:30:14:30:21 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:30:14:30:21 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:30:16:30:19 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:32:9:32:14 | value2 | | file://:0:0:0:0 | & | +| pattern_matching.rs:32:9:32:14 | value2 | &T | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:32:9:32:14 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:32:18:32:26 | &... | | file://:0:0:0:0 | & | +| pattern_matching.rs:32:18:32:26 | &... | &T | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:32:18:32:26 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:32:19:32:26 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:32:19:32:26 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:32:24:32:25 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:33:12:33:22 | &... | | file://:0:0:0:0 | & | +| pattern_matching.rs:33:12:33:22 | &... | &T | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:33:12:33:22 | &... | &T.T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:33:13:33:22 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:33:13:33:22 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:33:18:33:21 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:33:26:33:31 | value2 | | file://:0:0:0:0 | & | +| pattern_matching.rs:33:26:33:31 | value2 | &T | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:33:26:33:31 | value2 | &T.T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:34:13:34:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:34:20:34:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:35:18:35:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:35:18:35:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:35:18:35:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:35:18:35:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:35:20:35:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:38:9:38:14 | value3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:38:18:38:19 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:39:16:39:19 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:39:16:39:19 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:39:23:39:28 | value3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:40:13:40:16 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:40:13:40:16 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:40:20:40:23 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:40:20:40:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:41:18:41:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:41:18:41:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:41:18:41:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:41:18:41:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:41:20:41:23 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:41:20:41:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:44:9:44:14 | value4 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:44:9:44:14 | value4 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:44:18:44:25 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:44:18:44:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:44:23:44:24 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:45:12:45:25 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:45:12:45:25 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:45:21:45:24 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:45:21:45:24 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:45:29:45:34 | value4 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:45:29:45:34 | value4 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:46:13:46:16 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:46:13:46:16 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:46:20:46:23 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:46:20:46:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:47:18:47:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:47:18:47:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:47:18:47:25 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:47:18:47:25 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:47:20:47:23 | mesg | | file://:0:0:0:0 | & | +| pattern_matching.rs:47:20:47:23 | mesg | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:50:13:50:18 | value5 | | file://:0:0:0:0 | & | +| pattern_matching.rs:50:13:50:18 | value5 | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:50:22:50:23 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:51:9:51:9 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:51:9:51:9 | x | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:51:13:51:18 | value5 | | file://:0:0:0:0 | & | +| pattern_matching.rs:51:13:51:18 | value5 | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:53:9:53:24 | my_record_struct | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:53:9:53:24 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:53:9:53:24 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:53:28:56:5 | MyRecordStruct {...} | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:53:28:56:5 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:53:28:56:5 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:54:17:54:18 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:55:17:55:21 | false | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:57:12:57:44 | MyRecordStruct {...} | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:57:12:57:44 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:57:12:57:44 | MyRecordStruct {...} | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:57:29:57:34 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:57:37:57:42 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:57:48:57:63 | my_record_struct | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:57:48:57:63 | my_record_struct | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:57:48:57:63 | my_record_struct | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:58:13:58:13 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:58:17:58:22 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:59:13:59:13 | y | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:59:17:59:22 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:63:9:63:23 | my_tuple_struct | | pattern_matching.rs:6:1:6:37 | MyTupleStruct | +| pattern_matching.rs:63:9:63:23 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:63:9:63:23 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:63:27:63:50 | MyTupleStruct(...) | | pattern_matching.rs:6:1:6:37 | MyTupleStruct | +| pattern_matching.rs:63:27:63:50 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:63:27:63:50 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:63:41:63:42 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:63:45:63:49 | false | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:64:12:64:40 | MyTupleStruct(...) | | pattern_matching.rs:6:1:6:37 | MyTupleStruct | +| pattern_matching.rs:64:12:64:40 | MyTupleStruct(...) | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:64:12:64:40 | MyTupleStruct(...) | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:64:26:64:31 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:64:34:64:39 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:64:44:64:58 | my_tuple_struct | | pattern_matching.rs:6:1:6:37 | MyTupleStruct | +| pattern_matching.rs:64:44:64:58 | my_tuple_struct | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:64:44:64:58 | my_tuple_struct | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:65:13:65:13 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:65:17:65:22 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:66:13:66:13 | y | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:66:17:66:22 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:70:9:70:16 | my_enum1 | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:70:9:70:16 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:70:9:70:16 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:70:20:73:5 | ...::Variant1 {...} | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:70:20:73:5 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:70:20:73:5 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:71:17:71:18 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:72:17:72:21 | false | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:74:11:74:18 | my_enum1 | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:74:11:74:18 | my_enum1 | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:74:11:74:18 | my_enum1 | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:75:9:75:43 | ...::Variant1 {...} | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:75:9:75:43 | ...::Variant1 {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:75:9:75:43 | ...::Variant1 {...} | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:75:28:75:33 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:75:36:75:41 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:76:17:76:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:76:21:76:26 | value1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:77:17:77:17 | y | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:77:21:77:26 | value2 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:80:9:80:40 | ...::Variant2(...) | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:80:9:80:40 | ...::Variant2(...) | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:80:9:80:40 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:80:26:80:31 | value1 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:80:34:80:39 | value2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:81:17:81:17 | x | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:81:21:81:26 | value1 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:82:17:82:17 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:82:21:82:26 | value2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | T1 | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:87:9:87:22 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | T1 | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:87:26:93:5 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:88:9:88:13 | false | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:89:9:92:9 | MyRecordStruct {...} | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:89:9:92:9 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:89:9:92:9 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:89:9:92:9 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:90:21:90:22 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:91:21:91:28 | "string" | | file://:0:0:0:0 | & | +| pattern_matching.rs:91:21:91:28 | "string" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | T1 | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | T1.T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | T1.T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | T1.T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:95:11:95:24 | my_nested_enum | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | T1 | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | T1.T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | T1.T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | T1.T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:96:9:102:9 | ...::Variant2(...) | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:97:13:97:18 | value1 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:98:13:101:13 | MyRecordStruct {...} | | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:98:13:101:13 | MyRecordStruct {...} | T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:98:13:101:13 | MyRecordStruct {...} | T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:98:13:101:13 | MyRecordStruct {...} | T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:99:25:99:25 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:100:25:100:25 | y | | file://:0:0:0:0 | & | +| pattern_matching.rs:100:25:100:25 | y | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:103:17:103:17 | a | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:103:21:103:26 | value1 | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:104:17:104:17 | b | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:104:21:104:21 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:105:17:105:17 | c | | file://:0:0:0:0 | & | +| pattern_matching.rs:105:17:105:17 | c | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:105:21:105:21 | y | | file://:0:0:0:0 | & | +| pattern_matching.rs:105:21:105:21 | y | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:108:9:108:9 | _ | | pattern_matching.rs:8:1:11:1 | MyEnum | +| pattern_matching.rs:108:9:108:9 | _ | T1 | pattern_matching.rs:1:1:4:1 | MyRecordStruct | +| pattern_matching.rs:108:9:108:9 | _ | T1.T1 | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:108:9:108:9 | _ | T1.T2 | file://:0:0:0:0 | & | +| pattern_matching.rs:108:9:108:9 | _ | T1.T2.&T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:108:9:108:9 | _ | T2 | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:111:9:111:12 | opt1 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:111:9:111:12 | opt1 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:111:16:111:39 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:111:16:111:39 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:111:21:111:38 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:113:20:113:33 | Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:113:20:113:33 | Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:113:32:113:32 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:113:37:113:40 | opt1 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:113:37:113:40 | opt1 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:115:9:115:9 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:118:9:118:12 | opt2 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:118:9:118:12 | opt2 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:118:16:118:39 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:118:16:118:39 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:118:21:118:38 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:120:20:120:41 | ...::Some::<...>(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:120:20:120:41 | ...::Some::<...>(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:120:40:120:40 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:120:45:120:48 | opt2 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:120:45:120:48 | opt2 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:122:9:122:9 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:125:9:125:12 | opt3 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:125:9:125:12 | opt3 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:125:16:125:39 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:125:16:125:39 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:125:21:125:38 | ...::default(...) | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:127:20:127:41 | ...::Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:127:20:127:41 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:127:40:127:40 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:127:45:127:48 | opt3 | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:127:45:127:48 | opt3 | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:129:9:129:9 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:132:5:132:8 | None | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:169:9:169:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:169:17:169:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:171:11:171:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:173:9:173:10 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:174:17:174:29 | literal_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:174:33:174:37 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:175:22:175:42 | "Literal pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:175:22:175:42 | "Literal pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:175:22:175:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:175:22:175:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:175:45:175:57 | literal_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:177:10:177:10 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:178:17:178:32 | negative_literal | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:178:36:178:40 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:179:22:179:43 | "Negative literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:179:22:179:43 | "Negative literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:179:22:179:61 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:179:22:179:61 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:179:46:179:61 | negative_literal | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:181:9:181:9 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:182:17:182:28 | zero_literal | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:182:32:182:36 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:183:22:183:39 | "Zero literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:183:22:183:39 | "Zero literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:183:22:183:53 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:183:22:183:53 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:183:42:183:53 | zero_literal | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:185:9:185:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:188:9:188:17 | float_val | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:188:21:188:27 | 3.14f64 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:189:11:189:19 | float_val | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:190:9:190:12 | 3.14 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:191:17:191:24 | pi_match | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:191:28:191:36 | float_val | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:192:22:192:37 | "Pi matched: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:192:22:192:37 | "Pi matched: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:192:22:192:47 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:192:22:192:47 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:192:40:192:47 | pi_match | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:194:9:194:9 | _ | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:197:9:197:18 | string_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:197:9:197:18 | string_val | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:197:22:197:28 | "hello" | | file://:0:0:0:0 | & | +| pattern_matching.rs:197:22:197:28 | "hello" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:198:11:198:20 | string_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:198:11:198:20 | string_val | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:199:9:199:15 | "hello" | | file://:0:0:0:0 | & | +| pattern_matching.rs:199:9:199:15 | "hello" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:200:17:200:27 | hello_match | | file://:0:0:0:0 | & | +| pattern_matching.rs:200:17:200:27 | hello_match | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:200:31:200:40 | string_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:200:31:200:40 | string_val | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:201:22:201:41 | "String literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:201:22:201:41 | "String literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:201:22:201:54 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:201:22:201:54 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:201:44:201:54 | hello_match | | file://:0:0:0:0 | & | +| pattern_matching.rs:201:44:201:54 | hello_match | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:203:9:203:9 | _ | | file://:0:0:0:0 | & | +| pattern_matching.rs:203:9:203:9 | _ | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:206:9:206:16 | bool_val | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:206:20:206:23 | true | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:207:11:207:18 | bool_val | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:208:9:208:12 | true | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:209:17:209:26 | true_match | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:209:30:209:37 | bool_val | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:210:22:210:39 | "True literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:210:22:210:39 | "True literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:210:22:210:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:210:22:210:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:210:42:210:51 | true_match | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:212:9:212:13 | false | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:213:17:213:27 | false_match | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:213:31:213:38 | bool_val | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:214:22:214:40 | "False literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:214:22:214:40 | "False literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:214:22:214:53 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:214:22:214:53 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:214:43:214:53 | false_match | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:220:9:220:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:220:17:220:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:223:11:223:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:224:9:224:9 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:225:17:225:27 | bound_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:225:31:225:31 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:226:22:226:45 | "Identifier pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:226:22:226:45 | "Identifier pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:226:22:226:58 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:226:22:226:58 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:226:48:226:58 | bound_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:231:11:231:16 | &value | | file://:0:0:0:0 | & | +| pattern_matching.rs:231:11:231:16 | &value | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:231:12:231:16 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:232:13:232:13 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:232:13:232:13 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:232:13:232:13 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:233:17:233:25 | ref_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:233:17:233:25 | ref_bound | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:233:17:233:25 | ref_bound | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:233:29:233:29 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:233:29:233:29 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:233:29:233:29 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:234:22:234:49 | "Reference identifier: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:234:22:234:49 | "Reference identifier: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:234:22:234:60 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:234:22:234:60 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:234:52:234:60 | ref_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:234:52:234:60 | ref_bound | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:234:52:234:60 | ref_bound | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:239:13:239:25 | mutable_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:239:29:239:33 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:240:11:240:23 | mutable_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:241:13:241:13 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:242:17:242:25 | mut_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:242:29:242:29 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:243:13:243:13 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:243:13:243:18 | ... += ... | | file://:0:0:0:0 | () | +| pattern_matching.rs:243:18:243:18 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:244:22:244:45 | "Mutable identifier: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:244:22:244:45 | "Mutable identifier: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:244:22:244:56 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:244:22:244:56 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:244:48:244:56 | mut_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:249:9:249:20 | option_value | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:249:9:249:20 | option_value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:249:24:249:44 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:249:24:249:44 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:249:39:249:43 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:250:11:250:22 | option_value | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:250:11:250:22 | option_value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:251:9:251:30 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:251:9:251:30 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:251:24:251:24 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:251:28:251:29 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:252:17:252:24 | at_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:252:28:252:28 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:253:22:253:49 | "@ pattern with literal: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:253:22:253:49 | "@ pattern with literal: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:253:22:253:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:253:22:253:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:253:52:253:59 | at_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:255:9:255:35 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:255:9:255:35 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:255:24:255:24 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:255:28:255:28 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:255:32:255:34 | 100 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:256:17:256:30 | range_at_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:256:34:256:34 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:257:22:257:47 | "@ pattern with range: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:257:22:257:47 | "@ pattern with range: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:257:22:257:63 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:257:22:257:63 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:257:50:257:63 | range_at_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:259:9:259:25 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:259:9:259:25 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:259:24:259:24 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:260:17:260:26 | some_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:260:30:260:30 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:261:22:261:37 | "Some value: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:261:22:261:37 | "Some value: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:261:22:261:49 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:261:22:261:49 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:261:40:261:49 | some_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:263:9:263:22 | ...::None | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:263:9:263:22 | ...::None | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:264:22:264:33 | "None value\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:264:22:264:33 | "None value\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:264:22:264:33 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:264:22:264:33 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:269:13:269:23 | ref_mut_val | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:269:27:269:30 | 5i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:270:11:270:26 | &mut ref_mut_val | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:270:11:270:26 | &mut ref_mut_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:270:11:270:26 | &mut ref_mut_val | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:270:16:270:26 | ref_mut_val | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:271:17:271:17 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:271:17:271:17 | x | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:271:17:271:17 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:271:17:271:17 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:272:17:272:29 | ref_mut_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:272:17:272:29 | ref_mut_bound | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:272:17:272:29 | ref_mut_bound | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:272:17:272:29 | ref_mut_bound | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:272:33:272:33 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:272:33:272:33 | x | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:272:33:272:33 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:272:33:272:33 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:13:273:27 | * ... | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:13:273:32 | ... += ... | | file://:0:0:0:0 | () | +| pattern_matching.rs:273:14:273:27 | * ... | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:14:273:27 | * ... | | file://:0:0:0:0 | & | +| pattern_matching.rs:273:14:273:27 | * ... | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:15:273:27 | ref_mut_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:273:15:273:27 | ref_mut_bound | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:15:273:27 | ref_mut_bound | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:273:15:273:27 | ref_mut_bound | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:273:32:273:32 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:274:22:274:38 | "Ref mut pattern\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:274:22:274:38 | "Ref mut pattern\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:274:22:274:38 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:274:22:274:38 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:280:9:280:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:280:17:280:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:282:11:282:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:283:9:283:10 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:283:24:283:39 | "Specific match\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:283:24:283:39 | "Specific match\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:283:24:283:39 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:283:24:283:39 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:285:9:285:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:286:17:286:32 | wildcard_context | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:286:36:286:40 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:287:22:287:47 | "Wildcard pattern for: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:287:22:287:47 | "Wildcard pattern for: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:287:22:287:65 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:287:22:287:65 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:287:50:287:65 | wildcard_context | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:293:9:293:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:293:17:293:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:295:11:295:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:297:9:297:9 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:297:9:297:14 | RangePat | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:297:13:297:14 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:298:17:298:31 | range_inclusive | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:298:35:298:39 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:299:22:299:42 | "Range inclusive: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:299:22:299:42 | "Range inclusive: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:299:22:299:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:299:22:299:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:299:45:299:59 | range_inclusive | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:301:9:301:10 | 11 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:301:9:301:12 | RangePat | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:302:17:302:26 | range_from | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:302:30:302:34 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:303:22:303:40 | "Range from 11: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:303:22:303:40 | "Range from 11: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:303:22:303:52 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:303:22:303:52 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:303:43:303:52 | range_from | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:305:9:305:12 | RangePat | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:305:12:305:12 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:306:17:306:34 | range_to_inclusive | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:306:38:306:42 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:307:22:307:47 | "Range to 0 inclusive: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:307:22:307:47 | "Range to 0 inclusive: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:307:22:307:67 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:307:22:307:67 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:307:50:307:67 | range_to_inclusive | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:309:9:309:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:312:9:312:16 | char_val | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:312:20:312:22 | 'c' | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:313:11:313:18 | char_val | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:314:9:314:11 | 'a' | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:314:9:314:17 | RangePat | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:314:15:314:17 | 'z' | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:315:17:315:30 | lowercase_char | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:315:34:315:41 | char_val | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:316:22:316:41 | "Lowercase char: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:316:22:316:41 | "Lowercase char: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:316:22:316:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:316:22:316:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:316:44:316:57 | lowercase_char | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:318:9:318:11 | 'A' | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:318:9:318:17 | RangePat | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:318:15:318:17 | 'Z' | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:319:17:319:30 | uppercase_char | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:319:34:319:41 | char_val | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:320:22:320:41 | "Uppercase char: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:320:22:320:41 | "Uppercase char: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:320:22:320:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:320:22:320:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:320:44:320:57 | uppercase_char | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:322:9:322:9 | _ | | {EXTERNAL LOCATION} | char | +| pattern_matching.rs:327:9:327:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:327:17:327:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:328:13:328:25 | mutable_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:328:29:328:33 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:331:11:331:16 | &value | | file://:0:0:0:0 | & | +| pattern_matching.rs:331:11:331:16 | &value | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:331:12:331:16 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:332:9:332:11 | &42 | | file://:0:0:0:0 | & | +| pattern_matching.rs:332:9:332:11 | &42 | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:332:10:332:11 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:333:17:333:27 | deref_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:333:31:333:35 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:334:22:334:45 | "Dereferenced match: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:334:22:334:45 | "Dereferenced match: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:334:22:334:58 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:334:22:334:58 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:334:48:334:58 | deref_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:336:9:336:10 | &... | | file://:0:0:0:0 | & | +| pattern_matching.rs:336:9:336:10 | &... | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:336:10:336:10 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:337:17:337:27 | deref_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:337:31:337:31 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:338:22:338:47 | "Dereferenced binding: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:338:22:338:47 | "Dereferenced binding: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:338:22:338:60 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:338:22:338:60 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:338:50:338:60 | deref_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:342:11:342:28 | &mut mutable_value | | file://:0:0:0:0 | & | +| pattern_matching.rs:342:11:342:28 | &mut mutable_value | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:342:16:342:28 | mutable_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:343:9:343:18 | &mut ... | | file://:0:0:0:0 | & | +| pattern_matching.rs:343:9:343:18 | &mut ... | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:343:18:343:18 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:343:18:343:18 | x | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:344:17:344:29 | mut_ref_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:344:17:344:29 | mut_ref_bound | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:344:33:344:33 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:344:33:344:33 | x | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:345:22:345:46 | "Mutable ref pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:345:22:345:46 | "Mutable ref pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:345:22:345:61 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:345:22:345:61 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:345:49:345:61 | mut_ref_bound | | file://:0:0:0:0 | & | +| pattern_matching.rs:345:49:345:61 | mut_ref_bound | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:349:11:349:16 | &value | | file://:0:0:0:0 | & | +| pattern_matching.rs:349:11:349:16 | &value | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:349:12:349:16 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:350:13:350:13 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:350:13:350:13 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:350:13:350:13 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:351:17:351:27 | ref_pattern | | file://:0:0:0:0 | & | +| pattern_matching.rs:351:17:351:27 | ref_pattern | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:351:17:351:27 | ref_pattern | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:351:31:351:31 | x | | file://:0:0:0:0 | & | +| pattern_matching.rs:351:31:351:31 | x | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:351:31:351:31 | x | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:352:22:352:44 | "Reference pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:352:22:352:44 | "Reference pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:352:22:352:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:352:22:352:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:352:47:352:57 | ref_pattern | | file://:0:0:0:0 | & | +| pattern_matching.rs:352:47:352:57 | ref_pattern | &T | file://:0:0:0:0 | & | +| pattern_matching.rs:352:47:352:57 | ref_pattern | &T.&T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:358:9:358:13 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:358:17:358:38 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:358:28:358:29 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:358:35:358:36 | 20 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:361:11:361:15 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:362:9:362:28 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:362:20:362:20 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:362:26:362:26 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:363:17:363:22 | origin | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:363:26:363:30 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:364:22:364:41 | "Origin point: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:364:22:364:41 | "Origin point: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:364:22:364:49 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:364:22:364:49 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:364:44:364:49 | origin | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:366:9:366:25 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:366:17:366:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:366:23:366:23 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:367:17:367:24 | x_axis_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:367:28:367:28 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:368:17:368:28 | x_axis_point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:368:32:368:36 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:369:22:369:56 | "Point on x-axis: x={}, point=... | | file://:0:0:0:0 | & | +| pattern_matching.rs:369:22:369:56 | "Point on x-axis: x={}, point=... | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:369:22:369:80 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:369:22:369:80 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:369:59:369:66 | x_axis_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:369:69:369:80 | x_axis_point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:371:9:371:27 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:371:20:371:21 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:372:17:372:27 | ten_x_point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:372:31:372:35 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:373:22:373:44 | "Point with x=10: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:373:22:373:44 | "Point with x=10: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:373:22:373:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:373:22:373:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:373:47:373:57 | ten_x_point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:375:9:375:22 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:375:17:375:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:375:20:375:20 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:376:17:376:25 | general_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:376:29:376:29 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:377:17:377:25 | general_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:377:29:377:29 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:378:22:378:46 | "General point: ({}, {})\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:378:22:378:46 | "General point: ({}, {})\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:378:22:378:68 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:378:22:378:68 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:378:49:378:57 | general_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:378:60:378:68 | general_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:383:9:383:13 | shape | | pattern_matching.rs:145:1:150:1 | Shape | +| pattern_matching.rs:383:17:386:5 | ...::Rectangle {...} | | pattern_matching.rs:145:1:150:1 | Shape | +| pattern_matching.rs:384:16:384:19 | 10.0 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:385:17:385:20 | 20.0 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:387:11:387:15 | shape | | pattern_matching.rs:145:1:150:1 | Shape | +| pattern_matching.rs:388:9:391:9 | ...::Rectangle {...} | | pattern_matching.rs:145:1:150:1 | Shape | +| pattern_matching.rs:389:20:389:20 | w | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:390:21:390:21 | h | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:392:17:392:26 | rect_width | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:392:30:392:30 | w | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:393:17:393:27 | rect_height | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:393:31:393:31 | h | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:394:22:394:39 | "Rectangle: {}x{}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:394:22:394:39 | "Rectangle: {}x{}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:394:22:394:64 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:394:22:394:64 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:394:42:394:51 | rect_width | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:394:54:394:64 | rect_height | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:396:9:396:9 | _ | | pattern_matching.rs:145:1:150:1 | Shape | +| pattern_matching.rs:401:9:401:13 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:401:17:401:34 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:401:23:401:25 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:401:23:401:25 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:401:28:401:30 | 128 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:401:28:401:30 | 128 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:401:33:401:33 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:401:33:401:33 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:404:11:404:15 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:405:9:405:24 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:405:15:405:17 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:405:15:405:17 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:405:20:405:20 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:405:20:405:20 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:405:23:405:23 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:405:23:405:23 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:406:17:406:25 | red_color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:406:29:406:33 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:407:22:407:37 | "Pure red: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:407:22:407:37 | "Pure red: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:407:22:407:48 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:407:22:407:48 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:407:40:407:48 | red_color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:409:9:409:22 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:409:15:409:15 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:409:18:409:18 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:409:21:409:21 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:410:17:410:29 | red_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:410:33:410:33 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:411:17:411:31 | green_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:411:35:411:35 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:412:17:412:30 | blue_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:412:34:412:34 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:414:17:414:37 | "Color: ({}, {}, {})\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:414:17:414:37 | "Color: ({}, {}, {})\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:414:17:415:62 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:414:17:415:62 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:415:17:415:29 | red_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:415:32:415:46 | green_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:415:49:415:62 | blue_component | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:421:11:421:15 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:422:9:422:22 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:422:15:422:17 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:422:15:422:17 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:422:20:422:21 | .. | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:423:17:423:29 | reddish_color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:423:33:423:37 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:424:22:424:42 | "Reddish color: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:424:22:424:42 | "Reddish color: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:424:22:424:57 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:424:22:424:57 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:424:45:424:57 | reddish_color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:426:9:426:20 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:426:15:426:15 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:426:18:426:19 | .. | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:427:17:427:23 | any_red | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:427:27:427:27 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:428:22:428:45 | "Any color with red: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:428:22:428:45 | "Any color with red: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:428:22:428:54 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:428:22:428:54 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:428:48:428:54 | any_red | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:434:9:434:15 | wrapper | | pattern_matching.rs:432:5:433:24 | Wrapper | +| pattern_matching.rs:434:19:434:29 | Wrapper(...) | | pattern_matching.rs:432:5:433:24 | Wrapper | +| pattern_matching.rs:434:27:434:28 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:435:11:435:17 | wrapper | | pattern_matching.rs:432:5:433:24 | Wrapper | +| pattern_matching.rs:436:9:436:18 | Wrapper(...) | | pattern_matching.rs:432:5:433:24 | Wrapper | +| pattern_matching.rs:436:17:436:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:437:17:437:29 | wrapped_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:437:33:437:33 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:438:22:438:34 | "Wrapped: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:438:22:438:34 | "Wrapped: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:438:22:438:49 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:438:22:438:49 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:438:37:438:49 | wrapped_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:444:18:444:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:444:24:444:27 | 2i64 | | {EXTERNAL LOCATION} | i64 | +| pattern_matching.rs:444:30:444:35 | 3.0f32 | | {EXTERNAL LOCATION} | f32 | +| pattern_matching.rs:448:10:448:10 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:448:13:448:13 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:448:16:448:18 | 3.0 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:450:22:450:40 | "Exact tuple: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:450:22:450:40 | "Exact tuple: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:450:22:450:53 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:450:22:450:53 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:456:22:456:42 | "Tuple: ({}, {}, {})\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:456:22:456:42 | "Tuple: ({}, {}, {})\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:456:22:456:79 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:456:22:456:79 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:464:22:464:40 | "First element: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:464:22:464:40 | "First element: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:464:22:464:53 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:464:22:464:53 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:473:22:473:39 | "Unit value: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:473:22:473:39 | "Unit value: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:473:22:473:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:473:22:473:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:478:19:478:23 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:482:22:482:47 | "Single element tuple: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:482:22:482:47 | "Single element tuple: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:482:22:482:60 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:482:22:482:60 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:488:9:488:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:488:17:488:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:491:11:491:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:492:9:492:11 | (...) | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:492:10:492:10 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:493:17:493:27 | paren_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:493:31:493:31 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:494:22:494:48 | "Parenthesized pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:494:22:494:48 | "Parenthesized pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:494:22:494:61 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:494:22:494:61 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:494:51:494:61 | paren_bound | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:499:18:499:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:499:24:499:27 | 2i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:504:22:504:53 | "Parenthesized in tuple: {}, {... | | file://:0:0:0:0 | & | +| pattern_matching.rs:504:22:504:53 | "Parenthesized in tuple: {}, {... | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:504:22:504:71 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:504:22:504:71 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:510:9:510:13 | slice | | file://:0:0:0:0 | & | +| pattern_matching.rs:510:9:510:13 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:9:510:13 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:9:510:13 | slice | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:9:510:13 | slice | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:25:510:40 | &... | | file://:0:0:0:0 | & | +| pattern_matching.rs:510:25:510:40 | &... | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:25:510:40 | &... | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:25:510:40 | &... | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:25:510:40 | &... | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:26:510:40 | [...] | | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:26:510:40 | [...] | | file://:0:0:0:0 | [] | +| pattern_matching.rs:510:26:510:40 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:26:510:40 | [...] | [T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:27:510:27 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:30:510:30 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:33:510:33 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:36:510:36 | 4 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:510:39:510:39 | 5 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:513:11:513:15 | slice | | file://:0:0:0:0 | & | +| pattern_matching.rs:513:11:513:15 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:513:11:513:15 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:513:11:513:15 | slice | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:513:11:513:15 | slice | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:514:9:514:10 | SlicePat | | file://:0:0:0:0 | & | +| pattern_matching.rs:514:9:514:10 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:514:9:514:10 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:514:9:514:10 | SlicePat | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:514:9:514:10 | SlicePat | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:515:17:515:27 | empty_slice | | file://:0:0:0:0 | & | +| pattern_matching.rs:515:17:515:27 | empty_slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:515:17:515:27 | empty_slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:515:17:515:27 | empty_slice | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:515:17:515:27 | empty_slice | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:515:31:515:35 | slice | | file://:0:0:0:0 | & | +| pattern_matching.rs:515:31:515:35 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:515:31:515:35 | slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:515:31:515:35 | slice | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:515:31:515:35 | slice | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:516:22:516:40 | "Empty slice: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:516:22:516:40 | "Empty slice: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:516:22:516:53 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:516:22:516:53 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:516:43:516:53 | empty_slice | | file://:0:0:0:0 | & | +| pattern_matching.rs:516:43:516:53 | empty_slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:516:43:516:53 | empty_slice | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:516:43:516:53 | empty_slice | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:516:43:516:53 | empty_slice | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:518:9:518:11 | SlicePat | | file://:0:0:0:0 | & | +| pattern_matching.rs:518:9:518:11 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:518:9:518:11 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:518:9:518:11 | SlicePat | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:518:9:518:11 | SlicePat | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:520:22:520:41 | "Single element: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:520:22:520:41 | "Single element: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:520:22:520:54 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:520:22:520:54 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:522:9:522:23 | SlicePat | | file://:0:0:0:0 | & | +| pattern_matching.rs:522:9:522:23 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:522:9:522:23 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:522:9:522:23 | SlicePat | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:522:9:522:23 | SlicePat | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:525:22:525:43 | "Two elements: {}, {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:525:22:525:43 | "Two elements: {}, {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:525:22:525:70 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:525:22:525:70 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:527:9:527:34 | SlicePat | | file://:0:0:0:0 | & | +| pattern_matching.rs:527:9:527:34 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:527:9:527:34 | SlicePat | &T | file://:0:0:0:0 | [] | +| pattern_matching.rs:527:9:527:34 | SlicePat | &T.[T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:527:9:527:34 | SlicePat | &T.[T] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:532:17:532:53 | "First: {}, last: {}, middle l... | | file://:0:0:0:0 | & | +| pattern_matching.rs:532:17:532:53 | "First: {}, last: {}, middle l... | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:532:17:535:34 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:532:17:535:34 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:541:9:541:13 | array | | file://:0:0:0:0 | [] | +| pattern_matching.rs:541:9:541:13 | array | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:541:17:541:28 | [...] | | file://:0:0:0:0 | [] | +| pattern_matching.rs:541:17:541:28 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:541:18:541:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:541:24:541:24 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:541:27:541:27 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:542:11:542:15 | array | | file://:0:0:0:0 | [] | +| pattern_matching.rs:542:11:542:15 | array | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:543:9:543:17 | SlicePat | | file://:0:0:0:0 | [] | +| pattern_matching.rs:543:9:543:17 | SlicePat | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:547:22:547:49 | "Array elements: {}, {}, {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:547:22:547:49 | "Array elements: {}, {}, {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:547:22:547:70 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:547:22:547:70 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:554:27:554:28 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:555:9:555:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:555:17:555:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:557:11:557:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:558:9:558:16 | CONSTANT | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:559:17:559:27 | const_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:559:31:559:35 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:560:22:560:43 | "Matches constant: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:560:22:560:43 | "Matches constant: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:560:22:560:56 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:560:22:560:56 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:560:46:560:56 | const_match | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:562:9:562:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:566:9:566:14 | option | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:566:9:566:14 | option | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:566:18:566:38 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:566:18:566:38 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:566:33:566:37 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:567:11:567:16 | option | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:567:11:567:16 | option | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:568:9:568:22 | ...::None | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:568:9:568:22 | ...::None | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:569:22:569:35 | "None variant\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:569:22:569:35 | "None variant\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:569:22:569:35 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:569:22:569:35 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:571:9:571:25 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:571:9:571:25 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:571:24:571:24 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:572:17:572:26 | some_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:572:30:572:30 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:573:22:573:37 | "Some value: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:573:22:573:37 | "Some value: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:573:22:573:49 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:573:22:573:49 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:573:40:573:49 | some_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:578:11:578:51 | ...::Ok::<...>(...) | | {EXTERNAL LOCATION} | Result | +| pattern_matching.rs:578:11:578:51 | ...::Ok::<...>(...) | E | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:578:11:578:51 | ...::Ok::<...>(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:578:49:578:50 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:579:9:579:34 | ...::Ok(...) | | {EXTERNAL LOCATION} | Result | +| pattern_matching.rs:579:9:579:34 | ...::Ok(...) | E | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:579:9:579:34 | ...::Ok(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:579:33:579:33 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:580:17:580:24 | ok_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:580:28:580:28 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:581:22:581:35 | "Ok value: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:581:22:581:35 | "Ok value: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:581:22:581:45 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:581:22:581:45 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:581:38:581:45 | ok_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:583:9:583:35 | ...::Err(...) | | {EXTERNAL LOCATION} | Result | +| pattern_matching.rs:583:9:583:35 | ...::Err(...) | E | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:583:9:583:35 | ...::Err(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:583:34:583:34 | e | | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:584:17:584:25 | err_value | | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:584:29:584:29 | e | | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:585:22:585:32 | "Error: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:585:22:585:32 | "Error: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:585:22:585:43 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:585:22:585:43 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:585:35:585:43 | err_value | | {EXTERNAL LOCATION} | usize | +| pattern_matching.rs:591:9:591:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:591:17:591:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:594:11:594:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:595:9:595:9 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:595:9:595:17 | 1 \| 2 \| 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:595:13:595:13 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:595:17:595:17 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:596:17:596:25 | small_num | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:596:29:596:33 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:597:22:597:39 | "Small number: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:597:22:597:39 | "Small number: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:597:22:597:50 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:597:22:597:50 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:597:42:597:50 | small_num | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:599:9:599:10 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:599:9:599:15 | 10 \| 20 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:599:14:599:15 | 20 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:600:17:600:25 | round_num | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:600:29:600:33 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:601:22:601:39 | "Round number: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:601:22:601:39 | "Round number: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:601:22:601:50 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:601:22:601:50 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:601:42:601:50 | round_num | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:603:9:603:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:607:9:607:13 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:607:17:607:36 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:607:28:607:28 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:607:34:607:34 | 5 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:608:11:608:15 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:609:9:609:29 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:609:9:609:53 | ... \| ... | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:609:20:609:20 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:609:24:609:24 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:609:27:609:27 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:609:33:609:53 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:609:41:609:41 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:609:47:609:47 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:609:51:609:51 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:610:17:610:22 | axis_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:610:26:610:26 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:611:17:611:22 | axis_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:611:26:611:26 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:612:22:612:46 | "Point on axis: ({}, {})\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:612:22:612:46 | "Point on axis: ({}, {})\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:612:22:612:62 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:612:22:612:62 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:612:49:612:54 | axis_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:612:57:612:62 | axis_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:614:9:614:9 | _ | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:618:11:618:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:9:619:9 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:9:619:14 | RangePat | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:9:619:25 | ... \| ... | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:13:619:14 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:18:619:19 | 90 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:18:619:25 | RangePat | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:619:23:619:25 | 100 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:620:17:620:30 | range_or_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:620:34:620:38 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:621:22:621:35 | "In range: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:621:22:621:35 | "In range: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:621:22:621:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:621:22:621:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:621:38:621:51 | range_or_value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:623:9:623:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:628:18:628:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:628:24:628:27 | 2i64 | | {EXTERNAL LOCATION} | i64 | +| pattern_matching.rs:628:30:628:35 | 3.0f32 | | {EXTERNAL LOCATION} | f32 | +| pattern_matching.rs:628:38:628:40 | 4u8 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:634:22:634:42 | "First with rest: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:634:22:634:42 | "First with rest: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:634:22:634:54 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:634:22:634:54 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:641:22:641:41 | "Last with rest: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:641:22:641:41 | "Last with rest: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:641:22:641:52 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:641:22:641:52 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:649:22:649:45 | "First and last: {}, {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:649:22:649:45 | "First and last: {}, {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:649:22:649:67 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:649:22:649:67 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:654:9:654:13 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:654:17:654:38 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:654:28:654:29 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:654:35:654:36 | 20 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:655:11:655:15 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:656:9:656:23 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:656:17:656:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:657:17:657:22 | rest_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:657:26:657:26 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:658:22:658:39 | "X coordinate: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:658:22:658:39 | "X coordinate: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:658:22:658:47 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:658:22:658:47 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:658:42:658:47 | rest_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:665:17:665:18 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:666:17:666:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:681:21:681:25 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:681:21:681:25 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:681:28:681:29 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:682:21:682:25 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:682:21:682:25 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:682:28:682:28 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:25:687:44 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:687:36:687:36 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:42:687:42 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:47:687:78 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:687:47:687:78 | ...::Some(...) | T | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:687:62:687:77 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:687:68:687:70 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:68:687:70 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:687:73:687:73 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:73:687:73 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:687:76:687:76 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:687:76:687:76 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:691:10:691:26 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:691:21:691:21 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:691:24:691:24 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:691:29:691:60 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:691:29:691:60 | ...::Some(...) | T | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:691:44:691:59 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:691:50:691:52 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:691:50:691:52 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:691:55:691:55 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:691:58:691:58 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:692:17:692:24 | nested_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:692:28:692:28 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:693:17:693:24 | nested_g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:693:28:693:28 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:694:17:694:24 | nested_b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:694:28:694:28 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:696:17:696:57 | "Complex nested: y={}, green={... | | file://:0:0:0:0 | & | +| pattern_matching.rs:696:17:696:57 | "Complex nested: y={}, green={... | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:696:17:697:44 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:696:17:697:44 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:697:17:697:24 | nested_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:697:27:697:34 | nested_g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:697:37:697:44 | nested_b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:701:10:701:24 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:701:18:701:18 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:701:46:701:65 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:701:57:701:57 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:701:59:701:59 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:702:17:702:29 | alt_complex_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:702:33:702:33 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:703:22:703:50 | "Alternative complex: x={:?}\\n... | | file://:0:0:0:0 | & | +| pattern_matching.rs:703:22:703:50 | "Alternative complex: x={:?}\\n... | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:703:22:703:65 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:703:22:703:65 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:703:53:703:65 | alt_complex_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:708:22:708:47 | "Other complex data: {:?}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:708:22:708:47 | "Other complex data: {:?}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:708:22:708:62 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:708:22:708:62 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:715:9:715:13 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:715:17:715:38 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:715:28:715:29 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:715:35:715:36 | 20 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:716:9:716:22 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:716:17:716:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:716:20:716:20 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:716:26:716:30 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:717:9:717:13 | let_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:717:17:717:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:718:9:718:13 | let_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:718:17:718:17 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:720:18:720:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:720:24:720:27 | 2i64 | | {EXTERNAL LOCATION} | i64 | +| pattern_matching.rs:720:30:720:35 | 3.0f32 | | {EXTERNAL LOCATION} | f32 | +| pattern_matching.rs:726:9:726:13 | array | | file://:0:0:0:0 | [] | +| pattern_matching.rs:726:9:726:13 | array | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:17:726:34 | [...] | | file://:0:0:0:0 | [] | +| pattern_matching.rs:726:17:726:34 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:18:726:21 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:24:726:24 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:27:726:27 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:30:726:30 | 4 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:726:33:726:33 | 5 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:727:9:727:25 | SlicePat | | file://:0:0:0:0 | [] | +| pattern_matching.rs:727:9:727:25 | SlicePat | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:727:29:727:33 | array | | file://:0:0:0:0 | [] | +| pattern_matching.rs:727:29:727:33 | array | [T;...] | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:731:9:731:13 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:731:17:731:34 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:731:23:731:25 | 255 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:731:23:731:25 | 255 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:731:28:731:30 | 128 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:731:28:731:30 | 128 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:731:33:731:33 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:731:33:731:33 | 0 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:732:9:732:22 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:732:15:732:15 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:732:18:732:18 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:732:21:732:21 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:732:26:732:30 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:733:9:733:13 | let_r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:733:17:733:17 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:734:9:734:13 | let_g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:734:17:734:17 | g | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:735:9:735:13 | let_b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:735:17:735:17 | b | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:738:9:738:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:738:17:738:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:739:13:739:19 | ref_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:739:13:739:19 | ref_val | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:739:23:739:27 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:740:9:740:15 | let_ref | | file://:0:0:0:0 | & | +| pattern_matching.rs:740:9:740:15 | let_ref | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:740:19:740:25 | ref_val | | file://:0:0:0:0 | & | +| pattern_matching.rs:740:19:740:25 | ref_val | &T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:743:13:743:19 | mut_val | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:743:23:743:27 | 10i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:744:9:744:15 | let_mut | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:744:19:744:25 | mut_val | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:750:22:750:35 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:750:30:750:30 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:750:33:750:33 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:751:13:751:19 | param_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:751:23:751:23 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:752:13:752:19 | param_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:752:23:752:23 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:753:10:753:16 | param_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:753:19:753:25 | param_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:756:22:756:35 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:756:28:756:28 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:756:31:756:31 | _ | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:756:34:756:34 | _ | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:756:51:759:5 | { ... } | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:757:13:757:19 | param_r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:757:23:757:23 | r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:758:9:758:15 | param_r | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:768:9:768:13 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:768:17:768:37 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:768:28:768:28 | 5 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:768:34:768:35 | 10 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:769:35:769:39 | point | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:771:9:771:13 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:771:17:771:35 | Color(...) | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:771:23:771:25 | 200 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:771:23:771:25 | 200 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:771:28:771:30 | 100 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:771:28:771:30 | 100 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:771:33:771:34 | 50 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:771:33:771:34 | 50 | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:772:9:772:11 | red | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:772:15:772:34 | extract_color(...) | | {EXTERNAL LOCATION} | u8 | +| pattern_matching.rs:772:29:772:33 | color | | pattern_matching.rs:142:1:143:25 | Color | +| pattern_matching.rs:774:18:774:22 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:774:25:774:31 | 3.14f64 | | {EXTERNAL LOCATION} | f64 | +| pattern_matching.rs:774:34:774:37 | true | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:780:23:780:42 | (...) | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:780:23:780:42 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:780:34:780:34 | 1 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:780:40:780:40 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:780:45:780:64 | (...) | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:780:45:780:64 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:780:56:780:56 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:780:62:780:62 | 4 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:781:9:781:22 | Point {...} | | pattern_matching.rs:135:1:140:1 | Point | +| pattern_matching.rs:781:17:781:17 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:781:20:781:20 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:782:13:782:18 | loop_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:782:22:782:22 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:783:13:783:18 | loop_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:783:22:783:22 | y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:784:18:784:42 | "Point in loop: ({}, {})\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:784:18:784:42 | "Point in loop: ({}, {})\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:784:18:784:58 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:784:18:784:58 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:784:45:784:50 | loop_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:784:53:784:58 | loop_y | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:788:9:788:20 | option_value | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:788:9:788:20 | option_value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:788:24:788:44 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:788:24:788:44 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:788:39:788:43 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:789:12:789:33 | ...::Some(...) | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:789:12:789:33 | ...::Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:789:27:789:27 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:789:31:789:32 | 42 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:789:37:789:48 | option_value | | pattern_matching.rs:152:1:156:1 | MyOption | +| pattern_matching.rs:789:37:789:48 | option_value | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:790:13:790:20 | if_let_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:790:24:790:24 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:791:18:791:44 | "If let with @ pattern: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:791:18:791:44 | "If let with @ pattern: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:791:18:791:54 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:791:18:791:54 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:791:47:791:54 | if_let_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:795:13:795:17 | stack | | {EXTERNAL LOCATION} | Vec | +| pattern_matching.rs:795:13:795:17 | stack | A | {EXTERNAL LOCATION} | Global | +| pattern_matching.rs:795:13:795:17 | stack | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:795:31:795:46 | MacroExpr | | {EXTERNAL LOCATION} | Vec | +| pattern_matching.rs:795:31:795:46 | MacroExpr | A | {EXTERNAL LOCATION} | Global | +| pattern_matching.rs:795:31:795:46 | MacroExpr | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:795:36:795:39 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:795:42:795:42 | 2 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:795:45:795:45 | 3 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:796:15:796:21 | Some(...) | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:796:15:796:21 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:796:20:796:20 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:796:25:796:29 | stack | | {EXTERNAL LOCATION} | Vec | +| pattern_matching.rs:796:25:796:29 | stack | A | {EXTERNAL LOCATION} | Global | +| pattern_matching.rs:796:25:796:29 | stack | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:796:25:796:35 | stack.pop() | | {EXTERNAL LOCATION} | Option | +| pattern_matching.rs:796:25:796:35 | stack.pop() | T | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:797:13:797:23 | while_let_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:797:27:797:27 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:798:18:798:29 | "Popped: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:798:18:798:29 | "Popped: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:798:18:798:42 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:798:18:798:42 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:798:32:798:42 | while_let_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:802:9:802:13 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:802:17:802:21 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:803:11:803:15 | value | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:804:9:804:9 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:804:14:804:14 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:804:14:804:18 | ... > ... | | {EXTERNAL LOCATION} | bool | +| pattern_matching.rs:804:18:804:18 | 0 | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:805:17:805:23 | guard_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:805:27:805:27 | x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:806:22:806:35 | "Positive: {}\\n" | | file://:0:0:0:0 | & | +| pattern_matching.rs:806:22:806:35 | "Positive: {}\\n" | &T | {EXTERNAL LOCATION} | str | +| pattern_matching.rs:806:22:806:44 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:806:22:806:44 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| pattern_matching.rs:806:38:806:44 | guard_x | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:808:9:808:9 | _ | | {EXTERNAL LOCATION} | i32 | +| pattern_matching.rs:813:5:813:7 | f(...) | | {EXTERNAL LOCATION} | Option | testFailures From 519905ee9e55ae7a748b04311d8f88d2e6574fed Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Jul 2025 15:02:04 +0200 Subject: [PATCH 89/96] Rust: type inference: add test for closure argument --- .../test/library-tests/type-inference/main.rs | 10 ++++++++++ .../type-inference/type-inference.expected | 18 +++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index bdce6f53326..7ab3e0775d7 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2378,6 +2378,15 @@ pub mod pattern_matching_experimental { } } +mod closures { + pub fn f() { + Some(1).map(|x| { + let x = x; // $ MISSING: type=x:i32 + println!("{x}"); + }); // $ method=map + } +} + fn main() { field_access::f(); // $ method=f method_impl::f(); // $ method=f @@ -2408,4 +2417,5 @@ fn main() { dereference::test(); // $ method=test pattern_matching::test_all_patterns(); // $ method=test_all_patterns pattern_matching_experimental::box_patterns(); // $ method=box_patterns + closures::f() // $ method=f } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index d6b21fe08b7..904b4ca24bf 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -4112,11 +4112,19 @@ inferType | main.rs:2375:26:2375:43 | "Nested boxed: {}\\n" | &T | {EXTERNAL LOCATION} | str | | main.rs:2375:26:2375:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | | main.rs:2375:26:2375:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | -| main.rs:2383:5:2383:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2384:5:2384:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2384:20:2384:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2384:41:2384:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2400:5:2400:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| main.rs:2383:9:2383:15 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2383:9:2383:15 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2383:9:2386:10 | ... .map(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2383:14:2383:14 | 1 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2385:22:2385:26 | "{x}\\n" | | file://:0:0:0:0 | & | +| main.rs:2385:22:2385:26 | "{x}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2385:22:2385:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2385:22:2385:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments | +| main.rs:2392:5:2392:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2393:5:2393:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2393:20:2393:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2393:41:2393:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2409:5:2409:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | | pattern_matching.rs:13:26:133:1 | { ... } | | {EXTERNAL LOCATION} | Option | | pattern_matching.rs:14:9:14:13 | value | | {EXTERNAL LOCATION} | Option | | pattern_matching.rs:14:9:14:13 | value | T | {EXTERNAL LOCATION} | i32 | From 33ea822f404de50f616d86bcf11d2f6f63a1f778 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:09:43 +0100 Subject: [PATCH 90/96] Rust: Workaround for type inference issue in the test. --- .../test/library-tests/frameworks/rusqlite/main.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rust/ql/test/library-tests/frameworks/rusqlite/main.rs b/rust/ql/test/library-tests/frameworks/rusqlite/main.rs index e5c975e0ac8..324ee5be8fa 100644 --- a/rust/ql/test/library-tests/frameworks/rusqlite/main.rs +++ b/rust/ql/test/library-tests/frameworks/rusqlite/main.rs @@ -30,19 +30,21 @@ fn main() -> Result<(), Box> { connection.execute(&query, ())?; // $ sql-sink let person = connection.query_row(&query, (), |row| { // $ sql-sink + let row: &rusqlite::Row<'_> = row; Ok(Person { - id: row.get(0)?, // $ MISSING: database-read - name: row.get(1)?, // $ MISSING: database-read - age: row.get(2)?, // $ MISSING: database-read + id: row.get(0)?, // $ database-read + name: row.get(1)?, // $ database-read + age: row.get(2)?, // $ database-read }) })?; let mut stmt = connection.prepare("SELECT id, name, age FROM person")?; // $ sql-sink let people = stmt.query_map([], |row| { + let row: &rusqlite::Row<'_> = row; Ok(Person { - id: row.get_unwrap(0), // $ MISSING: database-read - name: row.get_unwrap(1), // $ MISSING: database-read - age: row.get_unwrap(2), // $ MISSING: database-read + id: row.get_unwrap(0), // $ database-read + name: row.get_unwrap(1), // $ database-read + age: row.get_unwrap(2), // $ database-read }) })?; From 68a37f99e37a5e3a14466d98e179cf4c7060ba59 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:04:33 +0100 Subject: [PATCH 91/96] Rust: Add something similar as a type inference test case. --- .../test/library-tests/type-inference/main.rs | 36 +++++++ .../type-inference/type-inference.expected | 96 ++++++++++++------- 2 files changed, 96 insertions(+), 36 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 81b9e5eb4b1..0911d52402a 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2256,6 +2256,41 @@ mod tuples { } } +mod closures { + struct Row { + data: i64, + } + + impl Row { + fn get(&self) -> i64 { + self.data // $ fieldof=Row + } + } + + struct Table { + rows: Vec, + } + + impl Table { + fn new() -> Self { + Table { rows: Vec::new() } // $ method=new + } + + fn count_with(&self, property: impl Fn(Row) -> bool) -> i64 { + 0 // (not implemented) + } + } + + pub fn f() { + let table = Table::new(); // $ method=new type=table:Table + let result = table.count_with(|row| // $ type=result:i64 + { + let v = row.get(); // $ MISSING: method=get type=v:i64 + v > 0 // $ MISSING: method=gt + }); // $ method=count_with + } +} + fn main() { field_access::f(); // $ method=f method_impl::f(); // $ method=f @@ -2283,6 +2318,7 @@ fn main() { macros::f(); // $ method=f method_determined_by_argument_type::f(); // $ method=f tuples::f(); // $ method=f + closures::f(); // $ method=f dereference::test(); // $ method=test } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 82b2668b513..57244461248 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -3639,40 +3639,64 @@ inferType | main.rs:2236:14:2236:18 | S1 {...} | | main.rs:2232:5:2232:16 | S1 | | main.rs:2236:21:2236:25 | S1 {...} | | main.rs:2232:5:2232:16 | S1 | | main.rs:2238:16:2238:19 | SelfParam | | main.rs:2232:5:2232:16 | S1 | -| main.rs:2261:5:2261:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:5:2262:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:20:2262:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2262:41:2262:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | -| main.rs:2278:5:2278:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | -| main.rs:2290:44:2309:5 | { ... } | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:13:2291:17 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:13:2291:17 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2291:21:2291:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| main.rs:2291:21:2291:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2291:26:2291:27 | 42 | | {EXTERNAL LOCATION} | i32 | -| main.rs:2292:29:2292:33 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2292:29:2292:33 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2294:22:2294:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2294:22:2294:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2296:15:2296:19 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2296:15:2296:19 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2299:26:2299:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2299:26:2299:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2303:13:2303:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2303:20:2303:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2303:20:2303:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2303:20:2303:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | -| main.rs:2304:13:2304:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2304:20:2304:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2305:18:2305:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2305:18:2305:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2305:20:2305:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:13:2306:16 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:20:2306:24 | value | | {EXTERNAL LOCATION} | Option | -| main.rs:2306:20:2306:24 | value | T | {EXTERNAL LOCATION} | i32 | -| main.rs:2306:20:2306:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | -| main.rs:2307:18:2307:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | -| main.rs:2307:18:2307:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | -| main.rs:2307:20:2307:23 | mesg | | {EXTERNAL LOCATION} | i32 | -| main.rs:2308:9:2308:12 | None | | {EXTERNAL LOCATION} | Option | +| main.rs:2265:16:2265:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:2265:16:2265:20 | SelfParam | &T | main.rs:2260:5:2262:5 | Row | +| main.rs:2265:30:2267:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2266:13:2266:16 | self | | file://:0:0:0:0 | & | +| main.rs:2266:13:2266:16 | self | &T | main.rs:2260:5:2262:5 | Row | +| main.rs:2266:13:2266:21 | self.data | | {EXTERNAL LOCATION} | i64 | +| main.rs:2275:26:2277:9 | { ... } | | main.rs:2270:5:2272:5 | Table | +| main.rs:2276:13:2276:38 | Table {...} | | main.rs:2270:5:2272:5 | Table | +| main.rs:2276:27:2276:36 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | +| main.rs:2276:27:2276:36 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| main.rs:2276:27:2276:36 | ...::new(...) | T | main.rs:2260:5:2262:5 | Row | +| main.rs:2279:23:2279:27 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:2279:23:2279:27 | SelfParam | &T | main.rs:2270:5:2272:5 | Table | +| main.rs:2279:30:2279:37 | property | | main.rs:2279:40:2279:59 | ImplTraitTypeRepr | +| main.rs:2279:69:2281:9 | { ... } | | {EXTERNAL LOCATION} | i32 | +| main.rs:2279:69:2281:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| main.rs:2280:13:2280:13 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2280:13:2280:13 | 0 | | {EXTERNAL LOCATION} | i64 | +| main.rs:2285:13:2285:17 | table | | main.rs:2270:5:2272:5 | Table | +| main.rs:2285:21:2285:32 | ...::new(...) | | main.rs:2270:5:2272:5 | Table | +| main.rs:2286:13:2286:18 | result | | {EXTERNAL LOCATION} | i64 | +| main.rs:2286:22:2286:26 | table | | main.rs:2270:5:2272:5 | Table | +| main.rs:2286:22:2290:14 | table.count_with(...) | | {EXTERNAL LOCATION} | i64 | +| main.rs:2289:21:2289:21 | 0 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2296:5:2296:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2297:5:2297:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo | +| main.rs:2297:20:2297:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2297:41:2297:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | +| main.rs:2313:5:2313:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | +| main.rs:2326:44:2345:5 | { ... } | | {EXTERNAL LOCATION} | Option | +| main.rs:2327:13:2327:17 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2327:13:2327:17 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2327:21:2327:28 | Some(...) | | {EXTERNAL LOCATION} | Option | +| main.rs:2327:21:2327:28 | Some(...) | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2327:26:2327:27 | 42 | | {EXTERNAL LOCATION} | i32 | +| main.rs:2328:29:2328:33 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2328:29:2328:33 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2330:22:2330:29 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2330:22:2330:29 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2332:15:2332:19 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2332:15:2332:19 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2335:26:2335:33 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2335:26:2335:33 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2339:13:2339:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2339:20:2339:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2339:20:2339:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2339:20:2339:33 | value.unwrap() | | {EXTERNAL LOCATION} | i32 | +| main.rs:2340:13:2340:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2340:20:2340:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2341:18:2341:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2341:18:2341:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2341:20:2341:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2342:13:2342:16 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2342:20:2342:24 | value | | {EXTERNAL LOCATION} | Option | +| main.rs:2342:20:2342:24 | value | T | {EXTERNAL LOCATION} | i32 | +| main.rs:2342:20:2342:25 | TryExpr | | {EXTERNAL LOCATION} | i32 | +| main.rs:2343:18:2343:25 | "{mesg}\\n" | | file://:0:0:0:0 | & | +| main.rs:2343:18:2343:25 | "{mesg}\\n" | &T | {EXTERNAL LOCATION} | str | +| main.rs:2343:20:2343:23 | mesg | | {EXTERNAL LOCATION} | i32 | +| main.rs:2344:9:2344:12 | None | | {EXTERNAL LOCATION} | Option | testFailures From 6ac0f0e031445a6d66cfe0f5cae27b677043e840 Mon Sep 17 00:00:00 2001 From: AdnaneKhan Date: Fri, 11 Jul 2025 12:11:58 -0400 Subject: [PATCH 92/96] Fix change note filename. --- .../{2025-07-08.md => 2025-07-11-artifact-poisoning.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename actions/ql/lib/change-notes/{2025-07-08.md => 2025-07-11-artifact-poisoning.md} (100%) diff --git a/actions/ql/lib/change-notes/2025-07-08.md b/actions/ql/lib/change-notes/2025-07-11-artifact-poisoning.md similarity index 100% rename from actions/ql/lib/change-notes/2025-07-08.md rename to actions/ql/lib/change-notes/2025-07-11-artifact-poisoning.md From 05e1cd437d1a30d4a94100d6a93152235efd8119 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:50:24 +0100 Subject: [PATCH 93/96] Rust: Fix garbled merge. --- .../PathResolutionConsistency.expected | 80 ------------------- 1 file changed, 80 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index cb76eafd64d..4bfd210265c 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -1,6 +1,5 @@ multipleCallTargets | test.rs:98:14:98:43 | ...::_print(...) | -<<<<<<< HEAD | test.rs:110:14:110:33 | ...::_print(...) | | test.rs:113:62:113:77 | ...::from(...) | | test.rs:120:58:120:73 | ...::from(...) | @@ -12,8 +11,6 @@ multipleCallTargets | test.rs:179:30:179:68 | ...::_print(...) | | test.rs:188:26:188:105 | ...::_print(...) | | test.rs:229:22:229:72 | ... .read_to_string(...) | -| test.rs:483:22:483:50 | file.read_to_end(...) | -| test.rs:489:22:489:53 | file.read_to_string(...) | | test.rs:610:18:610:38 | ...::_print(...) | | test.rs:615:18:615:45 | ...::_print(...) | | test.rs:619:25:619:49 | address.to_socket_addrs() | @@ -33,7 +30,6 @@ multipleCallTargets | test.rs:738:30:738:43 | ...::_print(...) | | test.rs:753:14:753:43 | ...::_print(...) | | test.rs:767:14:767:34 | ...::_print(...) | -| test.rs:778:23:778:80 | ...::try_from(...) | | test.rs:807:50:807:66 | ...::from(...) | | test.rs:807:50:807:66 | ...::from(...) | | test.rs:809:14:809:31 | ...::_print(...) | @@ -75,82 +71,6 @@ multipleCallTargets | test.rs:884:14:884:29 | ...::_print(...) | | test.rs:886:27:886:36 | ...::_print(...) | | test.rs:887:28:887:41 | ...::_print(...) | -| test_futures_io.rs:25:23:25:80 | ...::try_from(...) | -======= -| test.rs:109:14:109:33 | ...::_print(...) | -| test.rs:112:62:112:77 | ...::from(...) | -| test.rs:119:58:119:73 | ...::from(...) | -| test.rs:135:22:135:43 | ...::_print(...) | -| test.rs:140:22:140:43 | ...::_print(...) | -| test.rs:144:22:144:44 | ...::_print(...) | -| test.rs:160:26:160:110 | ...::_print(...) | -| test.rs:168:26:168:111 | ...::_print(...) | -| test.rs:178:30:178:68 | ...::_print(...) | -| test.rs:187:26:187:105 | ...::_print(...) | -| test.rs:228:22:228:72 | ... .read_to_string(...) | -| test.rs:482:22:482:50 | file.read_to_end(...) | -| test.rs:488:22:488:53 | file.read_to_string(...) | -| test.rs:609:18:609:38 | ...::_print(...) | -| test.rs:614:18:614:45 | ...::_print(...) | -| test.rs:618:25:618:49 | address.to_socket_addrs() | -| test.rs:632:38:632:42 | ...::_print(...) | -| test.rs:636:38:636:54 | ...::_print(...) | -| test.rs:641:38:641:51 | ...::_print(...) | -| test.rs:651:34:651:52 | ...::_print(...) | -| test.rs:670:14:670:43 | ...::_print(...) | -| test.rs:685:18:685:42 | ...::_print(...) | -| test.rs:689:18:689:42 | ...::_print(...) | -| test.rs:694:18:694:45 | ...::_print(...) | -| test.rs:701:30:701:34 | ...::_print(...) | -| test.rs:705:30:705:52 | ...::_print(...) | -| test.rs:714:30:714:43 | ...::_print(...) | -| test.rs:724:30:724:34 | ...::_print(...) | -| test.rs:728:30:728:52 | ...::_print(...) | -| test.rs:737:30:737:43 | ...::_print(...) | -| test.rs:752:14:752:43 | ...::_print(...) | -| test.rs:766:14:766:34 | ...::_print(...) | -| test.rs:806:50:806:66 | ...::from(...) | -| test.rs:806:50:806:66 | ...::from(...) | -| test.rs:808:14:808:31 | ...::_print(...) | -| test.rs:811:14:811:31 | ...::_print(...) | -| test.rs:814:14:814:31 | ...::_print(...) | -| test.rs:817:14:817:30 | ...::_print(...) | -| test.rs:819:27:819:36 | ...::_print(...) | -| test.rs:820:28:820:41 | ...::_print(...) | -| test.rs:823:14:823:33 | ...::_print(...) | -| test.rs:825:27:825:36 | ...::_print(...) | -| test.rs:826:28:826:41 | ...::_print(...) | -| test.rs:829:14:829:31 | ...::_print(...) | -| test.rs:831:27:831:36 | ...::_print(...) | -| test.rs:832:28:832:41 | ...::_print(...) | -| test.rs:835:14:835:34 | ...::_print(...) | -| test.rs:837:27:837:36 | ...::_print(...) | -| test.rs:838:28:838:41 | ...::_print(...) | -| test.rs:841:14:841:25 | ...::_print(...) | -| test.rs:843:27:843:36 | ...::_print(...) | -| test.rs:844:28:844:41 | ...::_print(...) | -| test.rs:847:14:847:31 | ...::_print(...) | -| test.rs:849:27:849:36 | ...::_print(...) | -| test.rs:850:28:850:41 | ...::_print(...) | -| test.rs:853:14:853:30 | ...::_print(...) | -| test.rs:855:27:855:36 | ...::_print(...) | -| test.rs:856:28:856:41 | ...::_print(...) | -| test.rs:859:14:859:33 | ...::_print(...) | -| test.rs:861:27:861:36 | ...::_print(...) | -| test.rs:862:28:862:41 | ...::_print(...) | -| test.rs:865:14:865:36 | ...::_print(...) | -| test.rs:867:27:867:36 | ...::_print(...) | -| test.rs:868:28:868:41 | ...::_print(...) | -| test.rs:871:14:871:38 | ...::_print(...) | -| test.rs:873:27:873:36 | ...::_print(...) | -| test.rs:874:28:874:41 | ...::_print(...) | -| test.rs:877:14:877:45 | ...::_print(...) | -| test.rs:879:27:879:36 | ...::_print(...) | -| test.rs:880:28:880:41 | ...::_print(...) | -| test.rs:883:14:883:29 | ...::_print(...) | -| test.rs:885:27:885:36 | ...::_print(...) | -| test.rs:886:28:886:41 | ...::_print(...) | ->>>>>>> main | test_futures_io.rs:35:26:35:63 | pinned.poll_read(...) | | test_futures_io.rs:62:22:62:50 | pinned.poll_fill_buf(...) | | test_futures_io.rs:69:23:69:67 | ... .poll_fill_buf(...) | From a6701ced8d6409273373294f947a4cea0e814fc0 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 13 Jul 2025 23:42:50 +0100 Subject: [PATCH 94/96] Kotlin: Update regex patterns to use raw string notation Fixes warnings like SyntaxWarning: invalid escape sequence '\S' --- java/kotlin-extractor/generate_dbscheme.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/kotlin-extractor/generate_dbscheme.py b/java/kotlin-extractor/generate_dbscheme.py index be0c5622ed1..2f839158d9a 100755 --- a/java/kotlin-extractor/generate_dbscheme.py +++ b/java/kotlin-extractor/generate_dbscheme.py @@ -35,10 +35,10 @@ def parse_dbscheme(filename): unions[name] = typs # tables - for relname, body in re.findall('\n([\w_]+)(\([^)]*\))', + for relname, body in re.findall(r'\n([\w_]+)(\([^)]*\))', dbscheme, flags=re.DOTALL): - columns = list(re.findall('(\S+)\s*:\s*([^\s,]+)(?:\s+(ref)|)', body)) + columns = list(re.findall(r'(\S+)\s*:\s*([^\s,]+)(?:\s+(ref)|)', body)) tables[relname] = columns parse_dbscheme(dbscheme) From c267a88f8893ec4e85ef03f05a7b07873478aa50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 03:37:24 +0000 Subject: [PATCH 95/96] Bump golang.org/x/tools --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-version: 0.35.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: extractor-dependencies ... Signed-off-by: dependabot[bot] --- go/extractor/go.mod | 4 ++-- go/extractor/go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go/extractor/go.mod b/go/extractor/go.mod index 40418a526a6..927cf8e0512 100644 --- a/go/extractor/go.mod +++ b/go/extractor/go.mod @@ -10,7 +10,7 @@ toolchain go1.24.0 // bazel mod tidy require ( golang.org/x/mod v0.26.0 - golang.org/x/tools v0.34.0 + golang.org/x/tools v0.35.0 ) -require golang.org/x/sync v0.15.0 // indirect +require golang.org/x/sync v0.16.0 // indirect diff --git a/go/extractor/go.sum b/go/extractor/go.sum index b7087a34048..58f0d0b933b 100644 --- a/go/extractor/go.sum +++ b/go/extractor/go.sum @@ -2,7 +2,7 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= From be7db8079a211fde06ac6abe97a58ab0f7ee2c83 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:58:23 +0100 Subject: [PATCH 96/96] Rust: Accept consistency check change (from CI). --- .../sources/CONSISTENCY/PathResolutionConsistency.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index 4bfd210265c..19b896ddee2 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -11,6 +11,8 @@ multipleCallTargets | test.rs:179:30:179:68 | ...::_print(...) | | test.rs:188:26:188:105 | ...::_print(...) | | test.rs:229:22:229:72 | ... .read_to_string(...) | +| test.rs:483:22:483:50 | file.read_to_end(...) | +| test.rs:489:22:489:53 | file.read_to_string(...) | | test.rs:610:18:610:38 | ...::_print(...) | | test.rs:615:18:615:45 | ...::_print(...) | | test.rs:619:25:619:49 | address.to_socket_addrs() |