Convert ast::def_id into a struct.
This commit is contained in:
@@ -93,7 +93,10 @@ type node_id = int;
|
||||
|
||||
#[auto_encode]
|
||||
#[auto_decode]
|
||||
type def_id = {crate: crate_num, node: node_id};
|
||||
struct def_id {
|
||||
crate: crate_num,
|
||||
node: node_id,
|
||||
}
|
||||
|
||||
impl def_id : cmp::Eq {
|
||||
pure fn eq(&self, other: &def_id) -> bool {
|
||||
|
||||
@@ -54,7 +54,9 @@ pure fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str {
|
||||
|
||||
pure fn path_to_ident(p: @path) -> ident { vec::last(p.idents) }
|
||||
|
||||
pure fn local_def(id: node_id) -> def_id { {crate: local_crate, node: id} }
|
||||
pure fn local_def(id: node_id) -> def_id {
|
||||
ast::def_id { crate: local_crate, node: id }
|
||||
}
|
||||
|
||||
pure fn is_local(did: ast::def_id) -> bool { did.crate == local_crate }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user