diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-14 10:05:40 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-14 10:51:51 -0500 |
| commit | 7463e29efe65e4db9051f75d59799051e0a411b0 (patch) | |
| tree | 883f6f3ebef51dfd9218aba1e036e43893697145 | |
| parent | f4ff238a2e45e6412b9bf164e801a2e4809bdd3b (diff) | |
| download | rust-7463e29efe65e4db9051f75d59799051e0a411b0.tar.gz rust-7463e29efe65e4db9051f75d59799051e0a411b0.zip | |
Rebase fixes
| -rw-r--r-- | src/librustc/hir/map/definitions.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs index be8d82173e4..450ab947172 100644 --- a/src/librustc/hir/map/definitions.rs +++ b/src/librustc/hir/map/definitions.rs @@ -105,7 +105,7 @@ pub struct Definitions { /// we know what parent node that fragment should be attached to thanks to this table. invocation_parents: FxHashMap<ExpnId, DefIndex>, /// Indices of unnamed struct or variant fields with unresolved attributes. - pub(super) placeholder_field_indices: NodeMap<usize>, + pub placeholder_field_indices: NodeMap<usize>, } /// A unique identifier that we can use to lookup a definition @@ -544,6 +544,15 @@ impl Definitions { let old_parent = self.invocation_parents.insert(invoc_id, parent); assert!(old_parent.is_none(), "parent `DefIndex` is reset for an invocation"); } + + pub fn placeholder_field_index(&self, node_id: ast::NodeId) -> usize { + self.placeholder_field_indices[&node_id] + } + + pub fn set_placeholder_field_index(&mut self, node_id: ast::NodeId, index: usize) { + let old_index = self.placeholder_field_indices.insert(node_id, index); + assert!(old_index.is_none(), "placeholder field index is reset for a node ID"); + } } impl DefPathData { |
