Skip to content

Commit 2f8649a

Browse files
committed
Fix NodeId->HirId lookups by carrying structural context
- record child-slot paths, statement indices, and owner node IDs in AST span maps via the new child_slot vocabulary and NodeContextKey - teach SpanToHirMapper/HirMap to mirror that context, populate a context_to_hir_map, and fall back to it before the span-only mapping refactor: align struct field key trees with bitfield helpers
1 parent a2c2149 commit 2f8649a

File tree

4 files changed

+790
-45
lines changed

4 files changed

+790
-45
lines changed

c2rust-refactor/src/ast_manip/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ pub use self::load_modules::load_modules;
3535
pub use self::output_exprs::fold_output_exprs;
3636
pub use self::remove_paren::remove_paren;
3737
pub use self::seq_edit::{fold_blocks, fold_modules};
38-
pub use self::span_maps::{AstSpanMaps, NodeSpan, SpanNodeKind};
38+
pub use self::span_maps::{
39+
child_slot, AstSpanMaps, NodeContextKey, NodeSpan, SpanNodeKind, StructuralContext,
40+
};
3941
pub use self::visit::Visit;
4042
pub use self::visit_node::{visit_nodes, visit_nodes_post, VisitNode};
4143

0 commit comments

Comments
 (0)