diff options
| author | oliver-giersch <oliver.giersch@googlemail.com> | 2018-10-15 14:38:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 14:38:34 +0200 |
| commit | 30bfdc872020c6addcb2ea488b2a6dbdd5ef355a (patch) | |
| tree | 9c2ccdcdd23848de81e3cbf54be11ea029ba1614 /src/librustc_codegen_llvm/debuginfo | |
| parent | 3527d1d5298fafe6d9e480f95e47f970f1b3adc1 (diff) | |
| parent | 5891a64165ea4819ca331f5a35f5318a91e1be3f (diff) | |
| download | rust-30bfdc872020c6addcb2ea488b2a6dbdd5ef355a.tar.gz rust-30bfdc872020c6addcb2ea488b2a6dbdd5ef355a.zip | |
Merge pull request #5 from oliver-giersch/master
sync with upstream
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 7 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/type_names.rs | 14 |
2 files changed, 7 insertions, 14 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 706568b5446..6eff086a2ba 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -435,12 +435,7 @@ fn trait_pointer_metadata( // But it does not describe the trait's methods. let containing_scope = match trait_type.sty { - ty::Dynamic(ref data, ..) => if let Some(principal) = data.principal() { - let def_id = principal.def_id(); - Some(get_namespace_for_item(cx, def_id)) - } else { - NO_SCOPE_METADATA - }, + ty::Dynamic(ref data, ..) => Some(get_namespace_for_item(cx, data.principal().def_id())), _ => { bug!("debuginfo: Unexpected trait-object type in \ trait_pointer_metadata(): {:?}", diff --git a/src/librustc_codegen_llvm/debuginfo/type_names.rs b/src/librustc_codegen_llvm/debuginfo/type_names.rs index 2f110fd552a..06b9318a5e8 100644 --- a/src/librustc_codegen_llvm/debuginfo/type_names.rs +++ b/src/librustc_codegen_llvm/debuginfo/type_names.rs @@ -116,14 +116,12 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, } }, ty::Dynamic(ref trait_data, ..) => { - if let Some(principal) = trait_data.principal() { - let principal = cx.tcx.normalize_erasing_late_bound_regions( - ty::ParamEnv::reveal_all(), - &principal, - ); - push_item_name(cx, principal.def_id, false, output); - push_type_params(cx, principal.substs, output); - } + let principal = cx.tcx.normalize_erasing_late_bound_regions( + ty::ParamEnv::reveal_all(), + &trait_data.principal(), + ); + push_item_name(cx, principal.def_id, false, output); + push_type_params(cx, principal.substs, output); }, ty::FnDef(..) | ty::FnPtr(_) => { let sig = t.fn_sig(cx.tcx); |
