Skip to content

Commit e2d6643

Browse files
authored
Merge pull request #19072 from github/redsun82/rust-fix-canonical-paths-after-rename
Rust: fix canonical paths broken on `StructExpr` and `StructPath`
2 parents 022785a + b77c138 commit e2d6643

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

rust/extractor/src/translate/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ macro_rules! emit_detached {
5353
(PathExpr, $self:ident, $node:ident, $label:ident) => {
5454
$self.extract_path_canonical_destination(&$node, $label.into());
5555
};
56-
(RecordExpr, $self:ident, $node:ident, $label:ident) => {
56+
(StructExpr, $self:ident, $node:ident, $label:ident) => {
5757
$self.extract_path_canonical_destination(&$node, $label.into());
5858
};
5959
(PathPat, $self:ident, $node:ident, $label:ident) => {
6060
$self.extract_path_canonical_destination(&$node, $label.into());
6161
};
62-
(RecordPat, $self:ident, $node:ident, $label:ident) => {
62+
(StructPat, $self:ident, $node:ident, $label:ident) => {
6363
$self.extract_path_canonical_destination(&$node, $label.into());
6464
};
6565
(TupleStructPat, $self:ident, $node:ident, $label:ident) => {

rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ canonicalPaths
3636
| regular.rs:51:5:51:18 | Use | None | None |
3737
| regular.rs:57:1:63:1 | fn enum_match | repo::test | crate::regular::enum_match |
3838
resolvedPaths
39-
| anonymous.rs:27:17:27:30 | OtherStruct {...} | None | None |
39+
| anonymous.rs:27:17:27:30 | OtherStruct {...} | repo::test | {0}::OtherStruct |
4040
| anonymous.rs:28:9:28:9 | s | None | None |
4141
| anonymous.rs:28:9:28:13 | s.f(...) | repo::test | <{0}::OtherStruct as crate::regular::Trait>::f |
4242
| anonymous.rs:29:9:29:9 | s | None | None |
4343
| anonymous.rs:29:9:29:13 | s.g(...) | repo::test | <{0}::OtherStruct as {0}::OtherTrait>::g |
4444
| anonymous.rs:30:9:30:14 | nested | repo::test | {0}::nested |
45-
| regular.rs:27:13:27:21 | Struct {...} | None | None |
45+
| regular.rs:27:13:27:21 | Struct {...} | repo::test | crate::regular::Struct |
4646
| regular.rs:28:5:28:5 | s | None | None |
4747
| regular.rs:28:5:28:9 | s.f(...) | repo::test | <crate::regular::Struct as crate::regular::Trait>::f |
4848
| regular.rs:29:5:29:5 | s | None | None |
@@ -54,13 +54,13 @@ resolvedPaths
5454
| regular.rs:42:9:42:20 | ...::Some | lang:core | crate::option::Option::Some |
5555
| regular.rs:43:9:43:24 | ...::Variant1 | repo::test | crate::regular::MyEnum::Variant1 |
5656
| regular.rs:44:9:44:24 | ...::Variant2 | repo::test | crate::regular::MyEnum::Variant2 |
57-
| regular.rs:45:9:45:33 | ...::Variant3 {...} | None | None |
57+
| regular.rs:45:9:45:33 | ...::Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 |
5858
| regular.rs:49:9:49:18 | None::<...> | lang:core | crate::option::Option::None |
5959
| regular.rs:50:9:50:12 | Some | lang:core | crate::option::Option::Some |
6060
| regular.rs:52:9:52:16 | Variant1 | repo::test | crate::regular::MyEnum::Variant1 |
6161
| regular.rs:53:9:53:16 | Variant2 | repo::test | crate::regular::MyEnum::Variant2 |
62-
| regular.rs:54:9:54:25 | Variant3 {...} | None | None |
62+
| regular.rs:54:9:54:25 | Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 |
6363
| regular.rs:58:11:58:11 | e | None | None |
6464
| regular.rs:59:9:59:24 | ...::Variant1 | repo::test | crate::regular::MyEnum::Variant1 |
6565
| regular.rs:60:9:60:27 | ...::Variant2(...) | repo::test | crate::regular::MyEnum::Variant2 |
66-
| regular.rs:61:9:61:31 | ...::Variant3 {...} | None | None |
66+
| regular.rs:61:9:61:31 | ...::Variant3 {...} | repo::test | crate::regular::MyEnum::Variant3 |

0 commit comments

Comments
 (0)