@@ -1771,15 +1771,17 @@ pub fn create_global_var_metadata(cx: &CrateContext,
1771
1771
return ;
1772
1772
}
1773
1773
1774
+ let tcx = cx. tcx ( ) ;
1775
+
1774
1776
// Don't create debuginfo for globals inlined from other crates. The other
1775
1777
// crate should already contain debuginfo for it. More importantly, the
1776
1778
// global might not even exist in un-inlined form anywhere which would lead
1777
1779
// to a linker errors.
1778
- if cx . tcx ( ) . map . is_inlined_node_id ( node_id) {
1780
+ if tcx. map . is_inlined_node_id ( node_id) {
1779
1781
return ;
1780
1782
}
1781
1783
1782
- let node_def_id = cx . tcx ( ) . map . local_def_id ( node_id) ;
1784
+ let node_def_id = tcx. map . local_def_id ( node_id) ;
1783
1785
let ( var_scope, span) = get_namespace_and_span_for_item ( cx, node_def_id) ;
1784
1786
1785
1787
let ( file_metadata, line_number) = if span != syntax_pos:: DUMMY_SP {
@@ -1790,9 +1792,9 @@ pub fn create_global_var_metadata(cx: &CrateContext,
1790
1792
} ;
1791
1793
1792
1794
let is_local_to_unit = is_node_local_to_unit ( cx, node_id) ;
1793
- let variable_type = cx . tcx ( ) . node_id_to_type ( node_id) ;
1795
+ let variable_type = tcx. erase_regions ( & tcx . node_id_to_type ( node_id) ) ;
1794
1796
let type_metadata = type_metadata ( cx, variable_type, span) ;
1795
- let var_name = cx . tcx ( ) . item_name ( node_def_id) . to_string ( ) ;
1797
+ let var_name = tcx. item_name ( node_def_id) . to_string ( ) ;
1796
1798
let linkage_name = mangled_name_of_item ( cx, node_def_id, "" ) ;
1797
1799
1798
1800
let var_name = CString :: new ( var_name) . unwrap ( ) ;
0 commit comments