Rust: Remove the canonical_path_disabled test entirely.

This commit is contained in:
Geoffrey White
2025-08-28 12:55:01 +01:00
parent 1e46dd8412
commit e860600712
5 changed files with 0 additions and 140 deletions

View File

@@ -1,7 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "test"
version = "0.0.1"

View File

@@ -1,39 +0,0 @@
// would prefer to write `include!("../canonical_paths/anonymous.rs");`
// but `include!` does not work with out-of-dir files
use super::regular::Trait;
fn canonicals() {
struct OtherStruct;
trait OtherTrait {
fn g(&self);
}
impl OtherTrait for OtherStruct {
fn g(&self) {}
}
impl OtherTrait for crate::regular::Struct {
fn g(&self) {}
}
impl crate::regular::Trait for OtherStruct {
fn f(&self) {}
}
fn nested() {
struct OtherStruct;
}
fn usage() {
let s = OtherStruct {};
s.f();
s.g();
nested();
}
}
fn other() {
struct OtherStruct;
}

View File

@@ -1,26 +0,0 @@
| anonymous.rs:6:1:35:1 | fn canonicals | test::anonymous::canonicals |
| anonymous.rs:37:1:39:1 | fn other | test::anonymous::other |
| {EXTERNAL LOCATION} | fn trim | <core::str>::trim |
| lib.rs:1:1:1:18 | mod anonymous | test::anonymous |
| lib.rs:2:1:2:16 | mod regular | test::regular |
| regular.rs:4:1:5:18 | struct Struct | test::regular::Struct |
| regular.rs:5:12:5:17 | fn eq | <test::regular::Struct as core::cmp::PartialEq>::eq |
| regular.rs:5:12:5:17 | impl ...::Eq for Struct::<...> { ... } | <test::regular::Struct as core::cmp::Eq> |
| regular.rs:5:12:5:17 | impl ...::PartialEq for Struct::<...> { ... } | <test::regular::Struct as core::cmp::PartialEq> |
| regular.rs:7:1:9:1 | trait Trait | test::regular::Trait |
| regular.rs:8:5:8:16 | fn f | <_ as test::regular::Trait>::f |
| regular.rs:11:1:13:1 | impl Trait for Struct { ... } | <test::regular::Struct as test::regular::Trait> |
| regular.rs:12:5:12:18 | fn f | <test::regular::Struct as test::regular::Trait>::f |
| regular.rs:15:1:17:1 | impl Struct { ... } | <test::regular::Struct> |
| regular.rs:16:5:16:18 | fn g | <test::regular::Struct>::g |
| regular.rs:19:1:21:1 | trait TraitWithBlanketImpl | test::regular::TraitWithBlanketImpl |
| regular.rs:20:5:20:16 | fn h | <_ as test::regular::TraitWithBlanketImpl>::h |
| regular.rs:27:1:27:12 | fn free | test::regular::free |
| regular.rs:29:1:35:1 | fn usage | test::regular::usage |
| regular.rs:37:1:41:1 | enum MyEnum | test::regular::MyEnum |
| regular.rs:38:5:38:12 | Variant1 | test::regular::MyEnum::Variant1 |
| regular.rs:39:5:39:19 | Variant2 | test::regular::MyEnum::Variant2 |
| regular.rs:40:5:40:25 | Variant3 | test::regular::MyEnum::Variant3 |
| regular.rs:43:1:49:1 | fn enum_qualified_usage | test::regular::enum_qualified_usage |
| regular.rs:51:1:58:1 | fn enum_unqualified_usage | test::regular::enum_unqualified_usage |
| regular.rs:60:1:66:1 | fn enum_match | test::regular::enum_match |

View File

@@ -1,2 +0,0 @@
query: extractor-tests/canonical_path/canonical_paths.ql
postprocess: utils/test/ExternalLocationPostProcessing.ql

View File

@@ -1,66 +0,0 @@
// would prefer to write `include!("../canonical_path/regular.rs");
// but `include!` does not work with out-of-dir files
#[derive(Eq, PartialEq)]
pub struct Struct;
pub trait Trait {
fn f(&self);
}
impl Trait for Struct {
fn f(&self) {}
}
impl Struct {
fn g(&self) {}
}
trait TraitWithBlanketImpl {
fn h(&self);
}
impl<T: Eq> TraitWithBlanketImpl for T {
fn h(&self) {}
}
fn free() {}
fn usage() {
let s = Struct {};
s.f();
s.g();
s.h();
free();
}
enum MyEnum {
Variant1,
Variant2(usize),
Variant3 { x: usize },
}
fn enum_qualified_usage() {
_ = Option::None::<()>;
_ = Option::Some(0);
_ = MyEnum::Variant1;
_ = MyEnum::Variant2(0);
_ = MyEnum::Variant3 { x: 1 };
}
fn enum_unqualified_usage() {
_ = None::<()>;
_ = Some(0);
use MyEnum::*;
_ = Variant1;
_ = Variant2(0);
_ = Variant3 { x: 1 };
}
fn enum_match(e: MyEnum) {
match e {
MyEnum::Variant1 => {}
MyEnum::Variant2(_) => {}
MyEnum::Variant3 { .. } => {}
}
}