Skip to content

Commit fe7df73

Browse files
committed
---
yaml --- r: 48767 b: refs/heads/snap-stage3 c: d597a19 h: refs/heads/master i: 48765: 8f320af 48763: a4f39bb 48759: 0199f0a 48751: b074b1d 48735: 3975822 48703: 102cf45 48639: 5ba7898 v: v3
1 parent 5426512 commit fe7df73

File tree

87 files changed

+204
-623
lines changed

Some content is hidden

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

87 files changed

+204
-623
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ebba8b4e3591c95508a4c1121784e768272a574a
4+
refs/heads/snap-stage3: d597a19b3062327f5fc26bc963bc5859ad3f6c04
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/RELEASES.txt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Version 0.6 (March 2013)
1010
* Remove `static` keyword
1111
* Static method syntax
1212
* `as Trait`
13-
* `copy` removed, replaced with `Clone`?
14-
* `std::map` removed, replaced with `core::hashmap`
13+
* `copy` removed?
1514

1615
* Syntax changes
1716
* The self type parameter in traits is now spelled `Self`
@@ -39,8 +38,7 @@ Version 0.6 (March 2013)
3938
* Trait implementations no longer support visibility modifiers
4039

4140
* Semantic changes
42-
* Types with owned pointers or custom destructors move by default,
43-
eliminating the `move` keyword
41+
* Linear types move by default, eliminating the `move` keyword
4442
* All foreign functions are considered unsafe
4543
* &mut is now unaliasable
4644
* Writes to borrowed @mut pointers are prevented dynamically
@@ -59,19 +57,16 @@ Version 0.6 (March 2013)
5957
improve inference and eliminate unsoundness
6058

6159
* Libraries
60+
* Lots of effort to organize the container API's around `core::container`
61+
* `core::send_map` renamed to `core::hashmap`
6262
* Added big integers to `std::bigint`
6363
* Removed `core::oldcomm` module
6464
* Added pipe-based `core::comm` module
65+
* Reimplemented `std::treemap`
6566
* Numeric traits have been reorganized under `core::num`
67+
* `core::dvec` removed. Use `@mut ~[T]` or other language types
6668
* `vec::slice` finally returns a slice
6769
* `debug!` and friends don't require a format string, e.g. `debug!(Foo)`
68-
* Containers reorganized around traits in `core::container`
69-
* `core::dvec` removed, `~[T]` is a drop-in replacement
70-
* `core::send_map` renamed to `core::hashmap`
71-
* `std::treemap` reimplemented as an owned balanced tree
72-
* `std::deque` and `std::smallintmap` reimplemented as owned containers
73-
* `core::trie` added as a fast ordered map for integer keys
74-
* Set types added to `core::hashmap`, `core::trie` and `std::treemap`
7570

7671
* Tools
7772
* Replaced the 'cargo' package manager with 'rustpkg'

branches/snap-stage3/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS) \
132132

133133
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1))
134134
@$$(call E, link: $$@)
135-
$$(Q)$(AR_$(1)) rcs $$@ $$<
135+
$$(Q)ar rcs $$@ $$<
136136

137137
rt/$(1)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
138138
$$(RUNTIME_DEF_$(1)) \

branches/snap-stage3/src/libcore/clone.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ impl Clone for () {
2020
fn clone(&self) -> () { () }
2121
}
2222

23-
impl<T:Clone> Clone for ~T {
24-
#[inline(always)]
25-
fn clone(&self) -> ~T { ~(**self).clone() }
26-
}
27-
2823
macro_rules! clone_impl(
2924
($t:ty) => {
3025
impl Clone for $t {

branches/snap-stage3/src/libcore/container.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ pub trait Map<K, V>: Mutable {
3535
/// Visit all values
3636
pure fn each_value(&self, f: &fn(&V) -> bool);
3737

38-
/// Iterate over the map and mutate the contained values
39-
fn mutate_values(&mut self, f: &fn(&K, &mut V) -> bool);
40-
4138
/// Return the value corresponding to the key in the map
4239
pure fn find(&self, key: &K) -> Option<&self/V>;
4340

branches/snap-stage3/src/libcore/core.rc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Implicitly, all crates behave as if they included the following prologue:
5656

5757
// On Linux, link to the runtime with -lrt.
5858
#[cfg(target_os = "linux")]
59-
#[doc(hidden)]
6059
pub mod linkhack {
6160
#[link_args="-lrustrt -lrt"]
6261
#[link_args = "-lpthread"]
@@ -253,7 +252,7 @@ pub mod rt;
253252
// A curious inner-module that's not exported that contains the binding
254253
// 'core' so that macro-expanded references to core::error and such
255254
// can be resolved within libcore.
256-
#[doc(hidden)]
255+
#[doc(hidden)] // FIXME #3538
257256
pub mod core {
258257
#[cfg(stage0)]
259258
pub const error : u32 = 1_u32;

branches/snap-stage3/src/libcore/hashmap.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,19 +325,6 @@ pub mod linear {
325325
self.each(|&(_, v)| blk(v))
326326
}
327327
328-
/// Iterate over the map and mutate the contained values
329-
fn mutate_values(&mut self, blk: &fn(&'self K,
330-
&'self mut V) -> bool) {
331-
for uint::range(0, self.buckets.len()) |i| {
332-
match self.buckets[i] {
333-
Some(Bucket{key: ref key, value: ref mut value, _}) => {
334-
if !blk(key, value) { return }
335-
}
336-
None => ()
337-
}
338-
}
339-
}
340-
341328
/// Return the value corresponding to the key in the map
342329
pure fn find(&self, k: &K) -> Option<&self/V> {
343330
match self.bucket_for_key(k) {

branches/snap-stage3/src/libcore/iter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ pub trait ReverseIter<A>: BaseIter<A> {
3131
pure fn each_reverse(&self, blk: &fn(&A) -> bool);
3232
}
3333

34-
pub trait MutableIter<A>: BaseIter<A> {
35-
fn each_mut(&mut self, blk: &fn(&mut A) -> bool);
36-
}
37-
3834
pub trait ExtendedIter<A> {
3935
pure fn eachi(&self, blk: &fn(uint, v: &A) -> bool);
4036
pure fn all(&self, blk: &fn(&A) -> bool) -> bool;

branches/snap-stage3/src/libcore/option.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use ops::Add;
4646
use kinds::Copy;
4747
use util;
4848
use num::Zero;
49-
use iter::{BaseIter, MutableIter};
49+
use iter::BaseIter;
5050

5151
#[cfg(test)] use ptr;
5252
#[cfg(test)] use str;
@@ -323,13 +323,6 @@ impl<T> BaseIter<T> for Option<T> {
323323
}
324324
}
325325
326-
impl<T> MutableIter<T> for Option<T> {
327-
#[inline(always)]
328-
fn each_mut(&mut self, f: &fn(&'self mut T) -> bool) {
329-
match *self { None => (), Some(ref mut t) => { f(t); } }
330-
}
331-
}
332-
333326
pub impl<T> Option<T> {
334327
/// Returns true if the option equals `none`
335328
#[inline(always)]

branches/snap-stage3/src/libcore/prelude.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ pub use clone::Clone;
2727
pub use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
2828
pub use container::{Container, Mutable, Map, Set};
2929
pub use hash::Hash;
30-
pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};
31-
pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter};
32-
pub use iter::Times;
30+
pub use iter::{BaseIter, ReverseIter, ExtendedIter, EqIter, CopyableIter};
31+
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
3332
pub use num::NumCast;
3433
pub use path::GenericPath;
3534
pub use path::Path;
@@ -44,10 +43,6 @@ pub use vec::{CopyableVector, ImmutableVector};
4443
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
4544
pub use vec::{OwnedVector, OwnedCopyableVector};
4645

47-
/* Reexported runtime types */
48-
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
49-
pub use task::spawn;
50-
5146
/* Reexported modules */
5247

5348
pub use at_vec;

branches/snap-stage3/src/libcore/rt/thread_local_storage.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ type pthread_key_t = c_ulong;
4040

4141
#[cfg(target_os="linux")]
4242
#[cfg(target_os="freebsd")]
43-
#[cfg(target_os="android")]
4443
#[allow(non_camel_case_types)] // foreign type
4544
type pthread_key_t = c_uint;
4645

branches/snap-stage3/src/libcore/str.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use at_vec;
2121
use cast;
2222
use char;
23-
use clone::Clone;
2423
use cmp::{Equiv, TotalOrd, Ordering, Less, Equal, Greater};
2524
use libc;
2625
use option::{None, Option, Some};
@@ -2274,7 +2273,6 @@ pub trait StrSlice {
22742273
pure fn to_owned(&self) -> ~str;
22752274
pure fn to_managed(&self) -> @str;
22762275
pure fn char_at(&self, i: uint) -> char;
2277-
fn to_bytes(&self) -> ~[u8];
22782276
}
22792277
22802278
/// Extension methods for strings
@@ -2418,8 +2416,6 @@ impl StrSlice for &self/str {
24182416
24192417
#[inline]
24202418
pure fn char_at(&self, i: uint) -> char { char_at(*self, i) }
2421-
2422-
fn to_bytes(&self) -> ~[u8] { to_bytes(*self) }
24232419
}
24242420
24252421
pub trait OwnedStr {
@@ -2437,13 +2433,6 @@ impl OwnedStr for ~str {
24372433
}
24382434
}
24392435
2440-
impl Clone for ~str {
2441-
#[inline(always)]
2442-
fn clone(&self) -> ~str {
2443-
self.to_str() // hilarious
2444-
}
2445-
}
2446-
24472436
#[cfg(test)]
24482437
mod tests {
24492438
use char;

branches/snap-stage3/src/libcore/trie.rs

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,11 @@ impl<T> Map<uint, T> for TrieMap<T> {
8181

8282
/// Visit all values in order
8383
#[inline(always)]
84-
pure fn each_value(&self, f: &fn(&T) -> bool) {
84+
pure fn each_value(&self,
85+
f: &fn(&T) -> bool) {
8586
self.each(|&(_, v)| f(v))
8687
}
8788

88-
/// Iterate over the map and mutate the contained values
89-
#[inline(always)]
90-
fn mutate_values(&mut self, f: &fn(&uint, &mut T) -> bool) {
91-
self.root.mutate_values(f);
92-
}
93-
9489
/// Return the value corresponding to the key in the map
9590
#[inline(hint)]
9691
pure fn find(&self, key: &uint) -> Option<&self/T> {
@@ -137,7 +132,6 @@ impl<T> Map<uint, T> for TrieMap<T> {
137132
}
138133

139134
impl<T> TrieMap<T> {
140-
/// Create an empty TrieMap
141135
#[inline(always)]
142136
static pure fn new() -> TrieMap<T> {
143137
TrieMap{root: TrieNode::new(), length: 0}
@@ -156,6 +150,11 @@ impl<T> TrieMap<T> {
156150
pure fn each_value_reverse(&self, f: &fn(&T) -> bool) {
157151
self.each_reverse(|&(_, v)| f(v))
158152
}
153+
154+
/// Iterate over the map and mutate the contained values
155+
fn mutate_values(&mut self, f: &fn(uint, &mut T) -> bool) {
156+
self.root.mutate_values(f);
157+
}
159158
}
160159

161160
pub struct TrieSet {
@@ -192,12 +191,6 @@ impl Mutable for TrieSet {
192191
}
193192

194193
impl TrieSet {
195-
/// Create an empty TrieSet
196-
#[inline(always)]
197-
static pure fn new() -> TrieSet {
198-
TrieSet{map: TrieMap::new()}
199-
}
200-
201194
/// Return true if the set contains a value
202195
#[inline(always)]
203196
pure fn contains(&self, value: &uint) -> bool {
@@ -255,13 +248,13 @@ impl<T> TrieNode<T> {
255248
true
256249
}
257250

258-
fn mutate_values(&mut self, f: &fn(&uint, &mut T) -> bool) -> bool {
251+
fn mutate_values(&mut self, f: &fn(uint, &mut T) -> bool) -> bool {
259252
for vec::each_mut(self.children) |child| {
260253
match *child {
261254
Internal(ref mut x) => if !x.mutate_values(f) {
262255
return false
263256
},
264-
External(k, ref mut v) => if !f(&k, v) { return false },
257+
External(k, ref mut v) => if !f(k, v) { return false },
265258
Nothing => ()
266259
}
267260
}
@@ -272,12 +265,12 @@ impl<T> TrieNode<T> {
272265
// if this was done via a trait, the key could be generic
273266
#[inline(always)]
274267
pure fn chunk(n: uint, idx: uint) -> uint {
275-
let sh = uint::bits - (SHIFT * (idx + 1));
276-
(n >> sh) & MASK
268+
let real_idx = uint::bytes - 1 - idx;
269+
(n >> (SHIFT * real_idx)) & MASK
277270
}
278271

279-
fn insert<T>(count: &mut uint, child: &mut Child<T>, key: uint, value: T,
280-
idx: uint) -> bool {
272+
fn insert<T>(count: &mut uint, child: &mut Child<T>, key: uint,
273+
value: T, idx: uint) -> bool {
281274
let mut tmp = Nothing;
282275
tmp <-> *child;
283276
let mut added = false;
@@ -469,26 +462,4 @@ mod tests {
469462
n -= 1;
470463
}
471464
}
472-
473-
#[test]
474-
fn test_sane_chunk() {
475-
let x = 1;
476-
let y = 1 << (uint::bits - 1);
477-
478-
let mut trie = TrieSet::new();
479-
480-
fail_unless!(trie.insert(x));
481-
fail_unless!(trie.insert(y));
482-
483-
fail_unless!(trie.len() == 2);
484-
485-
let expected = [x, y];
486-
487-
let mut i = 0;
488-
489-
for trie.each |x| {
490-
fail_unless!(expected[i] == *x);
491-
i += 1;
492-
}
493-
}
494465
}

branches/snap-stage3/src/libcore/unstable/global.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ unsafe fn global_data_clone_create_<T:Owned + Clone>(
6868
match value {
6969
None => {
7070
let value = create();
71-
clone_value = Some((*value).clone());
71+
clone_value = Some(value.clone());
7272
Some(value)
7373
}
7474
Some(value) => {
75-
clone_value = Some((*value).clone());
75+
clone_value = Some(value.clone());
7676
Some(value)
7777
}
7878
}
@@ -193,7 +193,7 @@ fn get_global_state() -> Exclusive<GlobalState> {
193193
// Successfully installed the global pointer
194194

195195
// Take a handle to return
196-
let clone = (*state).clone();
196+
let clone = state.clone();
197197

198198
// Install a runtime exit function to destroy the global object
199199
do at_exit {

0 commit comments

Comments
 (0)