Skip to content

Commit

Permalink
Remove Copy bound from enter_forall
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Jan 22, 2025
1 parent b2728d5 commit 921c226
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
)
}

fn enter_forall<T: TypeFoldable<TyCtxt<'tcx>> + Copy, U>(
fn enter_forall<T: TypeFoldable<TyCtxt<'tcx>>, U>(
&self,
value: ty::Binder<'tcx, T>,
f: impl FnOnce(T) -> U,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_infer/src/infer/relate/higher_ranked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ impl<'tcx> InferCtxt<'tcx> {
#[instrument(level = "debug", skip(self), ret)]
pub fn enter_forall_and_leak_universe<T>(&self, binder: ty::Binder<'tcx, T>) -> T
where
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
T: TypeFoldable<TyCtxt<'tcx>>,
{
if let Some(inner) = binder.no_bound_vars() {
if let Some(inner) = binder.clone().no_bound_vars() {
return inner;
}

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

0 comments on commit 921c226

Please sign in to comment.