// FIXME(eddyb) producing readable type names for trait objects can result
// in problematically distinct types due to HRTB and subtyping (see #47638).
// ty::Dynamic(..) |
- ty::Adt(..) | ty::Closure(..) | ty::Foreign(..) | ty::Generator(..) | ty::Str
- if !cx.sess().fewer_names() =>
- {
+ ty::Adt(..) | ty::Closure(..) | ty::Foreign(..) | ty::Generator(..) | ty::Str => {
let mut name = with_no_trimmed_paths(|| layout.ty.to_string());
if let (&ty::Adt(def, _), &Variants::Single { index }) =
(layout.ty.kind(), &layout.variants)
}
Some(name)
}
- ty::Adt(..) => {
- // If `Some` is returned then a named struct is created in LLVM. Name collisions are
- // avoided by LLVM (with increasing suffixes). If rustc doesn't generate names then that
- // can improve perf.
- Some(String::new())
- }
_ => None,
};
// Make sure lifetimes are erased, to avoid generating distinct LLVM
// types for Rust types that only differ in the choice of lifetimes.
- let normal_ty = cx.tcx.erase_regions(&self.ty);
+ let normal_ty = cx.tcx.erase_regions(self.ty);
let mut defer = None;
let llty = if self.ty != normal_ty {