Skip to content

Commit c5f69bd

Browse files
committed
Auto merge of rust-lang#118634 - Jules-Bertholet:box-allocator-static, 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.
2 parents d8b0069 + 1265af0 commit c5f69bd

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

library/alloc/src/boxed.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -2141,13 +2141,10 @@ impl<T: ?Sized, A: Allocator> AsMut<T> for Box<T, A> {
21412141
* could have a method to project a Pin<T> from it.
21422142
*/
21432143
#[stable(feature = "pin", since = "1.33.0")]
2144-
impl<T: ?Sized, A: Allocator> Unpin for Box<T, A> where A: 'static {}
2144+
impl<T: ?Sized, A: Allocator> Unpin for Box<T, A> {}
21452145

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

@@ -2170,10 +2167,7 @@ where
21702167
}
21712168

21722169
#[stable(feature = "futures_api", since = "1.36.0")]
2173-
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A>
2174-
where
2175-
A: 'static,
2176-
{
2170+
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> {
21772171
type Output = F::Output;
21782172

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

0 commit comments

Comments
 (0)