Skip to content

Commit 9b2b02a

Browse files
committedNov 17, 2020
Auto merge of #78313 - lcnr:somebody-fold-me, r=nikomatsakis
TypeFoldable: take self by value Implements rust-lang/compiler-team#371 which is currently still in FCP. r? `@nikomatsakis`
2 parents c6a6105 + 7f45668 commit 9b2b02a

File tree

164 files changed

+896
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+896
-853
lines changed
 

‎compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pub(crate) fn get_function_name_and_sig<'tcx>(
216216
assert!(!inst.substs.needs_infer());
217217
let fn_sig = tcx.normalize_erasing_late_bound_regions(
218218
ParamEnv::reveal_all(),
219-
&fn_sig_for_fn_abi(tcx, inst),
219+
fn_sig_for_fn_abi(tcx, inst),
220220
);
221221
if fn_sig.c_variadic && !support_vararg {
222222
tcx.sess.span_fatal(
@@ -372,7 +372,7 @@ pub(crate) fn codegen_fn_prelude<'tcx>(
372372
.mir
373373
.args_iter()
374374
.map(|local| {
375-
let arg_ty = fx.monomorphize(&fx.mir.local_decls[local].ty);
375+
let arg_ty = fx.monomorphize(fx.mir.local_decls[local].ty);
376376

377377
// Adapted from https://github.com/rust-lang/rust/blob/145155dc96757002c7b2e9de8489416e2fdbbd57/src/librustc_codegen_llvm/mir/mod.rs#L442-L482
378378
if Some(local) == fx.mir.spread_arg {
@@ -470,7 +470,7 @@ pub(crate) fn codegen_fn_prelude<'tcx>(
470470
}
471471

472472
for local in fx.mir.vars_and_temps_iter() {
473-
let ty = fx.monomorphize(&fx.mir.local_decls[local].ty);
473+
let ty = fx.monomorphize(fx.mir.local_decls[local].ty);
474474
let layout = fx.layout_of(ty);
475475

476476
let is_ssa = ssa_analyzed[local] == crate::analyze::SsaKind::Ssa;
@@ -492,10 +492,10 @@ pub(crate) fn codegen_terminator_call<'tcx>(
492492
args: &[Operand<'tcx>],
493493
destination: Option<(Place<'tcx>, BasicBlock)>,
494494
) {
495-
let fn_ty = fx.monomorphize(&func.ty(fx.mir, fx.tcx));
495+
let fn_ty = fx.monomorphize(func.ty(fx.mir, fx.tcx));
496496
let fn_sig = fx
497497
.tcx
498-
.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &fn_ty.fn_sig(fx.tcx));
498+
.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), fn_ty.fn_sig(fx.tcx));
499499

500500
let destination = destination.map(|(place, bb)| (codegen_place(fx, place), bb));
501501

@@ -711,7 +711,7 @@ pub(crate) fn codegen_drop<'tcx>(
711711
let drop_fn_ty = drop_fn.ty(fx.tcx, ParamEnv::reveal_all());
712712
let fn_sig = fx.tcx.normalize_erasing_late_bound_regions(
713713
ParamEnv::reveal_all(),
714-
&drop_fn_ty.fn_sig(fx.tcx),
714+
drop_fn_ty.fn_sig(fx.tcx),
715715
);
716716
assert_eq!(fn_sig.output(), fx.tcx.mk_unit());
717717

‎compiler/rustc_codegen_cranelift/src/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn analyze(fx: &FunctionCx<'_, '_, impl Module>) -> IndexVec<Local, S
1717
.local_decls
1818
.iter()
1919
.map(|local_decl| {
20-
let ty = fx.monomorphize(&local_decl.ty);
20+
let ty = fx.monomorphize(local_decl.ty);
2121
if fx.clif_type(ty).is_some() || fx.clif_pair_type(ty).is_some() {
2222
SsaKind::Ssa
2323
} else {

0 commit comments

Comments
 (0)