@@ -14,7 +14,7 @@ use self::MemberDescriptionFactory::*;
14
14
use self :: EnumDiscriminantInfo :: * ;
15
15
16
16
use super :: utils:: { debug_context, DIB , span_start, bytes_to_bits, size_and_align_of,
17
- get_namespace_and_span_for_item , create_DIArray, is_node_local_to_unit} ;
17
+ get_namespace_for_item , create_DIArray, is_node_local_to_unit} ;
18
18
use super :: namespace:: mangled_name_of_item;
19
19
use super :: type_names:: compute_debuginfo_type_name;
20
20
use super :: { CrateDebugContext } ;
@@ -421,7 +421,7 @@ fn trait_pointer_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
421
421
let containing_scope = match trait_type. sty {
422
422
ty:: TyDynamic ( ref data, ..) => if let Some ( principal) = data. principal ( ) {
423
423
let def_id = principal. def_id ( ) ;
424
- get_namespace_and_span_for_item ( cx, def_id) . 0
424
+ get_namespace_for_item ( cx, def_id)
425
425
} else {
426
426
NO_SCOPE_METADATA
427
427
} ,
@@ -971,7 +971,7 @@ fn prepare_struct_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
971
971
_ => bug ! ( "prepare_struct_metadata on a non-ADT" )
972
972
} ;
973
973
974
- let ( containing_scope, _ ) = get_namespace_and_span_for_item ( cx, struct_def_id) ;
974
+ let containing_scope = get_namespace_for_item ( cx, struct_def_id) ;
975
975
976
976
let struct_metadata_stub = create_struct_stub ( cx,
977
977
struct_llvm_type,
@@ -1096,7 +1096,7 @@ fn prepare_union_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
1096
1096
_ => bug ! ( "prepare_union_metadata on a non-ADT" )
1097
1097
} ;
1098
1098
1099
- let ( containing_scope, _ ) = get_namespace_and_span_for_item ( cx, union_def_id) ;
1099
+ let containing_scope = get_namespace_for_item ( cx, union_def_id) ;
1100
1100
1101
1101
let union_metadata_stub = create_union_stub ( cx,
1102
1102
union_llvm_type,
@@ -1483,7 +1483,7 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
1483
1483
-> RecursiveTypeDescription < ' tcx > {
1484
1484
let enum_name = compute_debuginfo_type_name ( cx, enum_type, false ) ;
1485
1485
1486
- let ( containing_scope, _ ) = get_namespace_and_span_for_item ( cx, enum_def_id) ;
1486
+ let containing_scope = get_namespace_for_item ( cx, enum_def_id) ;
1487
1487
// FIXME: This should emit actual file metadata for the enum, but we
1488
1488
// currently can't get the necessary information when it comes to types
1489
1489
// imported from other crates. Formerly we violated the ODR when performing
@@ -1781,7 +1781,8 @@ pub fn create_global_var_metadata(cx: &CrateContext,
1781
1781
let tcx = cx. tcx ( ) ;
1782
1782
1783
1783
let node_def_id = tcx. hir . local_def_id ( node_id) ;
1784
- let ( var_scope, span) = get_namespace_and_span_for_item ( cx, node_def_id) ;
1784
+ let var_scope = get_namespace_for_item ( cx, node_def_id) ;
1785
+ let span = cx. tcx ( ) . def_span ( node_def_id) ;
1785
1786
1786
1787
let ( file_metadata, line_number) = if span != syntax_pos:: DUMMY_SP {
1787
1788
let loc = span_start ( cx, span) ;
0 commit comments