summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs')
-rw-r--r--compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs b/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
index a09b52fbf..aa65a72ab 100644
--- a/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
+++ b/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
@@ -13,7 +13,7 @@ use rustc_hir as hir;
use rustc_middle::ty::subst::{GenericArg, GenericArgKind, SubstsRef};
use rustc_middle::ty::{
self, Binder, Const, ExistentialPredicate, FloatTy, FnSig, IntTy, List, Region, RegionKind,
- Term, Ty, TyCtxt, UintTy,
+ TermKind, Ty, TyCtxt, UintTy,
};
use rustc_span::def_id::DefId;
use rustc_span::symbol::sym;
@@ -243,13 +243,9 @@ fn encode_predicate<'tcx>(
let name = encode_ty_name(tcx, projection.item_def_id);
let _ = write!(s, "u{}{}", name.len(), &name);
s.push_str(&encode_substs(tcx, projection.substs, dict, options));
- match projection.term {
- Term::Ty(ty) => {
- s.push_str(&encode_ty(tcx, ty, dict, options));
- }
- Term::Const(c) => {
- s.push_str(&encode_const(tcx, c, dict, options));
- }
+ match projection.term.unpack() {
+ TermKind::Ty(ty) => s.push_str(&encode_ty(tcx, ty, dict, options)),
+ TermKind::Const(c) => s.push_str(&encode_const(tcx, c, dict, options)),
}
}
ty::ExistentialPredicate::AutoTrait(def_id) => {
@@ -309,8 +305,7 @@ fn encode_region<'tcx>(
| RegionKind::ReFree(..)
| RegionKind::ReStatic
| RegionKind::ReVar(..)
- | RegionKind::RePlaceholder(..)
- | RegionKind::ReEmpty(..) => {
+ | RegionKind::RePlaceholder(..) => {
bug!("encode_region: unexpected `{:?}`", region.kind());
}
}
@@ -632,10 +627,13 @@ fn encode_ty<'tcx>(
}
// Trait types
- ty::Dynamic(predicates, region) => {
+ ty::Dynamic(predicates, region, kind) => {
// u3dynI<element-type1[..element-typeN]>E, where <element-type> is <predicate>, as
// vendor extended type.
- let mut s = String::from("u3dynI");
+ let mut s = String::from(match kind {
+ ty::Dyn => "u3dynI",
+ ty::DynStar => "u7dynstarI",
+ });
s.push_str(&encode_predicates(tcx, predicates, dict, options));
s.push_str(&encode_region(tcx, *region, dict, options));
s.push('E');
@@ -888,7 +886,7 @@ pub fn typeid_for_fnabi<'tcx>(
typeid.push('v');
}
} else {
- for n in 0..fn_abi.fixed_count {
+ for n in 0..fn_abi.fixed_count as usize {
let ty = transform_ty(tcx, fn_abi.args[n].layout.ty, transform_ty_options);
typeid.push_str(&encode_ty(tcx, ty, &mut dict, encode_ty_options));
}