rustc: store type parameter defaults outside of ty::Generics.
This commit is contained in:
parent
1572bf104d
commit
e8d01ea4c7
34 changed files with 394 additions and 385 deletions
|
|
@ -332,7 +332,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
}
|
||||
|
||||
fn get_template_parameters<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
generics: &ty::Generics<'tcx>,
|
||||
generics: &ty::Generics,
|
||||
substs: &Substs<'tcx>,
|
||||
file_metadata: DIFile,
|
||||
name_to_append_suffix_to: &mut String)
|
||||
|
|
@ -382,9 +382,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
return create_DIArray(DIB(cx), &template_params[..]);
|
||||
}
|
||||
|
||||
fn get_type_parameter_names<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
generics: &ty::Generics<'tcx>)
|
||||
-> Vec<ast::Name> {
|
||||
fn get_type_parameter_names(cx: &CrateContext, generics: &ty::Generics) -> Vec<ast::Name> {
|
||||
let mut names = generics.parent.map_or(vec![], |def_id| {
|
||||
get_type_parameter_names(cx, cx.tcx().item_generics(def_id))
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use super::{CrateDebugContext};
|
|||
use super::namespace::item_namespace;
|
||||
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::ty::DefIdTree;
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIScope, DIBuilderRef, DIDescriptor, DIArray};
|
||||
|
|
@ -74,11 +75,8 @@ pub fn DIB(cx: &CrateContext) -> DIBuilderRef {
|
|||
|
||||
pub fn get_namespace_and_span_for_item(cx: &CrateContext, def_id: DefId)
|
||||
-> (DIScope, Span) {
|
||||
let containing_scope = item_namespace(cx, DefId {
|
||||
krate: def_id.krate,
|
||||
index: cx.tcx().def_key(def_id).parent
|
||||
.expect("get_namespace_and_span_for_item: missing parent?")
|
||||
});
|
||||
let containing_scope = item_namespace(cx, cx.tcx().parent(def_id)
|
||||
.expect("get_namespace_and_span_for_item: missing parent?"));
|
||||
|
||||
// Try to get some span information, if we have an inlined item.
|
||||
let definition_span = cx.tcx().def_span(def_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue