compiler: fold by value

This commit is contained in:
Bastian Kauschke
2020-10-24 02:21:18 +02:00
parent 3ec6720bf1
commit 2bf93bd852
140 changed files with 679 additions and 699 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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,