Skip to content

Commit 3316b1e

Browse files
committed
rustc: Remove ~[T] from the language
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
1 parent f9260d4 commit 3316b1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+355
-823
lines changed

Diff for: src/liballoc/heap.rs

-25
Original file line numberDiff line numberDiff line change
@@ -155,24 +155,6 @@ unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uin
155155
alloc as *mut u8
156156
}
157157

158-
// hack for libcore
159-
#[no_mangle]
160-
#[doc(hidden)]
161-
#[deprecated]
162-
#[cfg(not(test))]
163-
pub unsafe extern "C" fn rust_allocate(size: uint, align: uint) -> *mut u8 {
164-
allocate(size, align)
165-
}
166-
167-
// hack for libcore
168-
#[no_mangle]
169-
#[doc(hidden)]
170-
#[deprecated]
171-
#[cfg(not(test))]
172-
pub unsafe extern "C" fn rust_deallocate(ptr: *mut u8, size: uint, align: uint) {
173-
deallocate(ptr, size, align)
174-
}
175-
176158
#[cfg(test)]
177159
mod bench {
178160
extern crate test;
@@ -184,11 +166,4 @@ mod bench {
184166
box 10
185167
})
186168
}
187-
188-
#[bench]
189-
fn alloc_owned_big(b: &mut Bencher) {
190-
b.iter(|| {
191-
box [10, ..1000]
192-
})
193-
}
194169
}

Diff for: src/libcollections/hash/mod.rs

-7
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@ impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a mut [T] {
213213
}
214214
}
215215

216-
impl<S: Writer, T: Hash<S>> Hash<S> for ~[T] {
217-
#[inline]
218-
fn hash(&self, state: &mut S) {
219-
self.as_slice().hash(state);
220-
}
221-
}
222-
223216
impl<S: Writer, T: Hash<S>> Hash<S> for Vec<T> {
224217
#[inline]
225218
fn hash(&self, state: &mut S) {

Diff for: src/libcollections/hash/sip.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ mod tests {
276276
use str::Str;
277277
use string::String;
278278
use slice::{Vector, ImmutableVector};
279+
use vec::Vec;
279280

280281
use super::super::{Hash, Writer};
281282
use super::{SipState, hash, hash_with_keys};
@@ -376,8 +377,8 @@ mod tests {
376377
s
377378
}
378379

379-
fn result_bytes(h: u64) -> ~[u8] {
380-
box [(h >> 0) as u8,
380+
fn result_bytes(h: u64) -> Vec<u8> {
381+
vec![(h >> 0) as u8,
381382
(h >> 8) as u8,
382383
(h >> 16) as u8,
383384
(h >> 24) as u8,

0 commit comments

Comments
 (0)