Skip to content

Commit c870428

Browse files
committed
---
yaml --- r: 182695 b: refs/heads/beta c: 4cfb700 h: refs/heads/master i: 182693: e4475a4 182691: 214d8cd 182687: 389493a v: v3
1 parent 27b218a commit c870428

File tree

146 files changed

+6377
-7203
lines changed

Some content is hidden

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

146 files changed

+6377
-7203
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 102ab57d8085fcb87c02dae929959ccaaa9af548
34+
refs/heads/beta: 4cfb70026c91a338518a17579bcd62a32a0a413d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/configure

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ need_ok() {
2828

2929
need_cmd() {
3030
if command -v $1 >/dev/null 2>&1
31-
then msg "found program $1"
32-
else err "need program $1"
31+
then msg "found $1"
32+
else err "need $1"
3333
fi
3434
}
3535

@@ -340,7 +340,6 @@ need_cmd date
340340
need_cmd tr
341341
need_cmd sed
342342
need_cmd file
343-
need_cmd make
344343

345344
msg "inspecting environment"
346345

@@ -646,8 +645,6 @@ probe CFG_ISCC iscc
646645
probe CFG_JAVAC javac
647646
probe CFG_ANTLR4 antlr4
648647
probe CFG_GRUN grun
649-
probe CFG_FLEX flex
650-
probe CFG_BISON bison
651648
probe CFG_PANDOC pandoc
652649
probe CFG_PDFLATEX pdflatex
653650
probe CFG_XELATEX xelatex

branches/beta/mk/crates.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test rand \
54-
log graphviz core rbml alloc \
54+
log regex graphviz core rbml alloc \
5555
unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5757
rustc_trans rustc_back rustc_llvm rustc_privacy
@@ -95,15 +95,16 @@ DEPS_term := std log
9595
DEPS_getopts := std
9696
DEPS_collections := core alloc unicode
9797
DEPS_num := std
98-
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
98+
DEPS_test := std getopts serialize rbml term regex native:rust_test_helpers
9999
DEPS_rand := core
100-
DEPS_log := std
100+
DEPS_log := std regex
101+
DEPS_regex := std
101102
DEPS_fmt_macros = std
102103

103104
TOOL_DEPS_compiletest := test getopts
104105
TOOL_DEPS_rustdoc := rustdoc
105106
TOOL_DEPS_rustc := rustc_driver
106-
TOOL_DEPS_rustbook := std rustdoc
107+
TOOL_DEPS_rustbook := std regex rustdoc
107108
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
108109
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
109110
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
@@ -129,8 +130,9 @@ DOC_CRATES := $(filter-out rustc, \
129130
$(filter-out rustc_driver, \
130131
$(filter-out rustc_privacy, \
131132
$(filter-out log, \
133+
$(filter-out regex, \
132134
$(filter-out getopts, \
133-
$(filter-out syntax, $(CRATES)))))))))))
135+
$(filter-out syntax, $(CRATES))))))))))))
134136
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
135137
rustc_typeck rustc_driver syntax rustc_privacy
136138

branches/beta/mk/grammar.mk

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
1414
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
1515
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
1616
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
17-
ifeq ($(CFG_OSTYPE),apple-darwin)
18-
FLEX_LDFLAGS=-ll
19-
else
20-
FLEX_LDFLAGS=-lfl
21-
endif
2217

2318
# Run the reference lexer against libsyntax and compare the tokens and spans.
2419
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@@ -72,46 +67,3 @@ $(info cfg: javac not available, skipping lexer test...)
7267
check-lexer:
7368

7469
endif
75-
76-
$(BG)lex.yy.c: $(SG)lexer.l $(BG)
77-
@$(call E, flex: $@)
78-
$(Q)$(CFG_FLEX) -o $@ $<
79-
80-
$(BG)lexer-lalr.o: $(BG)lex.yy.c $(BG)parser-lalr.tab.h
81-
@$(call E, cc: $@)
82-
$(Q)$(CFG_CC) -include $(BG)parser-lalr.tab.h -c -o $@ $<
83-
84-
$(BG)parser-lalr.tab.c $(BG)parser-lalr.tab.h: $(SG)parser-lalr.y
85-
@$(call E, bison: $@)
86-
$(Q)$(CFG_BISON) $< --output=$(BG)parser-lalr.tab.c --defines=$(BG)parser-lalr.tab.h \
87-
--name-prefix=rs --warnings=error=all
88-
89-
$(BG)parser-lalr.o: $(BG)parser-lalr.tab.c
90-
@$(call E, cc: $@)
91-
$(Q)$(CFG_CC) -c -o $@ $<
92-
93-
$(BG)parser-lalr-main.o: $(SG)parser-lalr-main.c
94-
@$(call E, cc: $@)
95-
$(Q)$(CFG_CC) -std=c99 -c -o $@ $<
96-
97-
$(BG)parser-lalr: $(BG)parser-lalr.o $(BG)parser-lalr-main.o $(BG)lexer-lalr.o
98-
@$(call E, cc: $@)
99-
$(Q)$(CFG_CC) -o $@ $^ $(FLEX_LDFLAGS)
100-
101-
102-
ifdef CFG_FLEX
103-
ifdef CFG_BISON
104-
check-grammar: $(BG) $(BG)parser-lalr
105-
$(info Verifying grammar ...)
106-
$(SG)testparser.py -p $(BG)parser-lalr -s $(S)src
107-
108-
else
109-
$(info cfg: bison not available, skipping parser test...)
110-
check-grammar:
111-
112-
endif
113-
else
114-
$(info cfg: flex not available, skipping parser test...)
115-
check-grammar:
116-
117-
endif

branches/beta/mk/main.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

branches/beta/src/compiletest/common.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,8 @@ pub use self::Mode::*;
1111

1212
use std::fmt;
1313
use std::str::FromStr;
14+
use regex::Regex;
1415

15-
#[cfg(stage0)] // NOTE: remove impl after snapshot
16-
#[derive(Clone, PartialEq, Show)]
17-
pub enum Mode {
18-
CompileFail,
19-
RunFail,
20-
RunPass,
21-
RunPassValgrind,
22-
Pretty,
23-
DebugInfoGdb,
24-
DebugInfoLldb,
25-
Codegen
26-
}
27-
28-
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
2916
#[derive(Clone, PartialEq, Debug)]
3017
pub enum Mode {
3118
CompileFail,
@@ -38,7 +25,6 @@ pub enum Mode {
3825
Codegen
3926
}
4027

41-
4228
impl Copy for Mode {}
4329

4430
impl FromStr for Mode {
@@ -115,7 +101,10 @@ pub struct Config {
115101
pub run_ignored: bool,
116102

117103
// Only run tests that match this filter
118-
pub filter: Option<String>,
104+
pub filter: Option<Regex>,
105+
106+
// Precompiled regex for finding expected errors in cfail
107+
pub cfail_regex: Regex,
119108

120109
// Write out a parseable log of tests that were run
121110
pub logfile: Option<Path>,

branches/beta/src/compiletest/compiletest.rs

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ extern crate getopts;
2222

2323
#[macro_use]
2424
extern crate log;
25+
extern crate regex;
2526

2627
use std::os;
2728
use std::io;
@@ -32,6 +33,7 @@ use getopts::{optopt, optflag, reqopt};
3233
use common::Config;
3334
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
3435
use util::logv;
36+
use regex::Regex;
3537

3638
pub mod procsrv;
3739
pub mod util;
@@ -114,7 +116,14 @@ pub fn parse_config(args: Vec<String> ) -> Config {
114116
}
115117

116118
let filter = if !matches.free.is_empty() {
117-
Some(matches.free[0].clone())
119+
let s = matches.free[0].as_slice();
120+
match regex::Regex::new(s) {
121+
Ok(re) => Some(re),
122+
Err(e) => {
123+
println!("failed to parse filter /{}/: {:?}", s, e);
124+
panic!()
125+
}
126+
}
118127
} else {
119128
None
120129
};
@@ -136,6 +145,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
136145
.as_slice()).expect("invalid mode"),
137146
run_ignored: matches.opt_present("ignored"),
138147
filter: filter,
148+
cfail_regex: Regex::new(errors::EXPECTED_PATTERN).unwrap(),
139149
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
140150
runtool: matches.opt_str("runtool"),
141151
host_rustcflags: matches.opt_str("host-rustcflags"),
@@ -238,9 +248,6 @@ pub fn run_tests(config: &Config) {
238248
// parallel (especially when we have lots and lots of child processes).
239249
// For context, see #8904
240250
io::test::raise_fd_limit();
241-
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
242-
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
243-
os::setenv("__COMPAT_LAYER", "RunAsInvoker");
244251
let res = test::run_tests_console(&opts, tests.into_iter().collect());
245252
match res {
246253
Ok(true) => {}
@@ -364,24 +371,18 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
364371
if full_version_line.as_slice().trim().len() > 0 => {
365372
let full_version_line = full_version_line.as_slice().trim();
366373

367-
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
368-
for (pos, c) in full_version_line.char_indices() {
369-
if !c.is_digit(10) { continue }
370-
if pos + 2 >= full_version_line.len() { continue }
371-
if full_version_line.char_at(pos + 1) != '.' { continue }
372-
if !full_version_line.char_at(pos + 2).is_digit(10) { continue }
373-
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
374-
continue
374+
let re = Regex::new(r"(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)").unwrap();
375+
376+
match re.captures(full_version_line) {
377+
Some(captures) => {
378+
Some(captures.at(2).unwrap_or("").to_string())
375379
}
376-
if pos + 3 < full_version_line.len() &&
377-
full_version_line.char_at(pos + 3).is_digit(10) {
378-
continue
380+
None => {
381+
println!("Could not extract GDB version from line '{}'",
382+
full_version_line);
383+
None
379384
}
380-
return Some(full_version_line[pos..pos+3].to_string());
381385
}
382-
println!("Could not extract GDB version from line '{}'",
383-
full_version_line);
384-
None
385386
},
386387
_ => None
387388
}
@@ -404,26 +405,18 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
404405
if full_version_line.as_slice().trim().len() > 0 => {
405406
let full_version_line = full_version_line.as_slice().trim();
406407

407-
for (pos, l) in full_version_line.char_indices() {
408-
if l != 'l' && l != 'L' { continue }
409-
if pos + 5 >= full_version_line.len() { continue }
410-
let l = full_version_line.char_at(pos + 1);
411-
if l != 'l' && l != 'L' { continue }
412-
let d = full_version_line.char_at(pos + 2);
413-
if d != 'd' && d != 'D' { continue }
414-
let b = full_version_line.char_at(pos + 3);
415-
if b != 'b' && b != 'B' { continue }
416-
let dash = full_version_line.char_at(pos + 4);
417-
if dash != '-' { continue }
418-
419-
let vers = full_version_line[pos + 5..].chars().take_while(|c| {
420-
c.is_digit(10)
421-
}).collect::<String>();
422-
if vers.len() > 0 { return Some(vers) }
408+
let re = Regex::new(r"[Ll][Ll][Dd][Bb]-([0-9]+)").unwrap();
409+
410+
match re.captures(full_version_line) {
411+
Some(captures) => {
412+
Some(captures.at(1).unwrap_or("").to_string())
413+
}
414+
None => {
415+
println!("Could not extract LLDB version from line '{}'",
416+
full_version_line);
417+
None
418+
}
423419
}
424-
println!("Could not extract LLDB version from line '{}'",
425-
full_version_line);
426-
None
427420
},
428421
_ => None
429422
}

0 commit comments

Comments
 (0)