Skip to content

Commit 2c744b1

Browse files
committed
Insert crate name in canonical path
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Insert a new segment with the crate's name as canonical's path prefix. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent b08becd commit 2c744b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gcc/rust/resolve/rust-forever-stack.hxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,12 @@ ForeverStack<N>::to_canonical_path (NodeId id) const
704704
return KeepGoing::Yes;
705705
});
706706

707-
auto path = Resolver::CanonicalPath::create_empty ();
707+
auto &mappings = Analysis::Mappings::get ();
708+
CrateNum crate_num = mappings.lookup_crate_num (root.id).value ();
709+
auto path = Resolver::CanonicalPath::new_seg (
710+
root.id, mappings.get_crate_name (crate_num).value ());
711+
path.set_crate_num (crate_num);
712+
708713
for (const auto &segment : segments)
709714
path = path.append (segment);
710715

0 commit comments

Comments
 (0)