Skip to content

Commit c0c3900

Browse files
committed
---
yaml --- r: 128463 b: refs/heads/auto c: fb4201f h: refs/heads/master i: 128461: 7062278 128459: 0748407 128455: 3e4bcbe 128447: 90a7d4a v: v3
1 parent 8fb66c8 commit c0c3900

Some content is hidden

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

88 files changed

+479
-262
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 46f27c9d965352497231490664ed37e6cdf7787e
16+
refs/heads/auto: fb4201ff34f445f6c4d16c01b38dea65bad8ada1
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for the 'std' and 'extra' libraries.
1919
To generate HTML documentation from one source file/crate, do something like:
2020

2121
~~~~
22-
rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs
22+
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2323
~~~~
2424

2525
(This, of course, requires a working build of the `rustdoc` tool.)

branches/auto/src/doc/guide.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,10 +3669,9 @@ manually free this allocation! If we write
36693669
```
36703670

36713671
then Rust will automatically free `x` at the end of the block. This isn't
3672-
because Rust has a garbage collector -- it doesn't. Instead, Rust uses static
3673-
analysis to determine the *lifetime* of `x`, and then generates code to free it
3674-
once it's sure the `x` won't be used again. This Rust code will do the same
3675-
thing as the following C code:
3672+
because Rust has a garbage collector -- it doesn't. Instead, when `x` goes out
3673+
of scope, Rust `free`s `x`. This Rust code will do the same thing as the
3674+
following C code:
36763675

36773676
```{c,ignore}
36783677
{

branches/auto/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ module through the rules above. It essentially allows public access into the
18011801
re-exported item. For example, this program is valid:
18021802

18031803
~~~~
1804-
pub use api = self::implementation;
1804+
pub use self::implementation as api;
18051805
18061806
mod implementation {
18071807
pub fn f() {}

branches/auto/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ use farm::*;
31123112
However, that's not all. You can also rename an item while you're bringing it into scope:
31133113

31143114
~~~
3115-
use egg_layer = farm::chicken;
3115+
use farm::chicken as egg_layer;
31163116
# mod farm { pub fn chicken() { println!("Laying eggs is fun!") } }
31173117
// ...
31183118
@@ -3335,7 +3335,7 @@ you just have to import it with an `use` statement.
33353335
For example, it re-exports `range` which is defined in `std::iter::range`:
33363336

33373337
~~~
3338-
use iter_range = std::iter::range;
3338+
use std::iter::range as iter_range;
33393339
33403340
fn main() {
33413341
// `range` is imported by default

branches/auto/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extern crate libc;
8686

8787
#[deprecated = "use boxed instead"]
8888
#[cfg(not(test))]
89-
pub use owned = boxed;
89+
pub use boxed as owned;
9090

9191
// Heaps provided for low-level allocation strategies
9292

branches/auto/src/libcollections/bitv.rs

Lines changed: 114 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ use std::hash;
7575
use {Mutable, Set, MutableSet, MutableSeq};
7676
use vec::Vec;
7777

78+
// Take two BitV's, and return iterators of their words, where the shorter one
79+
// has been padded with 0's
80+
macro_rules! match_words(
81+
($a_expr:expr, $b_expr:expr) => ({
82+
let a = $a_expr;
83+
let b = $b_expr;
84+
let a_len = a.storage.len();
85+
let b_len = b.storage.len();
86+
87+
// have to uselessly pretend to pad the longer one for type matching
88+
if a_len < b_len {
89+
(a.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(b_len).skip(a_len)),
90+
b.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(0).skip(0)))
91+
} else {
92+
(a.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(0).skip(0)),
93+
b.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(a_len).skip(b_len)))
94+
}
95+
})
96+
)
7897

7998
static TRUE: bool = true;
8099
static FALSE: bool = false;
@@ -969,7 +988,7 @@ impl<'a> RandomAccessIterator<bool> for Bits<'a> {
969988
/// assert!(bv.eq_vec([true, true, false, true,
970989
/// false, false, false, false]));
971990
/// ```
972-
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
991+
#[deriving(Clone)]
973992
pub struct BitvSet(Bitv);
974993

975994
impl Default for BitvSet {
@@ -992,6 +1011,32 @@ impl Extendable<bool> for BitvSet {
9921011
}
9931012
}
9941013

1014+
impl PartialOrd for BitvSet {
1015+
#[inline]
1016+
fn partial_cmp(&self, other: &BitvSet) -> Option<Ordering> {
1017+
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1018+
iter::order::partial_cmp(a_iter, b_iter)
1019+
}
1020+
}
1021+
1022+
impl Ord for BitvSet {
1023+
#[inline]
1024+
fn cmp(&self, other: &BitvSet) -> Ordering {
1025+
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1026+
iter::order::cmp(a_iter, b_iter)
1027+
}
1028+
}
1029+
1030+
impl cmp::PartialEq for BitvSet {
1031+
#[inline]
1032+
fn eq(&self, other: &BitvSet) -> bool {
1033+
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1034+
iter::order::eq(a_iter, b_iter)
1035+
}
1036+
}
1037+
1038+
impl cmp::Eq for BitvSet {}
1039+
9951040
impl BitvSet {
9961041
/// Create a new bit vector set with initially no contents.
9971042
///
@@ -1141,10 +1186,18 @@ impl BitvSet {
11411186
// Unwrap Bitvs
11421187
let &BitvSet(ref mut self_bitv) = self;
11431188
let &BitvSet(ref other_bitv) = other;
1189+
11441190
// Expand the vector if necessary
11451191
self_bitv.reserve(other_bitv.capacity());
1146-
// Apply values
1147-
for (i, w) in other_bitv.mask_words(0) {
1192+
1193+
// virtually pad other with 0's for equal lengths
1194+
let self_len = self_bitv.storage.len();
1195+
let other_len = other_bitv.storage.len();
1196+
let mut other_words = other_bitv.mask_words(0)
1197+
.chain(iter::Repeat::new(0u).enumerate().take(self_len).skip(other_len));
1198+
1199+
// Apply values found in other
1200+
for (i, w) in other_words {
11481201
let old = self_bitv.storage[i];
11491202
let new = f(old, w);
11501203
*self_bitv.storage.get_mut(i) = new;
@@ -2213,6 +2266,64 @@ mod tests {
22132266
assert!(set1.is_subset(&set2)); // { 2 } { 2, 4 }
22142267
}
22152268

2269+
#[test]
2270+
fn test_bitv_set_intersect_with() {
2271+
// Explicitly 0'ed bits
2272+
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2273+
let mut b = BitvSet::from_bitv(from_bytes([0b00000000]));
2274+
let c = a.clone();
2275+
a.intersect_with(&b);
2276+
b.intersect_with(&c);
2277+
assert!(a.is_empty());
2278+
assert!(b.is_empty());
2279+
2280+
// Uninitialized bits should behave like 0's
2281+
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2282+
let mut b = BitvSet::new();
2283+
let c = a.clone();
2284+
a.intersect_with(&b);
2285+
b.intersect_with(&c);
2286+
assert!(a.is_empty());
2287+
assert!(b.is_empty());
2288+
2289+
// Standard
2290+
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2291+
let mut b = BitvSet::from_bitv(from_bytes([0b01100010]));
2292+
let c = a.clone();
2293+
a.intersect_with(&b);
2294+
b.intersect_with(&c);
2295+
assert_eq!(a.len(), 2);
2296+
assert_eq!(b.len(), 2);
2297+
}
2298+
2299+
#[test]
2300+
fn test_bitv_set_eq() {
2301+
let a = BitvSet::from_bitv(from_bytes([0b10100010]));
2302+
let b = BitvSet::from_bitv(from_bytes([0b00000000]));
2303+
let c = BitvSet::new();
2304+
2305+
assert!(a == a);
2306+
assert!(a != b);
2307+
assert!(a != c);
2308+
assert!(b == b);
2309+
assert!(b == c);
2310+
assert!(c == c);
2311+
}
2312+
2313+
#[test]
2314+
fn test_bitv_set_cmp() {
2315+
let a = BitvSet::from_bitv(from_bytes([0b10100010]));
2316+
let b = BitvSet::from_bitv(from_bytes([0b00000000]));
2317+
let c = BitvSet::new();
2318+
2319+
assert_eq!(a.cmp(&b), Greater);
2320+
assert_eq!(a.cmp(&c), Greater);
2321+
assert_eq!(b.cmp(&a), Less);
2322+
assert_eq!(b.cmp(&c), Equal);
2323+
assert_eq!(c.cmp(&a), Less);
2324+
assert_eq!(c.cmp(&b), Equal);
2325+
}
2326+
22162327
#[test]
22172328
fn test_bitv_remove() {
22182329
let mut a = BitvSet::new();

branches/auto/src/libcollections/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use core::mem;
7373
use vec::Vec;
7474

7575
/// Reexport the `sip::hash` function as our default hasher.
76-
pub use hash = self::sip::hash;
76+
pub use self::sip::hash as hash;
7777

7878
pub mod sip;
7979

branches/auto/src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ use core::fmt;
1919
use core::mem;
2020
use core::ptr;
2121
// FIXME: ICE's abound if you import the `Slice` type while importing `Slice` trait
22-
use RawSlice = core::raw::Slice;
22+
use core::raw::Slice as RawSlice;
2323

2424
use {Mutable, MutableSeq};
2525
use hash;
2626
use str;
2727
use str::{CharRange, StrAllocating, MaybeOwned, Owned};
28-
use MaybeOwnedSlice = str::Slice; // So many `Slice`s...
28+
use str::Slice as MaybeOwnedSlice; // So many `Slice`s...
2929
use vec::Vec;
3030

3131
/// A growable string stored as a UTF-8 encoded buffer.

branches/auto/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
use core::prelude::*;
1414

1515
use alloc::heap::{allocate, reallocate, deallocate};
16-
use RawSlice = core::raw::Slice;
1716
use core::cmp::max;
1817
use core::default::Default;
1918
use core::fmt;
2019
use core::mem;
2120
use core::num;
2221
use core::ptr;
22+
use core::raw::Slice as RawSlice;
2323
use core::uint;
2424

2525
use {Mutable, MutableSeq};

branches/auto/src/libcore/kinds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ by the compiler automatically for the types to which they apply.
2121
*/
2222

2323
#[deprecated = "This has been renamed to Sync"]
24-
pub use Share = self::Sync;
24+
pub use self::Sync as Share;
2525

2626
/// Types able to be transferred across task boundaries.
2727
#[lang="send"]

branches/auto/src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub mod collections;
107107
/// Deprecated module in favor of `std::cell`
108108
pub mod ty {
109109
#[deprecated = "this type has been renamed to `UnsafeCell`"]
110-
pub use Unsafe = cell::UnsafeCell;
110+
pub use cell::UnsafeCell as Unsafe;
111111
}
112112

113113
/* Core types and methods on primitives */

branches/auto/src/libcore/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use mem::size_of;
5050
use kinds::marker;
5151
use raw::Repr;
5252
// Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module.
53-
use RawSlice = raw::Slice;
53+
use raw::Slice as RawSlice;
5454

5555

5656
//

branches/auto/src/libgraphviz/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ forming a diamond-shaped acyclic graph and then pointing to the fifth
4747
which is cyclic.
4848
4949
```rust
50-
use dot = graphviz;
50+
use graphviz as dot;
5151
use graphviz::maybe_owned_vec::IntoMaybeOwnedVector;
5252
5353
type Nd = int;
@@ -147,7 +147,7 @@ labelled with the &sube; character (specified using the HTML character
147147
entity `&sube`).
148148
149149
```rust
150-
use dot = graphviz;
150+
use graphviz as dot;
151151
use std::str;
152152
153153
type Nd = uint;
@@ -203,7 +203,7 @@ The output from this example is the same as the second example: the
203203
Hasse-diagram for the subsets of the set `{x, y}`.
204204
205205
```rust
206-
use dot = graphviz;
206+
use graphviz as dot;
207207
use std::str;
208208
209209
type Nd<'a> = (uint, &'a str);

branches/auto/src/libgreen/message_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use alloc::arc::Arc;
12-
use mpsc = std::sync::mpsc_queue;
12+
use std::sync::mpsc_queue as mpsc;
1313
use std::kinds::marker;
1414

1515
pub enum PopResult<T> {

branches/auto/src/libgreen/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use coroutine::Coroutine;
2525
use sleeper_list::SleeperList;
2626
use stack::StackPool;
2727
use task::{TypeSched, GreenTask, HomeSched, AnySched};
28-
use msgq = message_queue;
28+
use message_queue as msgq;
2929

3030
/// A scheduler is responsible for coordinating the execution of Tasks
3131
/// on a single thread. The scheduler runs inside a slightly modified

branches/auto/src/liblibc/lib.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,47 +1456,13 @@ pub mod types {
14561456
pub Data4: [BYTE, ..8],
14571457
}
14581458

1459-
// NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
1460-
// workaround).
1461-
#[cfg(stage0)]
1462-
pub struct WSAPROTOCOLCHAIN {
1463-
pub ChainLen: c_int,
1464-
pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
1465-
}
1466-
#[cfg(not(stage0))]
14671459
pub struct WSAPROTOCOLCHAIN {
14681460
pub ChainLen: c_int,
14691461
pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN as uint],
14701462
}
14711463

14721464
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
14731465

1474-
// NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
1475-
// workaround).
1476-
#[cfg(stage0)]
1477-
pub struct WSAPROTOCOL_INFO {
1478-
pub dwServiceFlags1: DWORD,
1479-
pub dwServiceFlags2: DWORD,
1480-
pub dwServiceFlags3: DWORD,
1481-
pub dwServiceFlags4: DWORD,
1482-
pub dwProviderFlags: DWORD,
1483-
pub ProviderId: GUID,
1484-
pub dwCatalogEntryId: DWORD,
1485-
pub ProtocolChain: WSAPROTOCOLCHAIN,
1486-
pub iVersion: c_int,
1487-
pub iAddressFamily: c_int,
1488-
pub iMaxSockAddr: c_int,
1489-
pub iMinSockAddr: c_int,
1490-
pub iSocketType: c_int,
1491-
pub iProtocol: c_int,
1492-
pub iProtocolMaxOffset: c_int,
1493-
pub iNetworkByteOrder: c_int,
1494-
pub iSecurityScheme: c_int,
1495-
pub dwMessageSize: DWORD,
1496-
pub dwProviderReserved: DWORD,
1497-
pub szProtocol: [u8, ..WSAPROTOCOL_LEN+1],
1498-
}
1499-
#[cfg(not(stage0))]
15001466
pub struct WSAPROTOCOL_INFO {
15011467
pub dwServiceFlags1: DWORD,
15021468
pub dwServiceFlags2: DWORD,

branches/auto/src/libnative/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ mod tty;
7979
#[cfg(windows)] #[path = "c_win32.rs"] mod c;
8080

8181
fn unimpl() -> IoError {
82-
#[cfg(unix)] use ERROR = libc::ENOSYS;
83-
#[cfg(windows)] use ERROR = libc::ERROR_CALL_NOT_IMPLEMENTED;
82+
#[cfg(unix)] use libc::ENOSYS as ERROR;
83+
#[cfg(windows)] use libc::ERROR_CALL_NOT_IMPLEMENTED as ERROR;
8484
IoError {
8585
code: ERROR as uint,
8686
extra: 0,

0 commit comments

Comments
 (0)