Skip to content

Commit 921c226

Browse files
committed
Remove Copy bound from enter_forall
1 parent b2728d5 commit 921c226

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: compiler/rustc_infer/src/infer/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
114114
)
115115
}
116116

117-
fn enter_forall<T: TypeFoldable<TyCtxt<'tcx>> + Copy, U>(
117+
fn enter_forall<T: TypeFoldable<TyCtxt<'tcx>>, U>(
118118
&self,
119119
value: ty::Binder<'tcx, T>,
120120
f: impl FnOnce(T) -> U,

Diff for: compiler/rustc_infer/src/infer/relate/higher_ranked.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ impl<'tcx> InferCtxt<'tcx> {
2424
#[instrument(level = "debug", skip(self), ret)]
2525
pub fn enter_forall_and_leak_universe<T>(&self, binder: ty::Binder<'tcx, T>) -> T
2626
where
27-
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
27+
T: TypeFoldable<TyCtxt<'tcx>>,
2828
{
29-
if let Some(inner) = binder.no_bound_vars() {
29+
if let Some(inner) = binder.clone().no_bound_vars() {
3030
return inner;
3131
}
3232

@@ -71,7 +71,7 @@ impl<'tcx> InferCtxt<'tcx> {
7171
#[instrument(level = "debug", skip(self, f))]
7272
pub fn enter_forall<T, U>(&self, forall: ty::Binder<'tcx, T>, f: impl FnOnce(T) -> U) -> U
7373
where
74-
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
74+
T: TypeFoldable<TyCtxt<'tcx>>,
7575
{
7676
// FIXME: currently we do nothing to prevent placeholders with the new universe being
7777
// used after exiting `f`. For example region subtyping can result in outlives constraints

0 commit comments

Comments
 (0)