Skip to content

Commit 2bf93bd

Browse files
committed
compiler: fold by value
1 parent 3ec6720 commit 2bf93bd

File tree

140 files changed

+679
-699
lines changed

Some content is hidden

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

140 files changed

+679
-699
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn make_mir_scope(
9292
let callee = cx.tcx.subst_and_normalize_erasing_regions(
9393
instance.substs,
9494
ty::ParamEnv::reveal_all(),
95-
&callee,
95+
callee,
9696
);
9797
let callee_fn_abi = FnAbi::of_instance(cx, callee, &[]);
9898
cx.dbg_scope_fn(callee, &callee_fn_abi, None)

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl TypeMap<'ll, 'tcx> {
189189
// something that provides more than the 64 bits of the DefaultHasher.
190190
let mut hasher = StableHasher::new();
191191
let mut hcx = cx.tcx.create_stable_hashing_context();
192-
let type_ = cx.tcx.erase_regions(&type_);
192+
let type_ = cx.tcx.erase_regions(type_);
193193
hcx.while_hashing_spans(false, |hcx| {
194194
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
195195
type_.hash_stable(hcx, &mut hasher);
@@ -427,7 +427,7 @@ fn subroutine_type_metadata(
427427
span: Span,
428428
) -> MetadataCreationResult<'ll> {
429429
let signature =
430-
cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &signature);
430+
cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), signature);
431431

432432
let signature_metadata: Vec<_> = iter::once(
433433
// return type

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
501501
let impl_self_ty = cx.tcx.subst_and_normalize_erasing_regions(
502502
instance.substs,
503503
ty::ParamEnv::reveal_all(),
504-
&cx.tcx.type_of(impl_def_id),
504+
cx.tcx.type_of(impl_def_id),
505505
);
506506

507507
// Only "class" methods are generally understood by LLVM,

compiler/rustc_codegen_llvm/src/intrinsic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
9191
};
9292

9393
let sig = callee_ty.fn_sig(tcx);
94-
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
94+
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig);
9595
let arg_tys = sig.inputs();
9696
let ret_ty = sig.output();
9797
let name = tcx.item_name(def_id);
@@ -777,8 +777,8 @@ fn generic_simd_intrinsic(
777777
}
778778

779779
let tcx = bx.tcx();
780-
let sig = tcx
781-
.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &callee_ty.fn_sig(tcx));
780+
let sig =
781+
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
782782
let arg_tys = sig.inputs();
783783
let name_str = &*name.as_str();
784784

compiler/rustc_codegen_llvm/src/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
252252

253253
// Make sure lifetimes are erased, to avoid generating distinct LLVM
254254
// types for Rust types that only differ in the choice of lifetimes.
255-
let normal_ty = cx.tcx.erase_regions(&self.ty);
255+
let normal_ty = cx.tcx.erase_regions(self.ty);
256256

257257
let mut defer = None;
258258
let llty = if self.ty != normal_ty {

compiler/rustc_codegen_ssa/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
399399
// late-bound regions, since late-bound
400400
// regions must appear in the argument
401401
// listing.
402-
let main_ret_ty = cx.tcx().erase_regions(&main_ret_ty.no_bound_vars().unwrap());
402+
let main_ret_ty = cx.tcx().erase_regions(main_ret_ty.no_bound_vars().unwrap());
403403

404404
let llfn = match cx.declare_c_main(llfty) {
405405
Some(llfn) => llfn,

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ pub fn push_debuginfo_type_name<'tcx>(
120120
}
121121
ty::Dynamic(ref trait_data, ..) => {
122122
if let Some(principal) = trait_data.principal() {
123-
let principal = tcx
124-
.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &principal);
123+
let principal =
124+
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), principal);
125125
push_item_name(tcx, principal.def_id, false, output);
126126
push_type_params(tcx, principal.substs, output, visited);
127127
} else {
@@ -159,7 +159,7 @@ pub fn push_debuginfo_type_name<'tcx>(
159159

160160
output.push_str("fn(");
161161

162-
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
162+
let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig);
163163
if !sig.inputs().is_empty() {
164164
for &parameter_type in sig.inputs() {
165165
push_debuginfo_type_name(tcx, parameter_type, true, output, visited);

compiler/rustc_codegen_ssa/src/mir/analyze.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
2424
analyzer.visit_body(&mir);
2525

2626
for (local, decl) in mir.local_decls.iter_enumerated() {
27-
let ty = fx.monomorphize(&decl.ty);
27+
let ty = fx.monomorphize(decl.ty);
2828
debug!("local {:?} has type `{}`", local, ty);
2929
let layout = fx.cx.spanned_layout_of(ty, decl.source_info.span);
3030
if fx.cx.is_backend_immediate(layout) {
@@ -121,10 +121,10 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
121121
if is_consume {
122122
let base_ty =
123123
mir::Place::ty_from(place_ref.local, proj_base, self.fx.mir, cx.tcx());
124-
let base_ty = self.fx.monomorphize(&base_ty);
124+
let base_ty = self.fx.monomorphize(base_ty);
125125

126126
// ZSTs don't require any actual memory access.
127-
let elem_ty = base_ty.projection_ty(cx.tcx(), self.fx.monomorphize(&elem)).ty;
127+
let elem_ty = base_ty.projection_ty(cx.tcx(), self.fx.monomorphize(elem)).ty;
128128
let span = self.fx.mir.local_decls[place_ref.local].source_info.span;
129129
if cx.spanned_layout_of(elem_ty, span).is_zst() {
130130
return;
@@ -313,7 +313,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
313313

314314
PlaceContext::MutatingUse(MutatingUseContext::Drop) => {
315315
let ty = self.fx.mir.local_decls[local].ty;
316-
let ty = self.fx.monomorphize(&ty);
316+
let ty = self.fx.monomorphize(ty);
317317

318318
// Only need the place if we're actually dropping it.
319319
if self.fx.cx.type_needs_drop(ty) {

compiler/rustc_codegen_ssa/src/mir/block.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
306306
unwind: Option<mir::BasicBlock>,
307307
) {
308308
let ty = location.ty(self.mir, bx.tcx()).ty;
309-
let ty = self.monomorphize(&ty);
309+
let ty = self.monomorphize(ty);
310310
let drop_fn = Instance::resolve_drop_in_place(bx.tcx(), ty);
311311

312312
if let ty::InstanceDef::DropGlue(_, None) = drop_fn.def {
@@ -576,7 +576,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
576576
.iter()
577577
.map(|op_arg| {
578578
let op_ty = op_arg.ty(self.mir, bx.tcx());
579-
self.monomorphize(&op_ty)
579+
self.monomorphize(op_ty)
580580
})
581581
.collect::<Vec<_>>();
582582

@@ -900,7 +900,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
900900
}
901901
}
902902
mir::InlineAsmOperand::SymFn { ref value } => {
903-
let literal = self.monomorphize(&value.literal);
903+
let literal = self.monomorphize(value.literal);
904904
if let ty::FnDef(def_id, substs) = *literal.ty.kind() {
905905
let instance = ty::Instance::resolve_for_fn_ptr(
906906
bx.tcx(),

compiler/rustc_codegen_ssa/src/mir/constant.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1616
constant: &mir::Constant<'tcx>,
1717
) -> Result<OperandRef<'tcx, Bx::Value>, ErrorHandled> {
1818
let val = self.eval_mir_constant(constant)?;
19-
let ty = self.monomorphize(&constant.literal.ty);
19+
let ty = self.monomorphize(constant.literal.ty);
2020
Ok(OperandRef::from_const(bx, val, ty))
2121
}
2222

2323
pub fn eval_mir_constant(
2424
&mut self,
2525
constant: &mir::Constant<'tcx>,
2626
) -> Result<ConstValue<'tcx>, ErrorHandled> {
27-
match self.monomorphize(&constant.literal).val {
27+
match self.monomorphize(constant.literal).val {
2828
ty::ConstKind::Unevaluated(def, substs, promoted) => self
2929
.cx
3030
.tcx()
@@ -83,7 +83,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
8383
.unwrap_or_else(|_| {
8484
bx.tcx().sess.span_err(span, "could not evaluate shuffle_indices at compile time");
8585
// We've errored, so we don't have to produce working code.
86-
let ty = self.monomorphize(&ty);
86+
let ty = self.monomorphize(ty);
8787
let llty = bx.backend_type(bx.layout_of(ty));
8888
(bx.const_undef(llty), ty)
8989
})

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
160160
// FIXME(eddyb) is this `+ 1` needed at all?
161161
let kind = VariableKind::ArgumentVariable(arg_index + 1);
162162

163-
let arg_ty = self.monomorphize(&decl.ty);
163+
let arg_ty = self.monomorphize(decl.ty);
164164

165165
self.cx.create_dbg_var(name, arg_ty, dbg_scope, kind, span)
166166
},

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
6464
};
6565

6666
let sig = callee_ty.fn_sig(bx.tcx());
67-
let sig = bx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
67+
let sig = bx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig);
6868
let arg_tys = sig.inputs();
6969
let ret_ty = sig.output();
7070
let name = bx.tcx().item_name(def_id);

compiler/rustc_codegen_ssa/src/mir/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
8787
}
8888

8989
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
90-
pub fn monomorphize<T>(&self, value: &T) -> T
90+
pub fn monomorphize<T>(&self, value: T) -> T
9191
where
9292
T: Copy + TypeFoldable<'tcx>,
9393
{
@@ -208,7 +208,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
208208

209209
let mut allocate_local = |local| {
210210
let decl = &mir.local_decls[local];
211-
let layout = bx.layout_of(fx.monomorphize(&decl.ty));
211+
let layout = bx.layout_of(fx.monomorphize(decl.ty));
212212
assert!(!layout.ty.has_erasable_regions());
213213

214214
if local == mir::RETURN_PLACE && fx.fn_abi.ret.is_indirect() {
@@ -364,7 +364,7 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
364364
// to reconstruct it into a tuple local variable, from multiple
365365
// individual LLVM function arguments.
366366

367-
let arg_ty = fx.monomorphize(&arg_decl.ty);
367+
let arg_ty = fx.monomorphize(arg_decl.ty);
368368
let tupled_arg_tys = match arg_ty.kind() {
369369
ty::Tuple(tys) => tys,
370370
_ => bug!("spread argument isn't a tuple?!"),
@@ -385,7 +385,7 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
385385
}
386386

387387
if fx.fn_abi.c_variadic && arg_index == fx.fn_abi.args.len() {
388-
let arg_ty = fx.monomorphize(&arg_decl.ty);
388+
let arg_ty = fx.monomorphize(arg_decl.ty);
389389

390390
let va_list = PlaceRef::alloca(bx, bx.layout_of(arg_ty));
391391
bx.va_start(va_list.llval);

compiler/rustc_codegen_ssa/src/mir/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
452452
bx.abort();
453453
// We still have to return an operand but it doesn't matter,
454454
// this code is unreachable.
455-
let ty = self.monomorphize(&constant.literal.ty);
455+
let ty = self.monomorphize(constant.literal.ty);
456456
let layout = bx.cx().layout_of(ty);
457457
bx.load_operand(PlaceRef::new_sized(
458458
bx.cx().const_undef(bx.cx().type_ptr_to(bx.cx().backend_type(layout))),

compiler/rustc_codegen_ssa/src/mir/place.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
485485
cg_base.project_index(bx, bx.cx().const_usize(from as u64));
486486
let projected_ty =
487487
PlaceTy::from_ty(cg_base.layout.ty).projection_ty(tcx, elem).ty;
488-
subslice.layout = bx.cx().layout_of(self.monomorphize(&projected_ty));
488+
subslice.layout = bx.cx().layout_of(self.monomorphize(projected_ty));
489489

490490
if subslice.layout.is_unsized() {
491491
assert!(from_end, "slice subslices should be `from_end`");
@@ -515,6 +515,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
515515
pub fn monomorphized_place_ty(&self, place_ref: mir::PlaceRef<'tcx>) -> Ty<'tcx> {
516516
let tcx = self.cx.tcx();
517517
let place_ty = mir::Place::ty_from(place_ref.local, place_ref.projection, self.mir, tcx);
518-
self.monomorphize(&place_ty.ty)
518+
self.monomorphize(place_ty.ty)
519519
}
520520
}

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
106106
}
107107

108108
let count =
109-
self.monomorphize(&count).eval_usize(bx.cx().tcx(), ty::ParamEnv::reveal_all());
109+
self.monomorphize(count).eval_usize(bx.cx().tcx(), ty::ParamEnv::reveal_all());
110110

111111
bx.write_operand_repeatedly(cg_elem, count, dest)
112112
}
@@ -181,7 +181,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
181181
mir::Rvalue::Cast(ref kind, ref source, mir_cast_ty) => {
182182
let operand = self.codegen_operand(&mut bx, source);
183183
debug!("cast operand is {:?}", operand);
184-
let cast = bx.cx().layout_of(self.monomorphize(&mir_cast_ty));
184+
let cast = bx.cx().layout_of(self.monomorphize(mir_cast_ty));
185185

186186
let val = match *kind {
187187
mir::CastKind::Pointer(PointerCast::ReifyFnPointer) => {
@@ -502,7 +502,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
502502
}
503503

504504
mir::Rvalue::NullaryOp(mir::NullOp::SizeOf, ty) => {
505-
let ty = self.monomorphize(&ty);
505+
let ty = self.monomorphize(ty);
506506
assert!(bx.cx().type_is_sized(ty));
507507
let val = bx.cx().const_usize(bx.cx().layout_of(ty).size.bytes());
508508
let tcx = self.cx.tcx();
@@ -516,7 +516,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
516516
}
517517

518518
mir::Rvalue::NullaryOp(mir::NullOp::Box, content_ty) => {
519-
let content_ty = self.monomorphize(&content_ty);
519+
let content_ty = self.monomorphize(content_ty);
520520
let content_layout = bx.cx().layout_of(content_ty);
521521
let llsize = bx.cx().const_usize(content_layout.size.bytes());
522522
let llalign = bx.cx().const_usize(content_layout.align.abi.bytes());
@@ -554,7 +554,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
554554
// aggregate rvalues are allowed to be operands.
555555
let ty = rvalue.ty(self.mir, self.cx.tcx());
556556
let operand =
557-
OperandRef::new_zst(&mut bx, self.cx.layout_of(self.monomorphize(&ty)));
557+
OperandRef::new_zst(&mut bx, self.cx.layout_of(self.monomorphize(ty)));
558558
(bx, operand)
559559
}
560560
}
@@ -774,7 +774,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
774774
mir::Rvalue::Repeat(..) |
775775
mir::Rvalue::Aggregate(..) => {
776776
let ty = rvalue.ty(self.mir, self.cx.tcx());
777-
let ty = self.monomorphize(&ty);
777+
let ty = self.monomorphize(ty);
778778
self.cx.spanned_layout_of(ty, span).is_zst()
779779
}
780780
}

compiler/rustc_data_structures/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#![feature(extend_one)]
2828
#![feature(const_panic)]
2929
#![feature(min_const_generics)]
30+
#![feature(new_uninit)]
3031
#![feature(once_cell)]
3132
#![feature(maybe_uninit_uninit_array)]
3233
#![allow(rustc::default_hash_types)]
@@ -70,6 +71,7 @@ pub mod box_region;
7071
pub mod captures;
7172
pub mod const_cstr;
7273
pub mod flock;
74+
pub mod functor;
7375
pub mod fx;
7476
pub mod graph;
7577
pub mod jobserver;

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
3838
/// [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html#canonicalizing-the-query
3939
pub fn canonicalize_query<V>(
4040
&self,
41-
value: &V,
41+
value: V,
4242
query_state: &mut OriginalQueryValues<'tcx>,
4343
) -> Canonicalized<'tcx, V>
4444
where
@@ -80,7 +80,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
8080
/// out the [chapter in the rustc dev guide][c].
8181
///
8282
/// [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html#canonicalizing-the-query-result
83-
pub fn canonicalize_response<V>(&self, value: &V) -> Canonicalized<'tcx, V>
83+
pub fn canonicalize_response<V>(&self, value: V) -> Canonicalized<'tcx, V>
8484
where
8585
V: TypeFoldable<'tcx>,
8686
{
@@ -94,7 +94,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
9494
)
9595
}
9696

97-
pub fn canonicalize_user_type_annotation<V>(&self, value: &V) -> Canonicalized<'tcx, V>
97+
pub fn canonicalize_user_type_annotation<V>(&self, value: V) -> Canonicalized<'tcx, V>
9898
where
9999
V: TypeFoldable<'tcx>,
100100
{
@@ -123,7 +123,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
123123
// and just use `canonicalize_query`.
124124
pub fn canonicalize_hr_query_hack<V>(
125125
&self,
126-
value: &V,
126+
value: V,
127127
query_state: &mut OriginalQueryValues<'tcx>,
128128
) -> Canonicalized<'tcx, V>
129129
where
@@ -293,7 +293,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
293293
self.tcx
294294
}
295295

296-
fn fold_binder<T>(&mut self, t: &ty::Binder<T>) -> ty::Binder<T>
296+
fn fold_binder<T>(&mut self, t: ty::Binder<T>) -> ty::Binder<T>
297297
where
298298
T: TypeFoldable<'tcx>,
299299
{
@@ -479,7 +479,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
479479
/// The main `canonicalize` method, shared impl of
480480
/// `canonicalize_query` and `canonicalize_response`.
481481
fn canonicalize<V>(
482-
value: &V,
482+
value: V,
483483
infcx: Option<&InferCtxt<'_, 'tcx>>,
484484
tcx: TyCtxt<'tcx>,
485485
canonicalize_region_mode: &dyn CanonicalizeRegionMode,

0 commit comments

Comments
 (0)