Skip to content

Commit

Permalink
Auto merge of rust-lang#118634 - Jules-Bertholet:box-allocator-static…
Browse files Browse the repository at this point in the history
…, r=Amanieu

Remove useless `'static` bounds on `Box` allocator

rust-lang#79327 added `'static` bounds to the allocator parameter for various `Box` + `Pin` APIs to ensure soundness. But it was a bit overzealous, some of the bounds aren't actually needed.
  • Loading branch information
bors committed Feb 22, 2024
2 parents d8b0069 + 1265af0 commit c5f69bd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2141,13 +2141,10 @@ impl<T: ?Sized, A: Allocator> AsMut<T> for Box<T, A> {
* could have a method to project a Pin<T> from it.
*/
#[stable(feature = "pin", since = "1.33.0")]
impl<T: ?Sized, A: Allocator> Unpin for Box<T, A> where A: 'static {}
impl<T: ?Sized, A: Allocator> Unpin for Box<T, A> {}

#[unstable(feature = "coroutine_trait", issue = "43122")]
impl<G: ?Sized + Coroutine<R> + Unpin, R, A: Allocator> Coroutine<R> for Box<G, A>
where
A: 'static,
{
impl<G: ?Sized + Coroutine<R> + Unpin, R, A: Allocator> Coroutine<R> for Box<G, A> {
type Yield = G::Yield;
type Return = G::Return;

Expand All @@ -2170,10 +2167,7 @@ where
}

#[stable(feature = "futures_api", since = "1.36.0")]
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A>
where
A: 'static,
{
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> {
type Output = F::Output;

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down

0 comments on commit c5f69bd

Please sign in to comment.