Update metadata to reflect that predicates/schemes/trait-defs are now severed

This commit is contained in:
Niko Matsakis
2015-02-11 05:59:01 -05:00
parent cca1cf613b
commit acd1a0090a
5 changed files with 82 additions and 56 deletions

View File

@@ -366,6 +366,14 @@ pub struct DefId {
pub node: NodeId,
}
impl DefId {
/// Read the node id, asserting that this def-id is krate-local.
pub fn local_id(&self) -> NodeId {
assert_eq!(self.krate, LOCAL_CRATE);
self.node
}
}
/// Item definitions in the currently-compiled crate would have the CrateNum
/// LOCAL_CRATE in their DefId.
pub const LOCAL_CRATE: CrateNum = 0;