From 1265af03964a7af80f91e72151c4e857f345f1b0 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Mon, 4 Dec 2023 23:54:39 -0500 Subject: [PATCH] Remove useless `'static` bounds on `Box` allocator #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. --- library/alloc/src/boxed.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 25c63b425ce59..b51ab95dec2bb 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -2104,13 +2104,10 @@ impl AsMut for Box { * could have a method to project a Pin from it. */ #[stable(feature = "pin", since = "1.33.0")] -impl Unpin for Box where A: 'static {} +impl Unpin for Box {} #[unstable(feature = "coroutine_trait", issue = "43122")] -impl + Unpin, R, A: Allocator> Coroutine for Box -where - A: 'static, -{ +impl + Unpin, R, A: Allocator> Coroutine for Box { type Yield = G::Yield; type Return = G::Return; @@ -2133,10 +2130,7 @@ where } #[stable(feature = "futures_api", since = "1.36.0")] -impl Future for Box -where - A: 'static, -{ +impl Future for Box { type Output = F::Output; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll {