Skip to content

Commit 1265af0

Browse files
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.
1 parent 317d14a commit 1265af0

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Diff for: library/alloc/src/boxed.rs

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

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

@@ -2133,10 +2130,7 @@ where
21332130
}
21342131

21352132
#[stable(feature = "futures_api", since = "1.36.0")]
2136-
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A>
2137-
where
2138-
A: 'static,
2139-
{
2133+
impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> {
21402134
type Output = F::Output;
21412135

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

0 commit comments

Comments
 (0)