Skip to content

Commit 61bf911

Browse files
committed
---
yaml --- r: 152408 b: refs/heads/try2 c: 3ca00ec h: refs/heads/master v: v3
1 parent 139ef8f commit 61bf911

File tree

188 files changed

+1673
-2678
lines changed

Some content is hidden

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

188 files changed

+1673
-2678
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 907d96187641d8a018af2b73239723c66b011f71
8+
refs/heads/try2: 3ca00ec0db8875e97fbe88990722dd9378f51b11
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ DEPS_uuid := std serialize
8383
DEPS_sync := std alloc
8484
DEPS_getopts := std
8585
DEPS_collections := core alloc
86-
DEPS_fourcc := rustc syntax std
87-
DEPS_hexfloat := rustc syntax std
86+
DEPS_fourcc := syntax std
87+
DEPS_hexfloat := syntax std
8888
DEPS_num := std
8989
DEPS_test := std getopts serialize term time regex native:rust_test_helpers
9090
DEPS_time := std serialize sync
9191
DEPS_rand := core
9292
DEPS_url := std
9393
DEPS_log := std sync
9494
DEPS_regex := std
95-
DEPS_regex_macros = rustc syntax std regex
95+
DEPS_regex_macros = syntax std regex
9696
DEPS_fmt_macros = std
9797

9898
TOOL_DEPS_compiletest := test green rustuv getopts

branches/try2/src/compiletest/compiletest.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,11 @@
1818

1919
extern crate test;
2020
extern crate getopts;
21+
#[phase(link, syntax)]
22+
extern crate log;
2123
extern crate green;
2224
extern crate rustuv;
2325

24-
#[cfg(stage0)]
25-
#[phase(syntax, link)]
26-
extern crate log;
27-
28-
#[cfg(not(stage0))]
29-
#[phase(plugin, link)]
30-
extern crate log;
31-
3226
extern crate regex;
3327

3428
use std::os;

branches/try2/src/doc/rust.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,8 +1819,9 @@ type int8_t = i8;
18191819

18201820
### Function-only attributes
18211821

1822-
- `plugin_registrar` - mark this function as the registration point for
1823-
compiler plugins, such as loadable syntax extensions.
1822+
- `macro_registrar` - when using loadable syntax extensions, mark this
1823+
function as the registration point for the current crate's syntax
1824+
extensions.
18241825
- `main` - indicates that this function should be passed to the entry point,
18251826
rather than the function in the crate root named `main`.
18261827
- `start` - indicates that this function should be used as the entry point,
@@ -4097,7 +4098,7 @@ that demonstrates all four of them:
40974098

40984099
~~~~
40994100
#![feature(phase)]
4100-
#[phase(plugin, link)] extern crate log;
4101+
#[phase(syntax, link)] extern crate log;
41014102
41024103
fn main() {
41034104
error!("This is an error log")

branches/try2/src/etc/licenseck.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
"libstd/sync/spsc_queue.rs", # BSD
4343
"libstd/sync/mpmc_bounded_queue.rs", # BSD
4444
"libsync/mpsc_intrusive.rs", # BSD
45-
"test/bench/shootout-fannkuch-redux.rs", # BSD
4645
"test/bench/shootout-meteor.rs", # BSD
47-
"test/bench/shootout-regex-dna.rs", # BSD
4846
]
4947

5048
def check_license(name, contents):

branches/try2/src/liballoc/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,8 @@
7070
#![no_std]
7171
#![feature(phase)]
7272

73-
#[cfg(stage0)]
7473
#[phase(syntax, link)]
7574
extern crate core;
76-
77-
#[cfg(not(stage0))]
78-
#[phase(plugin, link)]
79-
extern crate core;
80-
8175
extern crate libc;
8276

8377

@@ -86,10 +80,8 @@ extern crate libc;
8680
#[cfg(test)] extern crate debug;
8781
#[cfg(test)] extern crate sync;
8882
#[cfg(test)] extern crate native;
89-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
90-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
91-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
92-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
83+
#[cfg(test)] #[phase(syntax, link)] extern crate std;
84+
#[cfg(test)] #[phase(syntax, link)] extern crate log;
9385

9486
// Heaps provided for low-level allocation strategies
9587

branches/try2/src/libcollections/bitv.rs

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ use core::iter::{Enumerate, Repeat, Map, Zip};
1818
use core::ops;
1919
use core::slice;
2020
use core::uint;
21-
use std::hash;
2221

23-
use {Collection, Mutable, Set, MutableSet};
2422
use vec::Vec;
2523

2624
#[deriving(Clone)]
@@ -36,12 +34,12 @@ fn small_mask(nbits: uint) -> uint {
3634
}
3735

3836
impl SmallBitv {
39-
fn new(bits: uint) -> SmallBitv {
37+
pub fn new(bits: uint) -> SmallBitv {
4038
SmallBitv {bits: bits}
4139
}
4240

4341
#[inline]
44-
fn bits_op(&mut self,
42+
pub fn bits_op(&mut self,
4543
right_bits: uint,
4644
nbits: uint,
4745
f: |uint, uint| -> uint)
@@ -54,32 +52,32 @@ impl SmallBitv {
5452
}
5553

5654
#[inline]
57-
fn union(&mut self, s: &SmallBitv, nbits: uint) -> bool {
55+
pub fn union(&mut self, s: &SmallBitv, nbits: uint) -> bool {
5856
self.bits_op(s.bits, nbits, |u1, u2| u1 | u2)
5957
}
6058

6159
#[inline]
62-
fn intersect(&mut self, s: &SmallBitv, nbits: uint) -> bool {
60+
pub fn intersect(&mut self, s: &SmallBitv, nbits: uint) -> bool {
6361
self.bits_op(s.bits, nbits, |u1, u2| u1 & u2)
6462
}
6563

6664
#[inline]
67-
fn become(&mut self, s: &SmallBitv, nbits: uint) -> bool {
65+
pub fn become(&mut self, s: &SmallBitv, nbits: uint) -> bool {
6866
self.bits_op(s.bits, nbits, |_u1, u2| u2)
6967
}
7068

7169
#[inline]
72-
fn difference(&mut self, s: &SmallBitv, nbits: uint) -> bool {
70+
pub fn difference(&mut self, s: &SmallBitv, nbits: uint) -> bool {
7371
self.bits_op(s.bits, nbits, |u1, u2| u1 & !u2)
7472
}
7573

7674
#[inline]
77-
fn get(&self, i: uint) -> bool {
75+
pub fn get(&self, i: uint) -> bool {
7876
(self.bits & (1 << i)) != 0
7977
}
8078

8179
#[inline]
82-
fn set(&mut self, i: uint, x: bool) {
80+
pub fn set(&mut self, i: uint, x: bool) {
8381
if x {
8482
self.bits |= 1<<i;
8583
}
@@ -89,29 +87,29 @@ impl SmallBitv {
8987
}
9088

9189
#[inline]
92-
fn equals(&self, b: &SmallBitv, nbits: uint) -> bool {
90+
pub fn equals(&self, b: &SmallBitv, nbits: uint) -> bool {
9391
let mask = small_mask(nbits);
9492
mask & self.bits == mask & b.bits
9593
}
9694

9795
#[inline]
98-
fn clear(&mut self) { self.bits = 0; }
96+
pub fn clear(&mut self) { self.bits = 0; }
9997

10098
#[inline]
101-
fn set_all(&mut self) { self.bits = !0; }
99+
pub fn set_all(&mut self) { self.bits = !0; }
102100

103101
#[inline]
104-
fn all(&self, nbits: uint) -> bool {
102+
pub fn all(&self, nbits: uint) -> bool {
105103
small_mask(nbits) & !self.bits == 0
106104
}
107105

108106
#[inline]
109-
fn none(&self, nbits: uint) -> bool {
107+
pub fn none(&self, nbits: uint) -> bool {
110108
small_mask(nbits) & self.bits == 0
111109
}
112110

113111
#[inline]
114-
fn negate(&mut self) { self.bits = !self.bits; }
112+
pub fn negate(&mut self) { self.bits = !self.bits; }
115113
}
116114

117115
#[deriving(Clone)]
@@ -136,12 +134,12 @@ fn big_mask(nbits: uint, elem: uint) -> uint {
136134
}
137135

138136
impl BigBitv {
139-
fn new(storage: Vec<uint>) -> BigBitv {
137+
pub fn new(storage: Vec<uint>) -> BigBitv {
140138
BigBitv {storage: storage}
141139
}
142140

143141
#[inline]
144-
fn process(&mut self,
142+
pub fn process(&mut self,
145143
b: &BigBitv,
146144
nbits: uint,
147145
op: |uint, uint| -> uint)
@@ -165,45 +163,45 @@ impl BigBitv {
165163
}
166164

167165
#[inline]
168-
fn each_storage(&mut self, op: |v: &mut uint| -> bool) -> bool {
166+
pub fn each_storage(&mut self, op: |v: &mut uint| -> bool) -> bool {
169167
self.storage.mut_iter().advance(|elt| op(elt))
170168
}
171169

172170
#[inline]
173-
fn negate(&mut self) {
171+
pub fn negate(&mut self) {
174172
self.each_storage(|w| { *w = !*w; true });
175173
}
176174

177175
#[inline]
178-
fn union(&mut self, b: &BigBitv, nbits: uint) -> bool {
176+
pub fn union(&mut self, b: &BigBitv, nbits: uint) -> bool {
179177
self.process(b, nbits, |w1, w2| w1 | w2)
180178
}
181179

182180
#[inline]
183-
fn intersect(&mut self, b: &BigBitv, nbits: uint) -> bool {
181+
pub fn intersect(&mut self, b: &BigBitv, nbits: uint) -> bool {
184182
self.process(b, nbits, |w1, w2| w1 & w2)
185183
}
186184

187185
#[inline]
188-
fn become(&mut self, b: &BigBitv, nbits: uint) -> bool {
186+
pub fn become(&mut self, b: &BigBitv, nbits: uint) -> bool {
189187
self.process(b, nbits, |_, w| w)
190188
}
191189

192190
#[inline]
193-
fn difference(&mut self, b: &BigBitv, nbits: uint) -> bool {
191+
pub fn difference(&mut self, b: &BigBitv, nbits: uint) -> bool {
194192
self.process(b, nbits, |w1, w2| w1 & !w2)
195193
}
196194

197195
#[inline]
198-
fn get(&self, i: uint) -> bool {
196+
pub fn get(&self, i: uint) -> bool {
199197
let w = i / uint::BITS;
200198
let b = i % uint::BITS;
201199
let x = 1 & self.storage.get(w) >> b;
202200
x == 1
203201
}
204202

205203
#[inline]
206-
fn set(&mut self, i: uint, x: bool) {
204+
pub fn set(&mut self, i: uint, x: bool) {
207205
let w = i / uint::BITS;
208206
let b = i % uint::BITS;
209207
let flag = 1 << b;
@@ -212,7 +210,7 @@ impl BigBitv {
212210
}
213211

214212
#[inline]
215-
fn equals(&self, b: &BigBitv, nbits: uint) -> bool {
213+
pub fn equals(&self, b: &BigBitv, nbits: uint) -> bool {
216214
for (i, elt) in b.storage.iter().enumerate() {
217215
let mask = big_mask(nbits, i);
218216
if mask & *self.storage.get(i) != mask & *elt {
@@ -598,20 +596,6 @@ impl fmt::Show for Bitv {
598596
}
599597
}
600598

601-
impl<S: hash::Writer> hash::Hash<S> for Bitv {
602-
fn hash(&self, state: &mut S) {
603-
self.nbits.hash(state);
604-
match self.rep {
605-
Small(ref s) => (s.bits & small_mask(self.nbits)).hash(state),
606-
Big(ref b) => {
607-
for (i, ele) in b.storage.iter().enumerate() {
608-
(ele & big_mask(self.nbits, i)).hash(state);
609-
}
610-
}
611-
}
612-
}
613-
}
614-
615599
#[inline]
616600
fn iterate_bits(base: uint, bits: uint, f: |uint| -> bool) -> bool {
617601
if bits == 0 {
@@ -850,15 +834,7 @@ impl fmt::Show for BitvSet {
850834
}
851835
}
852836

853-
impl<S: hash::Writer> hash::Hash<S> for BitvSet {
854-
fn hash(&self, state: &mut S) {
855-
for pos in self.iter() {
856-
pos.hash(state);
857-
}
858-
}
859-
}
860-
861-
impl Collection for BitvSet {
837+
impl Container for BitvSet {
862838
#[inline]
863839
fn len(&self) -> uint { self.size }
864840
}
@@ -1009,7 +985,6 @@ mod tests {
1009985
use std::rand::Rng;
1010986
use test::Bencher;
1011987

1012-
use {Set, Mutable, MutableSet};
1013988
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
1014989
from_bytes};
1015990
use bitv;

branches/try2/src/libcollections/btree.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use alloc::owned::Box;
2424
use core::fmt;
2525
use core::fmt::Show;
2626

27-
use Collection;
2827
use vec::Vec;
2928

3029
#[allow(missing_doc)]

branches/try2/src/libcollections/deque.rs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,41 @@
1010

1111
//! Container traits for collections
1212
13+
use core::prelude::*;
14+
15+
/// A double-ended sequence that allows querying, insertion and deletion at both ends.
16+
pub trait Deque<T> : Mutable {
17+
/// Provide a reference to the front element, or None if the sequence is empty
18+
fn front<'a>(&'a self) -> Option<&'a T>;
19+
20+
/// Provide a mutable reference to the front element, or None if the sequence is empty
21+
fn front_mut<'a>(&'a mut self) -> Option<&'a mut T>;
22+
23+
/// Provide a reference to the back element, or None if the sequence is empty
24+
fn back<'a>(&'a self) -> Option<&'a T>;
25+
26+
/// Provide a mutable reference to the back element, or None if the sequence is empty
27+
fn back_mut<'a>(&'a mut self) -> Option<&'a mut T>;
28+
29+
/// Insert an element first in the sequence
30+
fn push_front(&mut self, elt: T);
31+
32+
/// Insert an element last in the sequence
33+
fn push_back(&mut self, elt: T);
34+
35+
/// Remove the last element and return it, or None if the sequence is empty
36+
fn pop_back(&mut self) -> Option<T>;
37+
38+
/// Remove the first element and return it, or None if the sequence is empty
39+
fn pop_front(&mut self) -> Option<T>;
40+
}
41+
1342
#[cfg(test)]
1443
pub mod bench {
1544
use std::prelude::*;
1645
use std::rand;
1746
use std::rand::Rng;
1847
use test::Bencher;
19-
use MutableMap;
2048

2149
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
2250
map: &mut M,
@@ -93,4 +121,3 @@ pub mod bench {
93121
})
94122
}
95123
}
96-

0 commit comments

Comments
 (0)