Skip to content

Commit 6859750

Browse files
committed
Remove support for P<[T]>.
It's no longer used.
1 parent 0f285e3 commit 6859750

File tree

1 file changed

+1
-78
lines changed

1 file changed

+1
-78
lines changed

compiler/rustc_ast/src/ptr.rs

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
2020
use std::fmt::{self, Debug, Display};
2121
use std::ops::{Deref, DerefMut};
22-
use std::{slice, vec};
2322

2423
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2524
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
25+
2626
/// An owned smart pointer.
2727
///
2828
/// See the [module level documentation][crate::ptr] for details.
@@ -111,83 +111,6 @@ impl<S: Encoder, T: Encodable<S>> Encodable<S> for P<T> {
111111
}
112112
}
113113

114-
impl<T> P<[T]> {
115-
// FIXME(const-hack) make this const again
116-
pub fn new() -> P<[T]> {
117-
P { ptr: Box::default() }
118-
}
119-
120-
#[inline(never)]
121-
pub fn from_vec(v: Vec<T>) -> P<[T]> {
122-
P { ptr: v.into_boxed_slice() }
123-
}
124-
125-
#[inline(never)]
126-
pub fn into_vec(self) -> Vec<T> {
127-
self.ptr.into_vec()
128-
}
129-
}
130-
131-
impl<T> Default for P<[T]> {
132-
/// Creates an empty `P<[T]>`.
133-
fn default() -> P<[T]> {
134-
P::new()
135-
}
136-
}
137-
138-
impl<T: Clone> Clone for P<[T]> {
139-
fn clone(&self) -> P<[T]> {
140-
P::from_vec(self.to_vec())
141-
}
142-
}
143-
144-
impl<T> From<Vec<T>> for P<[T]> {
145-
fn from(v: Vec<T>) -> Self {
146-
P::from_vec(v)
147-
}
148-
}
149-
150-
impl<T> From<P<[T]>> for Vec<T> {
151-
fn from(val: P<[T]>) -> Self {
152-
val.into_vec()
153-
}
154-
}
155-
156-
impl<T> FromIterator<T> for P<[T]> {
157-
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> P<[T]> {
158-
P::from_vec(iter.into_iter().collect())
159-
}
160-
}
161-
162-
impl<T> IntoIterator for P<[T]> {
163-
type Item = T;
164-
type IntoIter = vec::IntoIter<T>;
165-
166-
fn into_iter(self) -> Self::IntoIter {
167-
self.into_vec().into_iter()
168-
}
169-
}
170-
171-
impl<'a, T> IntoIterator for &'a P<[T]> {
172-
type Item = &'a T;
173-
type IntoIter = slice::Iter<'a, T>;
174-
fn into_iter(self) -> Self::IntoIter {
175-
self.ptr.iter()
176-
}
177-
}
178-
179-
impl<S: Encoder, T: Encodable<S>> Encodable<S> for P<[T]> {
180-
fn encode(&self, s: &mut S) {
181-
Encodable::encode(&**self, s);
182-
}
183-
}
184-
185-
impl<D: Decoder, T: Decodable<D>> Decodable<D> for P<[T]> {
186-
fn decode(d: &mut D) -> P<[T]> {
187-
P::from_vec(Decodable::decode(d))
188-
}
189-
}
190-
191114
impl<CTX, T> HashStable<CTX> for P<T>
192115
where
193116
T: ?Sized + HashStable<CTX>,

0 commit comments

Comments
 (0)