Skip to content

Commit a35675d

Browse files
committed
Remove 'static bounds on P.
These date back to 2014. I don't think they're needed any more.
1 parent 283db70 commit a35675d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_ast/src/ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ pub struct P<T: ?Sized> {
3232

3333
/// Construct a `P<T>` from a `T` value.
3434
#[allow(non_snake_case)]
35-
pub fn P<T: 'static>(value: T) -> P<T> {
35+
pub fn P<T>(value: T) -> P<T> {
3636
P { ptr: Box::new(value) }
3737
}
3838

39-
impl<T: 'static> P<T> {
39+
impl<T> P<T> {
4040
/// Move out of the pointer.
4141
/// Intended for chaining transformations not covered by `map`.
4242
pub fn and_then<U, F>(self, f: F) -> U
@@ -86,7 +86,7 @@ impl<T: ?Sized> DerefMut for P<T> {
8686
}
8787
}
8888

89-
impl<T: 'static + Clone> Clone for P<T> {
89+
impl<T: Clone> Clone for P<T> {
9090
fn clone(&self) -> P<T> {
9191
P((**self).clone())
9292
}
@@ -110,7 +110,7 @@ impl<T> fmt::Pointer for P<T> {
110110
}
111111
}
112112

113-
impl<D: Decoder, T: 'static + Decodable<D>> Decodable<D> for P<T> {
113+
impl<D: Decoder, T: Decodable<D>> Decodable<D> for P<T> {
114114
fn decode(d: &mut D) -> P<T> {
115115
P(Decodable::decode(d))
116116
}

0 commit comments

Comments
 (0)