Skip to content

Commit 5c985f7

Browse files
committed
---
yaml --- r: 277111 b: refs/heads/try c: 74b3684 h: refs/heads/master i: 277109: eeaa633 277107: 282b3a5 277103: 8f81f05
1 parent 1d6005b commit 5c985f7

File tree

211 files changed

+3151
-2034
lines changed

Some content is hidden

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

211 files changed

+3151
-2034
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 8efbfae6bf3ec3995dca0604d09c839967840b7a
4+
refs/heads/try: 74b3684d009c0e243a282c9a573ef5e29a2681d9
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
/stage3/
7979
/test/
8080
/tmp/
81+
/obj/
8182
TAGS
8283
TAGS.emacs
8384
TAGS.vi

branches/try/RELEASES.md

Lines changed: 290 additions & 2 deletions
Large diffs are not rendered by default.

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.9.0
16+
CFG_RELEASE_NUM=1.10.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

branches/try/mk/tests.mk

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -240,52 +240,16 @@ cleantestlibs:
240240
# Tidy
241241
######################################################################
242242

243-
ifdef CFG_NOTIDY
244243
.PHONY: tidy
245-
tidy:
246-
else
247-
248-
# Run the tidy script in multiple parts to avoid huge 'echo' commands
249-
.PHONY: tidy
250-
tidy: tidy-basic tidy-binaries tidy-errors tidy-features
251-
252-
endif
253-
254-
.PHONY: tidy-basic
255-
tidy-basic:
256-
@$(call E, check: formatting)
257-
$(Q) $(CFG_PYTHON) $(S)src/etc/tidy.py $(S)src/
258-
259-
.PHONY: tidy-binaries
260-
tidy-binaries:
261-
@$(call E, check: binaries)
262-
$(Q)find $(S)src -type f \
263-
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
264-
-not -name '*.rs' -and -not -name '*.py' \
265-
-and -not -name '*.sh' -and -not -name '*.pp' \
266-
| grep '^$(S)src/jemalloc' -v \
267-
| grep '^$(S)src/libuv' -v \
268-
| grep '^$(S)src/llvm' -v \
269-
| grep '^$(S)src/rt/hoedown' -v \
270-
| grep '^$(S)src/gyp' -v \
271-
| grep '^$(S)src/etc' -v \
272-
| grep '^$(S)src/doc' -v \
273-
| grep '^$(S)src/compiler-rt' -v \
274-
| grep '^$(S)src/libbacktrace' -v \
275-
| grep '^$(S)src/rust-installer' -v \
276-
| grep '^$(S)src/liblibc' -v \
277-
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
278-
279-
.PHONY: tidy-errors
280-
tidy-errors:
281-
@$(call E, check: extended errors)
282-
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
283-
284-
.PHONY: tidy-features
285-
tidy-features:
286-
@$(call E, check: feature sanity)
287-
$(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
288-
244+
tidy: $(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD))
245+
$(TARGET_RPATH_VAR0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $< $(S)src
246+
247+
$(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD)): \
248+
$(TSREQ0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
249+
$(TLIB0_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.std \
250+
$(call rwildcard,$(S)src/tools/tidy/src,*.rs)
251+
$(STAGE0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(S)src/tools/tidy/src/main.rs \
252+
--out-dir $(@D) --crate-name tidy
289253

290254
######################################################################
291255
# Sets of tests

branches/try/src/bootstrap/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

branches/try/src/bootstrap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ path = "rustdoc.rs"
2121

2222
[dependencies]
2323
build_helper = { path = "../build_helper" }
24-
cmake = "0.1.10"
24+
cmake = "0.1.17"
2525
filetime = "0.1"
2626
num_cpus = "0.2"
2727
toml = "0.1"

branches/try/src/bootstrap/build/check.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
3333
.env("PATH", newpath)
3434
.arg(&build.cargo));
3535
}
36+
37+
pub fn tidy(build: &Build, stage: u32, host: &str) {
38+
println!("tidy check stage{} ({})", stage, host);
39+
let compiler = Compiler::new(stage, host);
40+
build.run(build.tool_cmd(&compiler, "tidy")
41+
.arg(build.src.join("src")));
42+
}

branches/try/src/bootstrap/build/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value};
3131
#[derive(Default)]
3232
pub struct Config {
3333
pub ccache: bool,
34+
pub ninja: bool,
3435
pub verbose: bool,
3536
pub submodules: bool,
3637
pub compiler_docs: bool,
@@ -107,6 +108,7 @@ struct Build {
107108
#[derive(RustcDecodable, Default)]
108109
struct Llvm {
109110
ccache: Option<bool>,
111+
ninja: Option<bool>,
110112
assertions: Option<bool>,
111113
optimize: Option<bool>,
112114
version_check: Option<bool>,
@@ -200,9 +202,9 @@ impl Config {
200202

201203
if let Some(ref llvm) = toml.llvm {
202204
set(&mut config.ccache, llvm.ccache);
205+
set(&mut config.ninja, llvm.ninja);
203206
set(&mut config.llvm_assertions, llvm.assertions);
204207
set(&mut config.llvm_optimize, llvm.optimize);
205-
set(&mut config.llvm_optimize, llvm.optimize);
206208
set(&mut config.llvm_version_check, llvm.version_check);
207209
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
208210
}

branches/try/src/bootstrap/build/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ impl Build {
197197
ToolCargoTest { stage } => {
198198
compile::tool(self, stage, target.target, "cargotest");
199199
}
200+
ToolTidy { stage } => {
201+
compile::tool(self, stage, target.target, "tidy");
202+
}
200203
DocBook { stage } => {
201204
doc::rustbook(self, stage, target.target, "book", &doc_out);
202205
}
@@ -230,6 +233,9 @@ impl Build {
230233
CheckCargoTest { stage } => {
231234
check::cargotest(self, stage, target.target);
232235
}
236+
CheckTidy { stage } => {
237+
check::tidy(self, stage, target.target);
238+
}
233239

234240
DistDocs { stage } => dist::docs(self, stage, target.target),
235241
DistMingw { _dummy } => dist::mingw(self, target.target),

branches/try/src/bootstrap/build/native.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) {
4343

4444
// http://llvm.org/docs/CMake.html
4545
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
46+
if build.config.ninja {
47+
cfg.generator("Ninja");
48+
}
4649
cfg.target(target)
4750
.host(&build.config.build)
4851
.out_dir(&dst)

branches/try/src/bootstrap/build/sanity.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub fn check(build: &mut Build) {
4848
}
4949
}
5050
need_cmd("cmake".as_ref());
51+
if build.config.ninja {
52+
need_cmd("ninja".as_ref())
53+
}
5154
break
5255
}
5356

branches/try/src/bootstrap/build/step.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ macro_rules! targets {
5151
(tool_rustbook, ToolRustbook { stage: u32 }),
5252
(tool_error_index, ToolErrorIndex { stage: u32 }),
5353
(tool_cargotest, ToolCargoTest { stage: u32 }),
54+
(tool_tidy, ToolTidy { stage: u32 }),
5455

5556
// Steps for long-running native builds. Ideally these wouldn't
5657
// actually exist and would be part of build scripts, but for now
@@ -79,6 +80,7 @@ macro_rules! targets {
7980
(check, Check { stage: u32, compiler: Compiler<'a> }),
8081
(check_linkcheck, CheckLinkcheck { stage: u32 }),
8182
(check_cargotest, CheckCargoTest { stage: u32 }),
83+
(check_tidy, CheckTidy { stage: u32 }),
8284

8385
// Distribution targets, creating tarballs
8486
(dist, Dist { stage: u32 }),
@@ -148,7 +150,9 @@ fn top_level(build: &Build) -> Vec<Step> {
148150
src: Source::Llvm { _dummy: () },
149151
target: &build.config.build,
150152
};
151-
targets.push(t.doc(stage));
153+
if build.config.docs {
154+
targets.push(t.doc(stage));
155+
}
152156
for host in build.config.host.iter() {
153157
if !build.flags.host.contains(host) {
154158
continue
@@ -316,8 +320,12 @@ impl<'a> Step<'a> {
316320
Source::CheckCargoTest { stage } => {
317321
vec![self.tool_cargotest(stage)]
318322
}
323+
Source::CheckTidy { stage } => {
324+
vec![self.tool_tidy(stage)]
325+
}
319326

320-
Source::ToolLinkchecker { stage } => {
327+
Source::ToolLinkchecker { stage } |
328+
Source::ToolTidy { stage } => {
321329
vec![self.libstd(self.compiler(stage))]
322330
}
323331
Source::ToolErrorIndex { stage } |
@@ -350,7 +358,9 @@ impl<'a> Step<'a> {
350358
let compiler = self.compiler(stage);
351359
for target in build.config.target.iter() {
352360
let target = self.target(target);
353-
base.push(target.dist_docs(stage));
361+
if build.config.docs {
362+
base.push(target.dist_docs(stage));
363+
}
354364
base.push(target.dist_std(compiler));
355365
}
356366
}

branches/try/src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ check-cargotest:
4242
$(Q)$(BOOTSTRAP) --step check-cargotest
4343
dist:
4444
$(Q)$(BOOTSTRAP) --step dist
45+
tidy:
46+
$(Q)$(BOOTSTRAP) --step check-tidy --stage 0
4547

4648
.PHONY: dist

branches/try/src/compiletest/compiletest.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(box_syntax)]
1414
#![feature(libc)]
1515
#![feature(rustc_private)]
16-
#![feature(str_char)]
1716
#![feature(test)]
1817
#![feature(question_mark)]
1918

@@ -412,16 +411,26 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
412411

413412
// used to be a regex "(^|[^0-9])([0-9]\.[0-9]+)"
414413
for (pos, c) in full_version_line.char_indices() {
415-
if !c.is_digit(10) { continue }
416-
if pos + 2 >= full_version_line.len() { continue }
417-
if full_version_line.char_at(pos + 1) != '.' { continue }
418-
if !full_version_line.char_at(pos + 2).is_digit(10) { continue }
419-
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
414+
if !c.is_digit(10) {
415+
continue
416+
}
417+
if pos + 2 >= full_version_line.len() {
418+
continue
419+
}
420+
if full_version_line[pos + 1..].chars().next().unwrap() != '.' {
421+
continue
422+
}
423+
if !full_version_line[pos + 2..].chars().next().unwrap().is_digit(10) {
424+
continue
425+
}
426+
if pos > 0 && full_version_line[..pos].chars().next_back()
427+
.unwrap().is_digit(10) {
420428
continue
421429
}
422430
let mut end = pos + 3;
423431
while end < full_version_line.len() &&
424-
full_version_line.char_at(end).is_digit(10) {
432+
full_version_line[end..].chars().next()
433+
.unwrap().is_digit(10) {
425434
end += 1;
426435
}
427436
return Some(full_version_line[pos..end].to_owned());
@@ -453,13 +462,13 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
453462
for (pos, l) in full_version_line.char_indices() {
454463
if l != 'l' && l != 'L' { continue }
455464
if pos + 5 >= full_version_line.len() { continue }
456-
let l = full_version_line.char_at(pos + 1);
465+
let l = full_version_line[pos + 1..].chars().next().unwrap();
457466
if l != 'l' && l != 'L' { continue }
458-
let d = full_version_line.char_at(pos + 2);
467+
let d = full_version_line[pos + 2..].chars().next().unwrap();
459468
if d != 'd' && d != 'D' { continue }
460-
let b = full_version_line.char_at(pos + 3);
469+
let b = full_version_line[pos + 3..].chars().next().unwrap();
461470
if b != 'b' && b != 'B' { continue }
462-
let dash = full_version_line.char_at(pos + 4);
471+
let dash = full_version_line[pos + 4..].chars().next().unwrap();
463472
if dash != '-' { continue }
464473

465474
let vers = full_version_line[pos + 5..].chars().take_while(|c| {

branches/try/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
115115
tag: &str)
116116
-> Option<(WhichLine, ExpectedError)> {
117117
let start = match line.find(tag) { Some(i) => i, None => return None };
118-
let (follow, adjusts) = if line.char_at(start + tag.len()) == '|' {
118+
let (follow, adjusts) = if line[start + tag.len()..].chars().next().unwrap() == '|' {
119119
(true, 0)
120120
} else {
121121
(false, line[start + tag.len()..].chars().take_while(|c| *c == '^').count())

branches/try/src/compiletest/runtest.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -868,27 +868,11 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
868868
"-g".to_owned(),
869869
"--debuginfo".to_owned()
870870
];
871-
let mut new_options =
871+
let new_options =
872872
split_maybe_args(options).into_iter()
873873
.filter(|x| !options_to_remove.contains(x))
874874
.collect::<Vec<String>>();
875875

876-
let mut i = 0;
877-
while i + 1 < new_options.len() {
878-
if new_options[i] == "-Z" {
879-
// FIXME #31005 MIR missing debuginfo currently.
880-
if new_options[i + 1] == "orbit" {
881-
// Remove "-Z" and "orbit".
882-
new_options.remove(i);
883-
new_options.remove(i);
884-
continue;
885-
}
886-
// Always skip over -Z's argument.
887-
i += 1;
888-
}
889-
i += 1;
890-
}
891-
892876
Some(new_options.join(" "))
893877
}
894878

@@ -1177,7 +1161,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
11771161
if *idx >= haystack.len() {
11781162
return false;
11791163
}
1180-
let ch = haystack.char_at(*idx);
1164+
let ch = haystack[*idx..].chars().next().unwrap();
11811165
if ch != needle {
11821166
return false;
11831167
}
@@ -1188,7 +1172,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
11881172
fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
11891173
let mut i = *idx;
11901174
while i < haystack.len() {
1191-
let ch = haystack.char_at(i);
1175+
let ch = haystack[i..].chars().next().unwrap();
11921176
if ch < '0' || '9' < ch {
11931177
break;
11941178
}
@@ -1208,7 +1192,7 @@ fn scan_string(haystack: &str, needle: &str, idx: &mut usize) -> bool {
12081192
if haystack_i >= haystack.len() {
12091193
return false;
12101194
}
1211-
let ch = haystack.char_at(haystack_i);
1195+
let ch = haystack[haystack_i..].chars().next().unwrap();
12121196
haystack_i += ch.len_utf8();
12131197
if !scan_char(needle, ch, &mut needle_i) {
12141198
return false;

0 commit comments

Comments
 (0)