Skip to content

Commit 76f8e53

Browse files
committed
---
yaml --- r: 162613 b: refs/heads/try c: a95c71e h: refs/heads/master i: 162611: cb2543f v: v3
1 parent 7022f61 commit 76f8e53

File tree

148 files changed

+1851
-5220
lines changed

Some content is hidden

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

148 files changed

+1851
-5220
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 8fb027e398ef756b7b02a270ef0304be92e70f4d
5+
refs/heads/try: a95c71e0ac3dc97468d7432d5011fbb413ba9263
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
################################################################################
5151

5252
TARGET_CRATES := libc std flate arena term \
53-
serialize getopts collections test time rand \
53+
serialize sync getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
@@ -63,7 +63,7 @@ DEPS_libc := core
6363
DEPS_unicode := core
6464
DEPS_alloc := core libc native:jemalloc
6565
DEPS_rustrt := alloc core libc collections native:rustrt_native
66-
DEPS_std := core libc rand alloc collections rustrt unicode \
66+
DEPS_std := core libc rand alloc collections rustrt sync unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
@@ -81,6 +81,7 @@ DEPS_glob := std
8181
DEPS_serialize := std log
8282
DEPS_rbml := std log serialize
8383
DEPS_term := std log
84+
DEPS_sync := core alloc rustrt collections
8485
DEPS_getopts := std
8586
DEPS_collections := core alloc unicode
8687
DEPS_num := std

branches/try/src/compiletest/errors.rs

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
use self::WhichLine::*;
1110

1211
use std::ascii::AsciiExt;
1312
use std::io::{BufferedReader, File};
@@ -19,74 +18,28 @@ pub struct ExpectedError {
1918
pub msg: String,
2019
}
2120

22-
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
23-
/// The former is a "follow" that inherits its target from the preceding line;
24-
/// the latter is an "adjusts" that goes that many lines up.
25-
///
26-
/// Goal is to enable tests both like: //~^^^ ERROR go up three
27-
/// and also //~^ ERROR message one for the preceding line, and
28-
/// //~| ERROR message two for that same line.
29-
30-
pub static EXPECTED_PATTERN : &'static str =
31-
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
32-
33-
#[deriving(PartialEq, Show)]
34-
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
21+
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
3522

3623
// Load any test directives embedded in the file
3724
pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3825
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
3926

40-
// `last_nonfollow_error` tracks the most recently seen
41-
// line with an error template that did not use the
42-
// follow-syntax, "//~| ...".
43-
//
44-
// (pnkfelix could not find an easy way to compose Iterator::scan
45-
// and Iterator::filter_map to pass along this information into
46-
// `parse_expected`. So instead I am storing that state here and
47-
// updating it in the map callback below.)
48-
let mut last_nonfollow_error = None;
49-
5027
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
51-
parse_expected(last_nonfollow_error,
52-
line_no + 1,
53-
ln.unwrap().as_slice(), re)
54-
.map(|(which, error)| {
55-
match which {
56-
FollowPrevious(_) => {}
57-
_ => last_nonfollow_error = Some(error.line),
58-
}
59-
error
60-
})
28+
parse_expected(line_no + 1, ln.unwrap().as_slice(), re)
6129
}).collect()
6230
}
6331

64-
fn parse_expected(last_nonfollow_error: Option<uint>,
65-
line_num: uint,
66-
line: &str,
67-
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
32+
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
6833
re.captures(line).and_then(|caps| {
6934
let adjusts = caps.name("adjusts").len();
7035
let kind = caps.name("kind").to_ascii_lower();
7136
let msg = caps.name("msg").trim().to_string();
72-
let follow = caps.name("follow").len() > 0;
73-
74-
let (which, line) = if follow {
75-
assert!(adjusts == 0, "use either //~| or //~^, not both.");
76-
let line = last_nonfollow_error.unwrap_or_else(|| {
77-
panic!("encountered //~| without preceding //~^ line.")
78-
});
79-
(FollowPrevious(line), line)
80-
} else {
81-
let which =
82-
if adjusts > 0 { AdjustBackward(adjusts) } else { ThisLine };
83-
let line = line_num - adjusts;
84-
(which, line)
85-
};
8637

87-
debug!("line={} which={} kind={} msg={}", line_num, which, kind, msg);
88-
Some((which, ExpectedError { line: line,
89-
kind: kind,
90-
msg: msg, }))
38+
debug!("line={} kind={} msg={}", line_num, kind, msg);
39+
Some(ExpectedError {
40+
line: line_num - adjusts,
41+
kind: kind,
42+
msg: msg,
43+
})
9144
})
9245
}

branches/try/src/doc/reference.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,20 +1689,7 @@ methods in such an implementation can only be used as direct calls on the
16891689
values of the type that the implementation targets. In such an implementation,
16901690
the trait type and `for` after `impl` are omitted. Such implementations are
16911691
limited to nominal types (enums, structs), and the implementation must appear
1692-
in the same module or a sub-module as the `self` type:
1693-
1694-
```
1695-
struct Point {x: int, y: int}
1696-
1697-
impl Point {
1698-
fn log(&self) {
1699-
println!("Point is at ({}, {})", self.x, self.y);
1700-
}
1701-
}
1702-
1703-
let my_point = Point {x: 10, y:11};
1704-
my_point.log();
1705-
```
1692+
in the same module or a sub-module as the `self` type.
17061693

17071694
When a trait _is_ specified in an `impl`, all methods declared as part of the
17081695
trait must be implemented, with matching types and type parameter counts.

branches/try/src/etc/emacs/rust-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34+
;; _ is a word-char
35+
(modify-syntax-entry ?_ "w" table)
36+
3437
;; Comments
3538
(modify-syntax-entry ?/ ". 124b" table)
3639
(modify-syntax-entry ?* ". 23" table)
@@ -394,7 +397,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust.
394397
Don't move to the beginning of the line. `beginning-of-defun',
395398
which calls this, does that afterwards."
396399
(interactive "p")
397-
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>")
400+
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b")
398401
nil 'move (or arg 1)))
399402

400403
(defun rust-end-of-defun ()

branches/try/src/etc/licenseck.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libstd/sync/mpsc_queue.rs", # BSD
42-
"libstd/sync/spsc_queue.rs", # BSD
43-
"libstd/sync/mpmc_bounded_queue.rs", # BSD
41+
"libsync/mpsc_queue.rs", # BSD
42+
"libsync/spsc_queue.rs", # BSD
43+
"libsync/mpmc_bounded_queue.rs", # BSD
44+
"libsync/mpsc_intrusive.rs", # BSD
4445
"test/bench/shootout-binarytrees.rs", # BSD
4546
"test/bench/shootout-chameneos-redux.rs", # BSD
4647
"test/bench/shootout-fannkuch-redux.rs", # BSD

branches/try/src/libcollections/binary_heap.rs

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ use core::mem::{zeroed, replace, swap};
160160
use core::ptr;
161161

162162
use slice;
163-
use vec::{mod, Vec};
163+
use vec::Vec;
164+
165+
// FIXME(conventions): implement into_iter
164166

165167
/// A priority queue implemented with a binary heap.
166168
///
@@ -241,27 +243,6 @@ impl<T: Ord> BinaryHeap<T> {
241243
Items { iter: self.data.iter() }
242244
}
243245

244-
/// Creates a consuming iterator, that is, one that moves each value out of
245-
/// the binary heap in arbitrary order. The binary heap cannot be used
246-
/// after calling this.
247-
///
248-
/// # Example
249-
///
250-
/// ```
251-
/// use std::collections::BinaryHeap;
252-
/// let pq = BinaryHeap::from_vec(vec![1i, 2, 3, 4]);
253-
///
254-
/// // Print 1, 2, 3, 4 in arbitrary order
255-
/// for x in pq.into_iter() {
256-
/// // x has type int, not &int
257-
/// println!("{}", x);
258-
/// }
259-
/// ```
260-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
261-
pub fn into_iter(self) -> MoveItems<T> {
262-
MoveItems { iter: self.data.into_iter() }
263-
}
264-
265246
/// Returns the greatest item in a queue, or `None` if it is empty.
266247
///
267248
/// # Example
@@ -567,26 +548,6 @@ impl<'a, T> Iterator<&'a T> for Items<'a, T> {
567548
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
568549
}
569550

570-
/// An iterator that moves out of a `BinaryHeap`.
571-
pub struct MoveItems<T> {
572-
iter: vec::MoveItems<T>,
573-
}
574-
575-
impl<T> Iterator<T> for MoveItems<T> {
576-
#[inline]
577-
fn next(&mut self) -> Option<T> { self.iter.next() }
578-
579-
#[inline]
580-
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
581-
}
582-
583-
impl<T> DoubleEndedIterator<T> for MoveItems<T> {
584-
#[inline]
585-
fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
586-
}
587-
588-
impl<T> ExactSize<T> for MoveItems<T> {}
589-
590551
impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
591552
fn from_iter<Iter: Iterator<T>>(mut iter: Iter) -> BinaryHeap<T> {
592553
let vec: Vec<T> = iter.collect();
@@ -625,43 +586,6 @@ mod tests {
625586
}
626587
}
627588

628-
#[test]
629-
fn test_move_iter() {
630-
let data = vec!(5i, 9, 3);
631-
let iterout = vec!(9i, 5, 3);
632-
let pq = BinaryHeap::from_vec(data);
633-
634-
let v: Vec<int> = pq.into_iter().collect();
635-
assert_eq!(v, iterout);
636-
}
637-
638-
#[test]
639-
fn test_move_iter_size_hint() {
640-
let data = vec!(5i, 9);
641-
let pq = BinaryHeap::from_vec(data);
642-
643-
let mut it = pq.into_iter();
644-
645-
assert_eq!(it.size_hint(), (2, Some(2)));
646-
assert_eq!(it.next(), Some(9i));
647-
648-
assert_eq!(it.size_hint(), (1, Some(1)));
649-
assert_eq!(it.next(), Some(5i));
650-
651-
assert_eq!(it.size_hint(), (0, Some(0)));
652-
assert_eq!(it.next(), None);
653-
}
654-
655-
#[test]
656-
fn test_move_iter_reverse() {
657-
let data = vec!(5i, 9, 3);
658-
let iterout = vec!(3i, 5, 9);
659-
let pq = BinaryHeap::from_vec(data);
660-
661-
let v: Vec<int> = pq.into_iter().rev().collect();
662-
assert_eq!(v, iterout);
663-
}
664-
665589
#[test]
666590
fn test_top_and_pop() {
667591
let data = vec!(2u, 4, 6, 2, 1, 8, 10, 3, 5, 7, 0, 9, 1);

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ use core::prelude::*;
6767

6868
use alloc::boxed::Box;
6969
use alloc::rc::Rc;
70-
use core::borrow::{Cow, ToOwned};
7170
use core::intrinsics::TypeId;
7271
use core::mem;
7372
use core::num::Int;
@@ -285,13 +284,6 @@ impl<S: Writer, T: Hash<S>, U: Hash<S>> Hash<S> for Result<T, U> {
285284
}
286285
}
287286

288-
impl<'a, T, Sized? B, S> Hash<S> for Cow<'a, T, B> where B: Hash<S> + ToOwned<T> {
289-
#[inline]
290-
fn hash(&self, state: &mut S) {
291-
Hash::hash(&**self, state)
292-
}
293-
}
294-
295287
//////////////////////////////////////////////////////////////////////////////
296288

297289
#[cfg(test)]

0 commit comments

Comments
 (0)