Skip to content

Commit 7463e29

Browse files
Rebase fixes
1 parent f4ff238 commit 7463e29

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/librustc/hir/map/definitions.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub struct Definitions {
105105
/// we know what parent node that fragment should be attached to thanks to this table.
106106
invocation_parents: FxHashMap<ExpnId, DefIndex>,
107107
/// Indices of unnamed struct or variant fields with unresolved attributes.
108-
pub(super) placeholder_field_indices: NodeMap<usize>,
108+
pub placeholder_field_indices: NodeMap<usize>,
109109
}
110110

111111
/// A unique identifier that we can use to lookup a definition
@@ -544,6 +544,15 @@ impl Definitions {
544544
let old_parent = self.invocation_parents.insert(invoc_id, parent);
545545
assert!(old_parent.is_none(), "parent `DefIndex` is reset for an invocation");
546546
}
547+
548+
pub fn placeholder_field_index(&self, node_id: ast::NodeId) -> usize {
549+
self.placeholder_field_indices[&node_id]
550+
}
551+
552+
pub fn set_placeholder_field_index(&mut self, node_id: ast::NodeId, index: usize) {
553+
let old_index = self.placeholder_field_indices.insert(node_id, index);
554+
assert!(old_index.is_none(), "placeholder field index is reset for a node ID");
555+
}
547556
}
548557

549558
impl DefPathData {

0 commit comments

Comments
 (0)