Skip to content

Commit bf8c45a

Browse files
committed
---
yaml --- r: 102097 b: refs/heads/master c: ad9e26d h: refs/heads/master i: 102095: 7af326b v: v3
1 parent 247d910 commit bf8c45a

File tree

221 files changed

+951
-2014
lines changed

Some content is hidden

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

221 files changed

+951
-2014
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 551da0615764853153db944063ae2e271414a71b
2+
refs/heads/master: ad9e26dab3ae8f5d739e89167338bc97b99905b7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ DEPS_flate := std native:miniz
6969
DEPS_arena := std collections
7070
DEPS_glob := std
7171
DEPS_serialize := std
72-
DEPS_term := std collections
72+
DEPS_term := std
7373
DEPS_semver := std
7474
DEPS_uuid := std serialize
7575
DEPS_sync := std

trunk/mk/prepare.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# It requires the following variables to be set:
1818
#
19-
# PREPARE_HOST - the host triple
19+
# PREPARE_HOST - the host triple
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

@@ -172,10 +172,7 @@ prepare-target-$(2)-host-$(3)-$(1): \
172172
$$(if $$(findstring $(2),$$(CFG_HOST)), \
173173
$$(foreach crate,$$(HOST_CRATES), \
174174
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)),)
175-
# Only install if this host and target combo is being prepared. Also be sure to
176-
# *not* install the rlibs for host crates because there's no need to statically
177-
# link against most of them. They just produce a large amount of extra size
178-
# bloat.
175+
# Only install if this host and target combo is being prepared
179176
$$(if $$(findstring $(1), $$(PREPARE_STAGE)),\
180177
$$(if $$(findstring $(2), $$(PREPARE_TARGETS)),\
181178
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
@@ -185,7 +182,8 @@ prepare-target-$(2)-host-$(3)-$(1): \
185182
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate))))\
186183
$$(if $$(findstring $(2),$$(CFG_HOST)),\
187184
$$(foreach crate,$$(HOST_CRATES),\
188-
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),)\
185+
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))\
186+
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate)))),)\
189187
$$(call PREPARE_LIB,libmorestack.a) \
190188
$$(call PREPARE_LIB,libcompiler-rt.a),),),)
191189
endef

trunk/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ expression context, the final namespace qualifier is omitted.
467467
Two examples of paths with type arguments:
468468

469469
~~~~
470-
# struct HashMap<K, V>;
470+
# use std::hashmap::HashMap;
471471
# fn f() {
472472
# fn id<T>(t: T) -> T { t }
473473
type T = HashMap<int,~str>; // Type arguments used in a type expression

trunk/src/doc/tutorial.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,8 @@ illegal to copy and pass by value.
19771977
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
19781978
19791979
~~~~
1980-
extern crate collections;
1981-
type Set<T> = collections::HashMap<T, ()>;
1980+
use std::hashmap::HashMap;
1981+
type Set<T> = HashMap<T, ()>;
19821982
19831983
struct Stack<T> {
19841984
elements: ~[T]
@@ -1988,7 +1988,6 @@ enum Option<T> {
19881988
Some(T),
19891989
None
19901990
}
1991-
# fn main() {}
19921991
~~~~
19931992
19941993
These declarations can be instantiated to valid types like `Set<int>`,

trunk/src/etc/combine-tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def scrub(b):
5555
#[crate_id=\"run_pass_stage2#0.1\"];
5656
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
5757
#[allow(warnings)];
58-
extern crate collections;
59-
extern crate extra;
6058
"""
6159
)
6260
for t in stage2_tests:

trunk/src/etc/generate-deriving-span-tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ def write_file(name, string):
119119
('Clone', [], 1), ('DeepClone', ['Clone'], 1),
120120
('Eq', [], 2), ('Ord', [], 8),
121121
('TotalEq', [], 1), ('TotalOrd', ['TotalEq'], 1),
122-
('Show', [], 1),
123-
('Hash', [], 1)]:
122+
('Show', [], 1)]:
124123
traits[trait] = (ALL, supers, errs)
125124

126125
for (trait, (types, super_traits, error_count)) in traits.items():

trunk/src/libarena/lib.rs

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ use std::cast::{transmute, transmute_mut, transmute_mut_region};
3131
use std::cast;
3232
use std::cell::{Cell, RefCell};
3333
use std::mem;
34-
use std::ptr::read;
3534
use std::cmp;
3635
use std::num;
3736
use std::kinds::marker;
3837
use std::rc::Rc;
3938
use std::rt::global_heap;
40-
use std::intrinsics::{TyDesc, get_tydesc};
41-
use std::intrinsics;
39+
use std::unstable::intrinsics::{TyDesc, get_tydesc};
40+
use std::unstable::intrinsics;
4241
use std::vec;
4342

4443
// The way arena uses arrays is really deeply awful. The arrays are
@@ -346,32 +345,37 @@ pub struct TypedArena<T> {
346345
/// reached, a new chunk is allocated.
347346
priv end: *T,
348347

348+
/// The type descriptor of the objects in the arena. This should not be
349+
/// necessary, but is until generic destructors are supported.
350+
priv tydesc: *TyDesc,
351+
349352
/// A pointer to the first arena segment.
350-
priv first: Option<~TypedArenaChunk<T>>,
353+
priv first: Option<~TypedArenaChunk>,
351354
}
352355

353-
struct TypedArenaChunk<T> {
356+
struct TypedArenaChunk {
354357
/// Pointer to the next arena segment.
355-
next: Option<~TypedArenaChunk<T>>,
358+
next: Option<~TypedArenaChunk>,
356359

357360
/// The number of elements that this chunk can hold.
358361
capacity: uint,
359362

360363
// Objects follow here, suitably aligned.
361364
}
362365

363-
impl<T> TypedArenaChunk<T> {
366+
impl TypedArenaChunk {
364367
#[inline]
365-
fn new(next: Option<~TypedArenaChunk<T>>, capacity: uint) -> ~TypedArenaChunk<T> {
366-
let mut size = mem::size_of::<TypedArenaChunk<T>>();
368+
fn new<T>(next: Option<~TypedArenaChunk>, capacity: uint)
369+
-> ~TypedArenaChunk {
370+
let mut size = mem::size_of::<TypedArenaChunk>();
367371
size = round_up(size, mem::min_align_of::<T>());
368372
let elem_size = mem::size_of::<T>();
369373
let elems_size = elem_size.checked_mul(&capacity).unwrap();
370374
size = size.checked_add(&elems_size).unwrap();
371375

372376
let mut chunk = unsafe {
373377
let chunk = global_heap::exchange_malloc(size);
374-
let mut chunk: ~TypedArenaChunk<T> = cast::transmute(chunk);
378+
let mut chunk: ~TypedArenaChunk = cast::transmute(chunk);
375379
mem::move_val_init(&mut chunk.next, next);
376380
chunk
377381
};
@@ -383,13 +387,16 @@ impl<T> TypedArenaChunk<T> {
383387
/// Destroys this arena chunk. If the type descriptor is supplied, the
384388
/// drop glue is called; otherwise, drop glue is not called.
385389
#[inline]
386-
unsafe fn destroy(&mut self, len: uint) {
390+
unsafe fn destroy(&mut self, len: uint, opt_tydesc: Option<*TyDesc>) {
387391
// Destroy all the allocated objects.
388-
if intrinsics::needs_drop::<T>() {
389-
let mut start = self.start();
390-
for _ in range(0, len) {
391-
read(start as *T); // run the destructor on the pointer
392-
start = start.offset(mem::size_of::<T>() as int)
392+
match opt_tydesc {
393+
None => {}
394+
Some(tydesc) => {
395+
let mut start = self.start(tydesc);
396+
for _ in range(0, len) {
397+
((*tydesc).drop_glue)(start as *i8);
398+
start = start.offset((*tydesc).size as int)
399+
}
393400
}
394401
}
395402

@@ -399,26 +406,26 @@ impl<T> TypedArenaChunk<T> {
399406
None => {}
400407
Some(mut next) => {
401408
// We assume that the next chunk is completely filled.
402-
next.destroy(next.capacity)
409+
next.destroy(next.capacity, opt_tydesc)
403410
}
404411
}
405412
}
406413

407414
// Returns a pointer to the first allocated object.
408415
#[inline]
409-
fn start(&self) -> *u8 {
410-
let this: *TypedArenaChunk<T> = self;
416+
fn start(&self, tydesc: *TyDesc) -> *u8 {
417+
let this: *TypedArenaChunk = self;
411418
unsafe {
412-
cast::transmute(round_up(this.offset(1) as uint, mem::min_align_of::<T>()))
419+
cast::transmute(round_up(this.offset(1) as uint, (*tydesc).align))
413420
}
414421
}
415422

416423
// Returns a pointer to the end of the allocated space.
417424
#[inline]
418-
fn end(&self) -> *u8 {
425+
fn end(&self, tydesc: *TyDesc) -> *u8 {
419426
unsafe {
420-
let size = mem::size_of::<T>().checked_mul(&self.capacity).unwrap();
421-
self.start().offset(size as int)
427+
let size = (*tydesc).size.checked_mul(&self.capacity).unwrap();
428+
self.start(tydesc).offset(size as int)
422429
}
423430
}
424431
}
@@ -434,10 +441,14 @@ impl<T> TypedArena<T> {
434441
/// objects.
435442
#[inline]
436443
pub fn with_capacity(capacity: uint) -> TypedArena<T> {
437-
let chunk = TypedArenaChunk::<T>::new(None, capacity);
444+
let chunk = TypedArenaChunk::new::<T>(None, capacity);
445+
let tydesc = unsafe {
446+
intrinsics::get_tydesc::<T>()
447+
};
438448
TypedArena {
439-
ptr: chunk.start() as *T,
440-
end: chunk.end() as *T,
449+
ptr: chunk.start(tydesc) as *T,
450+
end: chunk.end(tydesc) as *T,
451+
tydesc: tydesc,
441452
first: Some(chunk),
442453
}
443454
}
@@ -464,9 +475,9 @@ impl<T> TypedArena<T> {
464475
fn grow(&mut self) {
465476
let chunk = self.first.take_unwrap();
466477
let new_capacity = chunk.capacity.checked_mul(&2).unwrap();
467-
let chunk = TypedArenaChunk::<T>::new(Some(chunk), new_capacity);
468-
self.ptr = chunk.start() as *T;
469-
self.end = chunk.end() as *T;
478+
let chunk = TypedArenaChunk::new::<T>(Some(chunk), new_capacity);
479+
self.ptr = chunk.start(self.tydesc) as *T;
480+
self.end = chunk.end(self.tydesc) as *T;
470481
self.first = Some(chunk)
471482
}
472483
}
@@ -475,13 +486,18 @@ impl<T> TypedArena<T> {
475486
impl<T> Drop for TypedArena<T> {
476487
fn drop(&mut self) {
477488
// Determine how much was filled.
478-
let start = self.first.get_ref().start() as uint;
489+
let start = self.first.get_ref().start(self.tydesc) as uint;
479490
let end = self.ptr as uint;
480491
let diff = (end - start) / mem::size_of::<T>();
481492

482493
// Pass that to the `destroy` method.
483494
unsafe {
484-
self.first.get_mut_ref().destroy(diff)
495+
let opt_tydesc = if intrinsics::needs_drop::<T>() {
496+
Some(self.tydesc)
497+
} else {
498+
None
499+
};
500+
self.first.get_mut_ref().destroy(diff, opt_tydesc)
485501
}
486502
}
487503
}

trunk/src/libcollections/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,21 @@ pub use btree::BTree;
2727
pub use deque::Deque;
2828
pub use dlist::DList;
2929
pub use enum_set::EnumSet;
30-
pub use hashmap::{HashMap, HashSet};
3130
pub use list::List;
3231
pub use lru_cache::LruCache;
3332
pub use priority_queue::PriorityQueue;
3433
pub use ringbuf::RingBuf;
3534
pub use smallintmap::SmallIntMap;
3635
pub use treemap::{TreeMap, TreeSet};
37-
pub use trie::{TrieMap, TrieSet};
3836

3937
pub mod bitv;
4038
pub mod btree;
4139
pub mod deque;
4240
pub mod dlist;
4341
pub mod enum_set;
44-
pub mod hashmap;
4542
pub mod list;
4643
pub mod lru_cache;
4744
pub mod priority_queue;
4845
pub mod ringbuf;
4946
pub mod smallintmap;
5047
pub mod treemap;
51-
pub mod trie;

trunk/src/libcollections/lru_cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
//! ```
3939
4040
use std::container::Container;
41+
use std::hashmap::HashMap;
4142
use std::to_bytes::Cb;
4243
use std::ptr;
4344
use std::cast;
4445

45-
use HashMap;
46-
4746
struct KeyRef<K> { k: *K }
4847

4948
struct LruEntry<K, V> {

trunk/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn main() {
235235

236236
use std::char;
237237
use std::f64;
238-
use collections::HashMap;
238+
use std::hashmap::HashMap;
239239
use std::io;
240240
use std::io::MemWriter;
241241
use std::num;

trunk/src/libextra/stats.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
#[allow(missing_doc)];
1212

1313
use std::cmp;
14-
use std::hash_old::Hash;
14+
use std::hashmap;
1515
use std::io;
1616
use std::mem;
1717
use std::num;
18-
use collections::hashmap;
1918

2019
// NB: this can probably be rewritten in terms of num::Num
2120
// to be less f64-specific.

trunk/src/libextra/url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::io::BufReader;
1616
use std::cmp::Eq;
17-
use collections::HashMap;
17+
use std::hashmap::HashMap;
1818
use std::to_bytes;
1919
use std::uint;
2020

@@ -957,7 +957,7 @@ mod tests {
957957
958958
use super::*;
959959
960-
use collections::HashMap;
960+
use std::hashmap::HashMap;
961961
962962
#[test]
963963
fn test_url_parse() {

trunk/src/libgreen/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use std::uint;
1212
use std::cast::{transmute, transmute_mut_unsafe,
1313
transmute_region, transmute_mut_region};
1414
use stack::Stack;
15-
use std::rt::stack;
16-
use std::raw;
15+
use std::unstable::stack;
16+
use std::unstable::raw;
1717

1818
// FIXME #7761: Registers is boxed so that it is 16-byte aligned, for storing
1919
// SSE regs. It would be marginally better not to do this. In C++ we

trunk/src/libgreen/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ memory and partly incapable of presentation to others.",
124124
abort();
125125

126126
fn abort() -> ! {
127-
use std::intrinsics;
127+
use std::unstable::intrinsics;
128128
unsafe { intrinsics::abort() }
129129
}
130130
}

trunk/src/libgreen/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::rt::task::BlockedTask;
1616
use std::rt::task::Task;
1717
use std::sync::deque;
1818
use std::unstable::mutex::NativeMutex;
19-
use std::raw;
19+
use std::unstable::raw;
2020

2121
use TaskState;
2222
use context::Context;

trunk/src/libgreen/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::rt::rtio;
2626
use std::rt::task::{Task, BlockedTask, SendMessage};
2727
use std::task::TaskOpts;
2828
use std::unstable::mutex::NativeMutex;
29-
use std::raw;
29+
use std::unstable::raw;
3030

3131
use context::Context;
3232
use coroutine::Coroutine;

trunk/src/libnative/io/pipe_unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::libc;
1515
use std::mem;
1616
use std::rt::rtio;
1717
use std::sync::arc::UnsafeArc;
18-
use std::intrinsics;
18+
use std::unstable::intrinsics;
1919

2020
use super::{IoResult, retry};
2121
use super::file::{keep_going, fd_t};

0 commit comments

Comments
 (0)