compiler: fold by value
This commit is contained in:
parent
3ec6720bf1
commit
2bf93bd852
140 changed files with 679 additions and 699 deletions
|
@ -92,7 +92,7 @@ fn make_mir_scope(
|
|||
let callee = cx.tcx.subst_and_normalize_erasing_regions(
|
||||
instance.substs,
|
||||
ty::ParamEnv::reveal_all(),
|
||||
&callee,
|
||||
callee,
|
||||
);
|
||||
let callee_fn_abi = FnAbi::of_instance(cx, callee, &[]);
|
||||
cx.dbg_scope_fn(callee, &callee_fn_abi, None)
|
||||
|
|
|
@ -189,7 +189,7 @@ impl TypeMap<'ll, 'tcx> {
|
|||
// something that provides more than the 64 bits of the DefaultHasher.
|
||||
let mut hasher = StableHasher::new();
|
||||
let mut hcx = cx.tcx.create_stable_hashing_context();
|
||||
let type_ = cx.tcx.erase_regions(&type_);
|
||||
let type_ = cx.tcx.erase_regions(type_);
|
||||
hcx.while_hashing_spans(false, |hcx| {
|
||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
||||
type_.hash_stable(hcx, &mut hasher);
|
||||
|
@ -427,7 +427,7 @@ fn subroutine_type_metadata(
|
|||
span: Span,
|
||||
) -> MetadataCreationResult<'ll> {
|
||||
let signature =
|
||||
cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &signature);
|
||||
cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), signature);
|
||||
|
||||
let signature_metadata: Vec<_> = iter::once(
|
||||
// return type
|
||||
|
|
|
@ -501,7 +501,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
let impl_self_ty = cx.tcx.subst_and_normalize_erasing_regions(
|
||||
instance.substs,
|
||||
ty::ParamEnv::reveal_all(),
|
||||
&cx.tcx.type_of(impl_def_id),
|
||||
cx.tcx.type_of(impl_def_id),
|
||||
);
|
||||
|
||||
// Only "class" methods are generally understood by LLVM,
|
||||
|
|
|
@ -91,7 +91,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
|
|||
};
|
||||
|
||||
let sig = callee_ty.fn_sig(tcx);
|
||||
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
|
||||
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig);
|
||||
let arg_tys = sig.inputs();
|
||||
let ret_ty = sig.output();
|
||||
let name = tcx.item_name(def_id);
|
||||
|
@ -777,8 +777,8 @@ fn generic_simd_intrinsic(
|
|||
}
|
||||
|
||||
let tcx = bx.tcx();
|
||||
let sig = tcx
|
||||
.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &callee_ty.fn_sig(tcx));
|
||||
let sig =
|
||||
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
|
||||
let arg_tys = sig.inputs();
|
||||
let name_str = &*name.as_str();
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
|
|||
|
||||
// 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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue