Remove Copy bound from enter_forall

This commit is contained in:
Boxy 2025-01-22 11:45:09 +00:00
parent b2728d5426
commit 921c226eb6
2 changed files with 4 additions and 4 deletions

View file

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

View file

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