@@ -361,7 +361,7 @@ pub fn lookup_def(cnum: ast::CrateNum, data: @~[u8], did_: ast::def_id) ->
361
361
}
362
362
363
363
pub fn get_trait_def ( cdata : cmd ,
364
- item_id : ast:: node_id ,
364
+ item_id : ast:: NodeId ,
365
365
tcx : ty:: ctxt ) -> ty:: TraitDef
366
366
{
367
367
let item_doc = lookup_item ( item_id, cdata. data ) ;
@@ -375,7 +375,7 @@ pub fn get_trait_def(cdata: cmd,
375
375
}
376
376
}
377
377
378
- pub fn get_type ( cdata : cmd , id : ast:: node_id , tcx : ty:: ctxt )
378
+ pub fn get_type ( cdata : cmd , id : ast:: NodeId , tcx : ty:: ctxt )
379
379
-> ty:: ty_param_bounds_and_ty {
380
380
381
381
let item = lookup_item ( id, cdata. data ) ;
@@ -392,19 +392,19 @@ pub fn get_type(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
392
392
}
393
393
}
394
394
395
- pub fn get_region_param ( cdata : cmd , id : ast:: node_id )
395
+ pub fn get_region_param ( cdata : cmd , id : ast:: NodeId )
396
396
-> Option < ty:: region_variance > {
397
397
398
398
let item = lookup_item ( id, cdata. data ) ;
399
399
return item_ty_region_param ( item) ;
400
400
}
401
401
402
- pub fn get_type_param_count ( data : @~[ u8 ] , id : ast:: node_id ) -> uint {
402
+ pub fn get_type_param_count ( data : @~[ u8 ] , id : ast:: NodeId ) -> uint {
403
403
item_ty_param_count ( lookup_item ( id, data) )
404
404
}
405
405
406
406
pub fn get_impl_trait ( cdata : cmd ,
407
- id : ast:: node_id ,
407
+ id : ast:: NodeId ,
408
408
tcx : ty:: ctxt ) -> Option < @ty:: TraitRef >
409
409
{
410
410
let item_doc = lookup_item ( id, cdata. data ) ;
@@ -414,7 +414,7 @@ pub fn get_impl_trait(cdata: cmd,
414
414
}
415
415
416
416
pub fn get_impl_vtables ( cdata : cmd ,
417
- id : ast:: node_id ,
417
+ id : ast:: NodeId ,
418
418
tcx : ty:: ctxt ) -> typeck:: impl_res
419
419
{
420
420
let item_doc = lookup_item ( id, cdata. data ) ;
@@ -428,7 +428,7 @@ pub fn get_impl_vtables(cdata: cmd,
428
428
}
429
429
430
430
431
- pub fn get_impl_method ( intr : @ident_interner , cdata : cmd , id : ast:: node_id ,
431
+ pub fn get_impl_method ( intr : @ident_interner , cdata : cmd , id : ast:: NodeId ,
432
432
name : ast:: ident ) -> Option < ast:: def_id > {
433
433
let items = reader:: get_doc ( reader:: Doc ( cdata. data ) , tag_items) ;
434
434
let mut found = None ;
@@ -442,7 +442,7 @@ pub fn get_impl_method(intr: @ident_interner, cdata: cmd, id: ast::node_id,
442
442
found
443
443
}
444
444
445
- pub fn get_symbol ( data : @~[ u8 ] , id : ast:: node_id ) -> ~str {
445
+ pub fn get_symbol ( data : @~[ u8 ] , id : ast:: NodeId ) -> ~str {
446
446
return item_symbol ( lookup_item ( id, data) ) ;
447
447
}
448
448
@@ -462,15 +462,15 @@ fn def_like_to_def(def_like: def_like) -> ast::def {
462
462
}
463
463
464
464
/// Iterates over the language items in the given crate.
465
- pub fn each_lang_item ( cdata : cmd , f : & fn ( ast:: node_id , uint ) -> bool ) -> bool {
465
+ pub fn each_lang_item ( cdata : cmd , f : & fn ( ast:: NodeId , uint ) -> bool ) -> bool {
466
466
let root = reader:: Doc ( cdata. data ) ;
467
467
let lang_items = reader:: get_doc ( root, tag_lang_items) ;
468
468
for reader:: tagged_docs( lang_items, tag_lang_items_item) |item_doc| {
469
469
let id_doc = reader:: get_doc ( item_doc, tag_lang_items_item_id) ;
470
470
let id = reader:: doc_as_u32 ( id_doc) as uint ;
471
471
let node_id_doc = reader:: get_doc ( item_doc,
472
472
tag_lang_items_item_node_id) ;
473
- let node_id = reader:: doc_as_u32 ( node_id_doc) as ast:: node_id ;
473
+ let node_id = reader:: doc_as_u32 ( node_id_doc) as ast:: NodeId ;
474
474
475
475
if !f ( node_id, id) {
476
476
return false ;
@@ -716,7 +716,7 @@ pub fn each_path(intr: @ident_interner,
716
716
context. each_child_of_module_or_crate ( crate_items_doc)
717
717
}
718
718
719
- pub fn get_item_path ( cdata : cmd , id : ast:: node_id ) -> ast_map:: path {
719
+ pub fn get_item_path ( cdata : cmd , id : ast:: NodeId ) -> ast_map:: path {
720
720
item_path ( lookup_item ( id, cdata. data ) )
721
721
}
722
722
@@ -727,7 +727,7 @@ pub type decode_inlined_item<'self> = &'self fn(
727
727
par_doc : ebml:: Doc ) -> Option < ast:: inlined_item > ;
728
728
729
729
pub fn maybe_get_item_ast ( cdata : cmd , tcx : ty:: ctxt ,
730
- id : ast:: node_id ,
730
+ id : ast:: NodeId ,
731
731
decode_inlined_item : decode_inlined_item )
732
732
-> csearch:: found_ast {
733
733
debug ! ( "Looking up item: %d" , id) ;
@@ -754,7 +754,7 @@ pub fn maybe_get_item_ast(cdata: cmd, tcx: ty::ctxt,
754
754
}
755
755
}
756
756
757
- pub fn get_enum_variants ( intr : @ident_interner , cdata : cmd , id : ast:: node_id ,
757
+ pub fn get_enum_variants ( intr : @ident_interner , cdata : cmd , id : ast:: NodeId ,
758
758
tcx : ty:: ctxt ) -> ~[ @ty:: VariantInfo ] {
759
759
let data = cdata. data ;
760
760
let items = reader:: get_doc ( reader:: Doc ( data) , tag_items) ;
@@ -833,7 +833,7 @@ fn item_impl_methods(intr: @ident_interner, cdata: cmd, item: ebml::Doc,
833
833
}
834
834
835
835
/// Returns information about the given implementation.
836
- pub fn get_impl ( intr : @ident_interner , cdata : cmd , impl_id : ast:: node_id ,
836
+ pub fn get_impl ( intr : @ident_interner , cdata : cmd , impl_id : ast:: NodeId ,
837
837
tcx : ty:: ctxt )
838
838
-> ty:: Impl {
839
839
let data = cdata. data ;
@@ -851,15 +851,15 @@ pub fn get_impl(intr: @ident_interner, cdata: cmd, impl_id: ast::node_id,
851
851
pub fn get_method_name_and_explicit_self (
852
852
intr : @ident_interner ,
853
853
cdata : cmd ,
854
- id : ast:: node_id ) -> ( ast:: ident , ast:: explicit_self_ )
854
+ id : ast:: NodeId ) -> ( ast:: ident , ast:: explicit_self_ )
855
855
{
856
856
let method_doc = lookup_item ( id, cdata. data ) ;
857
857
let name = item_name ( intr, method_doc) ;
858
858
let explicit_self = get_explicit_self ( method_doc) ;
859
859
( name, explicit_self)
860
860
}
861
861
862
- pub fn get_method ( intr : @ident_interner , cdata : cmd , id : ast:: node_id ,
862
+ pub fn get_method ( intr : @ident_interner , cdata : cmd , id : ast:: NodeId ,
863
863
tcx : ty:: ctxt ) -> ty:: Method
864
864
{
865
865
let method_doc = lookup_item ( id, cdata. data ) ;
@@ -892,7 +892,7 @@ pub fn get_method(intr: @ident_interner, cdata: cmd, id: ast::node_id,
892
892
}
893
893
894
894
pub fn get_trait_method_def_ids ( cdata : cmd ,
895
- id : ast:: node_id ) -> ~[ ast:: def_id ] {
895
+ id : ast:: NodeId ) -> ~[ ast:: def_id ] {
896
896
let data = cdata. data ;
897
897
let item = lookup_item ( id, data) ;
898
898
let mut result = ~[ ] ;
@@ -903,7 +903,7 @@ pub fn get_trait_method_def_ids(cdata: cmd,
903
903
}
904
904
905
905
pub fn get_provided_trait_methods ( intr : @ident_interner , cdata : cmd ,
906
- id : ast:: node_id , tcx : ty:: ctxt ) ->
906
+ id : ast:: NodeId , tcx : ty:: ctxt ) ->
907
907
~[ @ty:: Method ] {
908
908
let data = cdata. data ;
909
909
let item = lookup_item ( id, data) ;
@@ -922,7 +922,7 @@ pub fn get_provided_trait_methods(intr: @ident_interner, cdata: cmd,
922
922
}
923
923
924
924
/// Returns the supertraits of the given trait.
925
- pub fn get_supertraits ( cdata : cmd , id : ast:: node_id , tcx : ty:: ctxt )
925
+ pub fn get_supertraits ( cdata : cmd , id : ast:: NodeId , tcx : ty:: ctxt )
926
926
-> ~[ @ty:: TraitRef ] {
927
927
let mut results = ~[ ] ;
928
928
let item_doc = lookup_item ( id, cdata. data ) ;
@@ -933,7 +933,7 @@ pub fn get_supertraits(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
933
933
}
934
934
935
935
pub fn get_type_name_if_impl ( cdata : cmd ,
936
- node_id : ast:: node_id ) -> Option < ast:: ident > {
936
+ node_id : ast:: NodeId ) -> Option < ast:: ident > {
937
937
let item = lookup_item ( node_id, cdata. data ) ;
938
938
if item_family ( item) != Impl {
939
939
return None ;
@@ -948,7 +948,7 @@ pub fn get_type_name_if_impl(cdata: cmd,
948
948
949
949
pub fn get_static_methods_if_impl ( intr : @ident_interner ,
950
950
cdata : cmd ,
951
- node_id : ast:: node_id )
951
+ node_id : ast:: NodeId )
952
952
-> Option < ~[ StaticMethodInfo ] > {
953
953
let item = lookup_item ( node_id, cdata. data ) ;
954
954
if item_family ( item) != Impl {
@@ -992,7 +992,7 @@ pub fn get_static_methods_if_impl(intr: @ident_interner,
992
992
}
993
993
994
994
pub fn get_item_attrs ( cdata : cmd ,
995
- node_id : ast:: node_id ,
995
+ node_id : ast:: NodeId ,
996
996
f : & fn ( ~[ @ast:: MetaItem ] ) ) {
997
997
998
998
let item = lookup_item ( node_id, cdata. data ) ;
@@ -1012,7 +1012,7 @@ fn struct_field_family_to_visibility(family: Family) -> ast::visibility {
1012
1012
}
1013
1013
}
1014
1014
1015
- pub fn get_struct_fields ( intr : @ident_interner , cdata : cmd , id : ast:: node_id )
1015
+ pub fn get_struct_fields ( intr : @ident_interner , cdata : cmd , id : ast:: NodeId )
1016
1016
-> ~[ ty:: field_ty ] {
1017
1017
let data = cdata. data ;
1018
1018
let item = lookup_item ( id, data) ;
@@ -1040,7 +1040,7 @@ pub fn get_struct_fields(intr: @ident_interner, cdata: cmd, id: ast::node_id)
1040
1040
result
1041
1041
}
1042
1042
1043
- pub fn get_item_visibility ( cdata : cmd , id : ast:: node_id )
1043
+ pub fn get_item_visibility ( cdata : cmd , id : ast:: NodeId )
1044
1044
-> ast:: visibility {
1045
1045
item_visibility ( lookup_item ( id, cdata. data ) )
1046
1046
}
@@ -1068,7 +1068,7 @@ fn read_path(d: ebml::Doc) -> (~str, uint) {
1068
1068
}
1069
1069
1070
1070
fn describe_def ( items : ebml:: Doc , id : ast:: def_id ) -> ~str {
1071
- if id. crate != ast:: local_crate { return ~"external"; }
1071
+ if id. crate != ast:: LOCAL_CRATE { return ~"external"; }
1072
1072
let it = match maybe_find_item ( id. node , items) {
1073
1073
Some ( it) => it,
1074
1074
None => fail ! ( "describe_def: item not found %?" , id)
@@ -1260,7 +1260,7 @@ pub fn list_crate_metadata(intr: @ident_interner, bytes: @~[u8],
1260
1260
// then we must translate the crate number from that encoded in the external
1261
1261
// crate to the correct local crate number.
1262
1262
pub fn translate_def_id ( cdata : cmd , did : ast:: def_id ) -> ast:: def_id {
1263
- if did. crate == ast:: local_crate {
1263
+ if did. crate == ast:: LOCAL_CRATE {
1264
1264
return ast:: def_id { crate : cdata. cnum , node : did. node } ;
1265
1265
}
1266
1266
0 commit comments