Skip to content

Commit 89ebe30

Browse files
committed
---
yaml --- r: 64317 b: refs/heads/snap-stage3 c: 1c35ab3 h: refs/heads/master i: 64315: a31c1c4 v: v3
1 parent 30b1e51 commit 89ebe30

Some content is hidden

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

56 files changed

+881
-729
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: bbe03da9c6bad23d8e09077461c1616872e1aca0
4+
refs/heads/snap-stage3: 1c35ab322ff2f26962a3550fffc2fa4154224b64
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/dist.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ PKG_FILES := \
1919
$(S)LICENSE-APACHE \
2020
$(S)LICENSE-MIT \
2121
$(S)AUTHORS.txt \
22+
$(S)CONTRIBUTING.md \
2223
$(S)README.md \
24+
$(S)RELEASES.txt \
2325
$(S)configure $(S)Makefile.in \
2426
$(S)man \
2527
$(S)doc \

branches/snap-stage3/mk/install.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ uninstall:
183183
do rm -f $$i ; \
184184
done
185185
$(Q)rm -Rf $(PHL)/rustc
186+
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rust.1
186187
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rustc.1
188+
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rustdoc.1
189+
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rusti.1
190+
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rustpkg.1
187191

188192
# target platform specific variables
189193
# for arm-linux-androidabi

branches/snap-stage3/src/libextra/bitv.rs

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -718,38 +718,6 @@ impl Set<uint> for BitvSet {
718718
*value < self.bitv.storage.len() * uint::bits && self.bitv.get(*value)
719719
}
720720

721-
fn insert(&mut self, value: uint) -> bool {
722-
if self.contains(&value) {
723-
return false;
724-
}
725-
let nbits = self.capacity();
726-
if value >= nbits {
727-
let newsize = num::max(value, nbits * 2) / uint::bits + 1;
728-
assert!(newsize > self.bitv.storage.len());
729-
self.bitv.storage.grow(newsize, &0);
730-
}
731-
self.size += 1;
732-
self.bitv.set(value, true);
733-
return true;
734-
}
735-
736-
fn remove(&mut self, value: &uint) -> bool {
737-
if !self.contains(value) {
738-
return false;
739-
}
740-
self.size -= 1;
741-
self.bitv.set(*value, false);
742-
743-
// Attempt to truncate our storage
744-
let mut i = self.bitv.storage.len();
745-
while i > 1 && self.bitv.storage[i - 1] == 0 {
746-
i -= 1;
747-
}
748-
self.bitv.storage.truncate(i);
749-
750-
return true;
751-
}
752-
753721
fn is_disjoint(&self, other: &BitvSet) -> bool {
754722
for self.intersection(other) |_| {
755723
return false;
@@ -816,6 +784,40 @@ impl Set<uint> for BitvSet {
816784
}
817785
}
818786

787+
impl MutableSet<uint> for BitvSet {
788+
fn insert(&mut self, value: uint) -> bool {
789+
if self.contains(&value) {
790+
return false;
791+
}
792+
let nbits = self.capacity();
793+
if value >= nbits {
794+
let newsize = num::max(value, nbits * 2) / uint::bits + 1;
795+
assert!(newsize > self.bitv.storage.len());
796+
self.bitv.storage.grow(newsize, &0);
797+
}
798+
self.size += 1;
799+
self.bitv.set(value, true);
800+
return true;
801+
}
802+
803+
fn remove(&mut self, value: &uint) -> bool {
804+
if !self.contains(value) {
805+
return false;
806+
}
807+
self.size -= 1;
808+
self.bitv.set(*value, false);
809+
810+
// Attempt to truncate our storage
811+
let mut i = self.bitv.storage.len();
812+
while i > 1 && self.bitv.storage[i - 1] == 0 {
813+
i -= 1;
814+
}
815+
self.bitv.storage.truncate(i);
816+
817+
return true;
818+
}
819+
}
820+
819821
impl BitvSet {
820822
/// Visits each of the words that the two bit vectors (self and other)
821823
/// both have in common. The three yielded arguments are (bit location,

branches/snap-stage3/src/libextra/priority_queue.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use std::unstable::intrinsics::{move_val_init, init};
1717
use std::util::{replace, swap};
1818
use std::vec;
19-
use std::iterator::FromIterator;
2019

2120
/// A priority queue implemented with a binary heap
2221
pub struct PriorityQueue<T> {
@@ -192,21 +191,6 @@ impl<'self, T> Iterator<&'self T> for PriorityQueueIterator<'self, T> {
192191
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
193192
}
194193

195-
impl<T: Ord, Iter: Iterator<T>> FromIterator<T, Iter> for PriorityQueue<T> {
196-
pub fn from_iterator(iter: &mut Iter) -> PriorityQueue<T> {
197-
let (lower, _) = iter.size_hint();
198-
199-
let mut q = PriorityQueue::new();
200-
q.reserve_at_least(lower);
201-
202-
for iter.advance |elem| {
203-
q.push(elem);
204-
}
205-
206-
q
207-
}
208-
}
209-
210194
#[cfg(test)]
211195
mod tests {
212196
use sort::merge_sort;
@@ -357,15 +341,4 @@ mod tests {
357341
#[should_fail]
358342
#[ignore(cfg(windows))]
359343
fn test_empty_replace() { let mut heap = PriorityQueue::new(); heap.replace(5); }
360-
361-
#[test]
362-
fn test_from_iter() {
363-
let xs = ~[9u, 8, 7, 6, 5, 4, 3, 2, 1];
364-
365-
let mut q: PriorityQueue<uint> = xs.rev_iter().transform(|&x| x).collect();
366-
367-
for xs.iter().advance |&x| {
368-
assert_eq!(q.pop(), x);
369-
}
370-
}
371344
}

branches/snap-stage3/src/libextra/rl.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,28 @@ pub unsafe fn read(prompt: &str) -> Option<~str> {
6666
}
6767
}
6868

69-
pub type CompletionCb<'self> = @fn(~str, &'self fn(~str));
69+
pub type CompletionCb = @fn(~str, @fn(~str));
7070

71-
fn complete_key(_v: @CompletionCb) {}
71+
#[cfg(not(stage0))]
72+
static complete_key: local_data::Key<@CompletionCb> = &local_data::Key;
73+
#[cfg(stage0)]
74+
fn complete_key(_: @CompletionCb) {}
7275

7376
/// Bind to the main completion callback
7477
pub unsafe fn complete(cb: CompletionCb) {
75-
local_data::set(complete_key, @(cb));
78+
local_data::set(complete_key, @cb);
7679

7780
extern fn callback(line: *c_char, completions: *()) {
78-
unsafe {
79-
let cb = *local_data::get(complete_key, |k| k.map(|&k| *k))
80-
.get();
81-
82-
do cb(str::raw::from_c_str(line)) |suggestion| {
83-
do str::as_c_str(suggestion) |buf| {
84-
rustrt::linenoiseAddCompletion(completions, buf);
81+
do local_data::get(complete_key) |cb| {
82+
let cb = **cb.unwrap();
83+
84+
unsafe {
85+
do cb(str::raw::from_c_str(line)) |suggestion| {
86+
do str::as_c_str(suggestion) |buf| {
87+
rustrt::linenoiseAddCompletion(completions, buf);
88+
}
8589
}
86-
}
90+
}
8791
}
8892
}
8993

branches/snap-stage3/src/libextra/smallintmap.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818

1919
use std::cmp;
20-
use std::container::{Container, Mutable, Map, Set};
21-
use std::iterator::*;
20+
use std::iterator::{Iterator,IteratorUtil,ZipIterator,Counter,EnumerateIterator,FilterMapIterator};
2221
use std::uint;
2322
use std::util::replace;
2423
use std::vec::{VecIterator,VecMutIterator,VecRevIterator,VecMutRevIterator};
@@ -68,7 +67,9 @@ impl<V> Map<uint, V> for SmallIntMap<V> {
6867
None
6968
}
7069
}
70+
}
7171

72+
impl<V> MutableMap<uint, V> for SmallIntMap<V> {
7273
/// Return a mutable reference to the value corresponding to the key
7374
fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut V> {
7475
if *key < self.v.len() {
@@ -349,14 +350,6 @@ impl Set<uint> for SmallIntSet {
349350
/// Return true if the set contains a value
350351
fn contains(&self, value: &uint) -> bool { self.map.contains_key(value) }
351352

352-
/// Add a value to the set. Return true if the value was not already
353-
/// present in the set.
354-
fn insert(&mut self, value: uint) -> bool { self.map.insert(value, ()) }
355-
356-
/// Remove a value from the set. Return true if the value was
357-
/// present in the set.
358-
fn remove(&mut self, value: &uint) -> bool { self.map.remove(value) }
359-
360353
/// Return true if the set has no elements in common with `other`.
361354
/// This is equivalent to checking for an empty uintersection.
362355
fn is_disjoint(&self, other: &SmallIntSet) -> bool {
@@ -412,6 +405,16 @@ impl Set<uint> for SmallIntSet {
412405
}
413406
}
414407

408+
impl MutableSet<uint> for SmallIntSet {
409+
/// Add a value to the set. Return true if the value was not already
410+
/// present in the set.
411+
fn insert(&mut self, value: uint) -> bool { self.map.insert(value, ()) }
412+
413+
/// Remove a value from the set. Return true if the value was
414+
/// present in the set.
415+
fn remove(&mut self, value: &uint) -> bool { self.map.remove(value) }
416+
}
417+
415418
impl SmallIntSet {
416419
/// Create an empty SmallIntSet
417420
pub fn new() -> SmallIntSet { SmallIntSet{map: SmallIntMap::new()} }

branches/snap-stage3/src/libextra/sort.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,39 +1195,4 @@ mod big_tests {
11951195
isSorted(arr);
11961196
}
11971197
}
1198-
1199-
struct LVal<'self> {
1200-
val: uint,
1201-
key: &'self fn:Copy(@uint),
1202-
}
1203-
1204-
#[unsafe_destructor]
1205-
impl<'self> Drop for LVal<'self> {
1206-
fn drop(&self) {
1207-
let x = unsafe { local_data::get(self.key, |k| k.map(|&k| *k)) };
1208-
match x {
1209-
Some(@y) => {
1210-
unsafe {
1211-
local_data::set(self.key, @(y+1));
1212-
}
1213-
}
1214-
_ => fail!("Expected key to work"),
1215-
}
1216-
}
1217-
}
1218-
1219-
impl<'self> Ord for LVal<'self> {
1220-
fn lt<'a>(&self, other: &'a LVal<'self>) -> bool {
1221-
(*self).val < other.val
1222-
}
1223-
fn le<'a>(&self, other: &'a LVal<'self>) -> bool {
1224-
(*self).val <= other.val
1225-
}
1226-
fn gt<'a>(&self, other: &'a LVal<'self>) -> bool {
1227-
(*self).val > other.val
1228-
}
1229-
fn ge<'a>(&self, other: &'a LVal<'self>) -> bool {
1230-
(*self).val >= other.val
1231-
}
1232-
}
12331198
}

0 commit comments

Comments
 (0)