Skip to content

Commit ac095b8

Browse files
committed
---
yaml --- r: 160671 b: refs/heads/master c: 8d7b319 h: refs/heads/master i: 160669: f36ad35 160667: cba0197 160663: 0b4fde8 160655: 15f728a 160639: 01d1670 v: v3
1 parent 7b78bed commit ac095b8

Some content is hidden

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

55 files changed

+2343
-416
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7dadb14fb213e6f5d7948aafc4a71726b1242d9c
2+
refs/heads/master: 8d7b3199d9a285b66b4f9a49d97234c956cb5e6c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c9f6d696420107f82304b992cf623b806995fe18
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe

trunk/mk/crates.mk

Lines changed: 2 additions & 3 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 sync getopts collections test time rand \
53+
serialize 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 sync unicode \
66+
DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
@@ -81,7 +81,6 @@ 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
8584
DEPS_getopts := std
8685
DEPS_collections := core alloc unicode
8786
DEPS_num := std

trunk/src/compiletest/errors.rs

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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::*;
1011

1112
use std::ascii::AsciiExt;
1213
use std::io::{BufferedReader, File};
@@ -18,28 +19,74 @@ pub struct ExpectedError {
1819
pub msg: String,
1920
}
2021

21-
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
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) }
2235

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

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+
2750
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
28-
parse_expected(line_no + 1, ln.unwrap().as_slice(), re)
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+
})
2961
}).collect()
3062
}
3163

32-
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
64+
fn parse_expected(last_nonfollow_error: Option<uint>,
65+
line_num: uint,
66+
line: &str,
67+
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
3368
re.captures(line).and_then(|caps| {
3469
let adjusts = caps.name("adjusts").len();
3570
let kind = caps.name("kind").to_ascii_lower();
3671
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+
};
3786

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

trunk/src/etc/licenseck.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
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
41+
"libstd/sync/mpsc_queue.rs", # BSD
42+
"libstd/sync/spsc_queue.rs", # BSD
43+
"libstd/sync/mpmc_bounded_queue.rs", # BSD
4544
"test/bench/shootout-binarytrees.rs", # BSD
4645
"test/bench/shootout-chameneos-redux.rs", # BSD
4746
"test/bench/shootout-fannkuch-redux.rs", # BSD

0 commit comments

Comments
 (0)