diff options
| author | bors <bors@rust-lang.org> | 2024-02-22 02:03:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-22 02:03:29 +0000 |
| commit | c5f69bdd5173a948e0131f934fa7c4cbf5e0b55f (patch) | |
| tree | 07af42fe6f1cc39cb14317932d68daa39ce8bff3 | |
| parent | d8b00690ec3aa2d2fb0d3eb00e862195501186f9 (diff) | |
| parent | 1265af03964a7af80f91e72151c4e857f345f1b0 (diff) | |
| download | rust-c5f69bdd5173a948e0131f934fa7c4cbf5e0b55f.tar.gz rust-c5f69bdd5173a948e0131f934fa7c4cbf5e0b55f.zip | |
Auto merge of #118634 - Jules-Bertholet:box-allocator-static, r=Amanieu
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.
| -rw-r--r-- | library/alloc/src/boxed.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 92600b8e5bd..b202d9250d5 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -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; @@ -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> { |
