Skip to content

Commit bb0f303

Browse files
committed
---
yaml --- r: 152429 b: refs/heads/try2 c: 9bb8f88 h: refs/heads/master i: 152427: 67caa72 v: v3
1 parent dde2ac9 commit bb0f303

File tree

207 files changed

+3162
-1851
lines changed

Some content is hidden

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

207 files changed

+3162
-1851
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: 8e34f647ee5db795e1ea46715de61cee63f4f4a7
8+
refs/heads/try2: 9bb8f88d3a79d3f8f10dca8cedf00cf57f6a94f6
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 := syntax std
87-
DEPS_hexfloat := syntax std
86+
DEPS_fourcc := rustc syntax std
87+
DEPS_hexfloat := rustc 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 = syntax std regex
95+
DEPS_regex_macros = rustc 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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@
1818

1919
extern crate test;
2020
extern crate getopts;
21-
#[phase(link, syntax)]
22-
extern crate log;
2321
extern crate green;
2422
extern crate rustuv;
2523

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+
2632
extern crate regex;
2733

2834
use std::os;
@@ -286,6 +292,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
286292
save_metrics: config.save_metrics.clone(),
287293
test_shard: config.test_shard.clone(),
288294
nocapture: false,
295+
color: test::AutoColor,
289296
}
290297
}
291298

branches/try2/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::os;
1212
use std::str;
1313
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
14-
use std::unstable::dynamic_lib::DynamicLibrary;
14+
use std::dynamic_lib::DynamicLibrary;
1515

1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(String, String)> {
1717
let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog};

branches/try2/src/doc/rust.md

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

18201820
### Function-only attributes
18211821

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

40994098
~~~~
41004099
#![feature(phase)]
4101-
#[phase(syntax, link)] extern crate log;
4100+
#[phase(plugin, link)] extern crate log;
41024101
41034102
fn main() {
41044103
error!("This is an error log")

branches/try2/src/etc/licenseck.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
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
4546
"test/bench/shootout-meteor.rs", # BSD
47+
"test/bench/shootout-regex-dna.rs", # BSD
4648
]
4749

4850
def check_license(name, contents):

branches/try2/src/liballoc/lib.rs

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

73+
#[cfg(stage0)]
7374
#[phase(syntax, link)]
7475
extern crate core;
76+
77+
#[cfg(not(stage0))]
78+
#[phase(plugin, link)]
79+
extern crate core;
80+
7581
extern crate libc;
7682

7783

@@ -80,8 +86,10 @@ extern crate libc;
8086
#[cfg(test)] extern crate debug;
8187
#[cfg(test)] extern crate sync;
8288
#[cfg(test)] extern crate native;
83-
#[cfg(test)] #[phase(syntax, link)] extern crate std;
84-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
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;
8593

8694
// Heaps provided for low-level allocation strategies
8795

branches/try2/src/libcollections/bitv.rs

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
use core::prelude::*;
1414

1515
use core::cmp;
16+
use core::default::Default;
1617
use core::fmt;
1718
use core::iter::{Enumerate, Repeat, Map, Zip};
1819
use core::ops;
1920
use core::slice;
2021
use core::uint;
22+
use std::hash;
2123

24+
use {Collection, Mutable, Set, MutableSet};
2225
use vec::Vec;
2326

2427
#[deriving(Clone)]
@@ -34,12 +37,12 @@ fn small_mask(nbits: uint) -> uint {
3437
}
3538

3639
impl SmallBitv {
37-
pub fn new(bits: uint) -> SmallBitv {
40+
fn new(bits: uint) -> SmallBitv {
3841
SmallBitv {bits: bits}
3942
}
4043

4144
#[inline]
42-
pub fn bits_op(&mut self,
45+
fn bits_op(&mut self,
4346
right_bits: uint,
4447
nbits: uint,
4548
f: |uint, uint| -> uint)
@@ -52,32 +55,32 @@ impl SmallBitv {
5255
}
5356

5457
#[inline]
55-
pub fn union(&mut self, s: &SmallBitv, nbits: uint) -> bool {
58+
fn union(&mut self, s: &SmallBitv, nbits: uint) -> bool {
5659
self.bits_op(s.bits, nbits, |u1, u2| u1 | u2)
5760
}
5861

5962
#[inline]
60-
pub fn intersect(&mut self, s: &SmallBitv, nbits: uint) -> bool {
63+
fn intersect(&mut self, s: &SmallBitv, nbits: uint) -> bool {
6164
self.bits_op(s.bits, nbits, |u1, u2| u1 & u2)
6265
}
6366

6467
#[inline]
65-
pub fn become(&mut self, s: &SmallBitv, nbits: uint) -> bool {
68+
fn become(&mut self, s: &SmallBitv, nbits: uint) -> bool {
6669
self.bits_op(s.bits, nbits, |_u1, u2| u2)
6770
}
6871

6972
#[inline]
70-
pub fn difference(&mut self, s: &SmallBitv, nbits: uint) -> bool {
73+
fn difference(&mut self, s: &SmallBitv, nbits: uint) -> bool {
7174
self.bits_op(s.bits, nbits, |u1, u2| u1 & !u2)
7275
}
7376

7477
#[inline]
75-
pub fn get(&self, i: uint) -> bool {
78+
fn get(&self, i: uint) -> bool {
7679
(self.bits & (1 << i)) != 0
7780
}
7881

7982
#[inline]
80-
pub fn set(&mut self, i: uint, x: bool) {
83+
fn set(&mut self, i: uint, x: bool) {
8184
if x {
8285
self.bits |= 1<<i;
8386
}
@@ -87,29 +90,29 @@ impl SmallBitv {
8790
}
8891

8992
#[inline]
90-
pub fn equals(&self, b: &SmallBitv, nbits: uint) -> bool {
93+
fn equals(&self, b: &SmallBitv, nbits: uint) -> bool {
9194
let mask = small_mask(nbits);
9295
mask & self.bits == mask & b.bits
9396
}
9497

9598
#[inline]
96-
pub fn clear(&mut self) { self.bits = 0; }
99+
fn clear(&mut self) { self.bits = 0; }
97100

98101
#[inline]
99-
pub fn set_all(&mut self) { self.bits = !0; }
102+
fn set_all(&mut self) { self.bits = !0; }
100103

101104
#[inline]
102-
pub fn all(&self, nbits: uint) -> bool {
105+
fn all(&self, nbits: uint) -> bool {
103106
small_mask(nbits) & !self.bits == 0
104107
}
105108

106109
#[inline]
107-
pub fn none(&self, nbits: uint) -> bool {
110+
fn none(&self, nbits: uint) -> bool {
108111
small_mask(nbits) & self.bits == 0
109112
}
110113

111114
#[inline]
112-
pub fn negate(&mut self) { self.bits = !self.bits; }
115+
fn negate(&mut self) { self.bits = !self.bits; }
113116
}
114117

115118
#[deriving(Clone)]
@@ -134,12 +137,12 @@ fn big_mask(nbits: uint, elem: uint) -> uint {
134137
}
135138

136139
impl BigBitv {
137-
pub fn new(storage: Vec<uint>) -> BigBitv {
140+
fn new(storage: Vec<uint>) -> BigBitv {
138141
BigBitv {storage: storage}
139142
}
140143

141144
#[inline]
142-
pub fn process(&mut self,
145+
fn process(&mut self,
143146
b: &BigBitv,
144147
nbits: uint,
145148
op: |uint, uint| -> uint)
@@ -163,45 +166,45 @@ impl BigBitv {
163166
}
164167

165168
#[inline]
166-
pub fn each_storage(&mut self, op: |v: &mut uint| -> bool) -> bool {
169+
fn each_storage(&mut self, op: |v: &mut uint| -> bool) -> bool {
167170
self.storage.mut_iter().advance(|elt| op(elt))
168171
}
169172

170173
#[inline]
171-
pub fn negate(&mut self) {
174+
fn negate(&mut self) {
172175
self.each_storage(|w| { *w = !*w; true });
173176
}
174177

175178
#[inline]
176-
pub fn union(&mut self, b: &BigBitv, nbits: uint) -> bool {
179+
fn union(&mut self, b: &BigBitv, nbits: uint) -> bool {
177180
self.process(b, nbits, |w1, w2| w1 | w2)
178181
}
179182

180183
#[inline]
181-
pub fn intersect(&mut self, b: &BigBitv, nbits: uint) -> bool {
184+
fn intersect(&mut self, b: &BigBitv, nbits: uint) -> bool {
182185
self.process(b, nbits, |w1, w2| w1 & w2)
183186
}
184187

185188
#[inline]
186-
pub fn become(&mut self, b: &BigBitv, nbits: uint) -> bool {
189+
fn become(&mut self, b: &BigBitv, nbits: uint) -> bool {
187190
self.process(b, nbits, |_, w| w)
188191
}
189192

190193
#[inline]
191-
pub fn difference(&mut self, b: &BigBitv, nbits: uint) -> bool {
194+
fn difference(&mut self, b: &BigBitv, nbits: uint) -> bool {
192195
self.process(b, nbits, |w1, w2| w1 & !w2)
193196
}
194197

195198
#[inline]
196-
pub fn get(&self, i: uint) -> bool {
199+
fn get(&self, i: uint) -> bool {
197200
let w = i / uint::BITS;
198201
let b = i % uint::BITS;
199202
let x = 1 & self.storage.get(w) >> b;
200203
x == 1
201204
}
202205

203206
#[inline]
204-
pub fn set(&mut self, i: uint, x: bool) {
207+
fn set(&mut self, i: uint, x: bool) {
205208
let w = i / uint::BITS;
206209
let b = i % uint::BITS;
207210
let flag = 1 << b;
@@ -210,7 +213,7 @@ impl BigBitv {
210213
}
211214

212215
#[inline]
213-
pub fn equals(&self, b: &BigBitv, nbits: uint) -> bool {
216+
fn equals(&self, b: &BigBitv, nbits: uint) -> bool {
214217
for (i, elt) in b.storage.iter().enumerate() {
215218
let mask = big_mask(nbits, i);
216219
if mask & *self.storage.get(i) != mask & *elt {
@@ -596,6 +599,20 @@ impl fmt::Show for Bitv {
596599
}
597600
}
598601

602+
impl<S: hash::Writer> hash::Hash<S> for Bitv {
603+
fn hash(&self, state: &mut S) {
604+
self.nbits.hash(state);
605+
match self.rep {
606+
Small(ref s) => (s.bits & small_mask(self.nbits)).hash(state),
607+
Big(ref b) => {
608+
for (i, ele) in b.storage.iter().enumerate() {
609+
(ele & big_mask(self.nbits, i)).hash(state);
610+
}
611+
}
612+
}
613+
}
614+
}
615+
599616
#[inline]
600617
fn iterate_bits(base: uint, bits: uint, f: |uint| -> bool) -> bool {
601618
if bits == 0 {
@@ -682,6 +699,11 @@ pub struct BitvSet {
682699
bitv: BigBitv
683700
}
684701

702+
impl Default for BitvSet {
703+
#[inline]
704+
fn default() -> BitvSet { BitvSet::new() }
705+
}
706+
685707
impl BitvSet {
686708
/// Creates a new bit vector set with initially no contents
687709
pub fn new() -> BitvSet {
@@ -834,7 +856,15 @@ impl fmt::Show for BitvSet {
834856
}
835857
}
836858

837-
impl Container for BitvSet {
859+
impl<S: hash::Writer> hash::Hash<S> for BitvSet {
860+
fn hash(&self, state: &mut S) {
861+
for pos in self.iter() {
862+
pos.hash(state);
863+
}
864+
}
865+
}
866+
867+
impl Collection for BitvSet {
838868
#[inline]
839869
fn len(&self) -> uint { self.size }
840870
}
@@ -985,6 +1015,7 @@ mod tests {
9851015
use std::rand::Rng;
9861016
use test::Bencher;
9871017

1018+
use {Set, Mutable, MutableSet};
9881019
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
9891020
from_bytes};
9901021
use bitv;

branches/try2/src/libcollections/btree.rs

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

27+
use Collection;
2728
use vec::Vec;
2829

2930
#[allow(missing_doc)]

0 commit comments

Comments
 (0)