Skip to content

Commit 909b26a

Browse files
committed
---
yaml --- r: 276535 b: refs/heads/try c: b55d772 h: refs/heads/master i: 276533: 470ff94 276531: 062d349 276527: bde2411
1 parent 57493fc commit 909b26a

File tree

343 files changed

+9724
-6247
lines changed

Some content is hidden

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

343 files changed

+9724
-6247
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: 180d6b55ca19c63347664f0622b6ccc37fb101f5
4+
refs/heads/try: b55d7729c2cc7401600915ed4b17c291fe0dd8c2
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ then
10341034
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10351035
then
10361036
case $CFG_OSX_CLANG_VERSION in
1037-
(7.0* | 7.1* | 7.2*)
1037+
(7.0* | 7.1* | 7.2* | 7.3*)
10381038
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10391039
;;
10401040
(*)

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
383383
@$$(call E, rustc: $$@)
384384
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
385385
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
386-
-L "$$(RT_OUTPUT_DIR_$(2))" \
386+
-Cmetadata="test-crate" -L "$$(RT_OUTPUT_DIR_$(2))" \
387387
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
388388
$$(RUSTFLAGS_$(4))
389389

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
1616
build.run(build.tool_cmd(&compiler, "linkchecker")
1717
.arg(build.out.join(host).join("doc")));
1818
}
19+
20+
pub fn cargotest(build: &Build, stage: u32, host: &str) {
21+
let ref compiler = Compiler::new(stage, host);
22+
build.run(build.tool_cmd(compiler, "cargotest")
23+
.env("RUSTC", build.compiler_path(compiler))
24+
.env("RUSTDOC", build.rustdoc(compiler))
25+
.arg(&build.cargo));
26+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ impl Build {
183183
compile::tool(self, stage, target.target,
184184
"error_index_generator");
185185
}
186+
ToolCargoTest { stage } => {
187+
compile::tool(self, stage, target.target, "cargotest");
188+
}
186189
DocBook { stage } => {
187190
doc::rustbook(self, stage, target.target, "book", &doc_out);
188191
}
@@ -210,6 +213,9 @@ impl Build {
210213
CheckLinkcheck { stage } => {
211214
check::linkcheck(self, stage, target.target);
212215
}
216+
CheckCargoTest { stage } => {
217+
check::cargotest(self, stage, target.target);
218+
}
213219

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ macro_rules! targets {
4747
(tool_linkchecker, ToolLinkchecker { stage: u32 }),
4848
(tool_rustbook, ToolRustbook { stage: u32 }),
4949
(tool_error_index, ToolErrorIndex { stage: u32 }),
50+
(tool_cargotest, ToolCargoTest { stage: u32 }),
5051

5152
// Steps for long-running native builds. Ideally these wouldn't
5253
// actually exist and would be part of build scripts, but for now
@@ -73,6 +74,7 @@ macro_rules! targets {
7374
// target to depend on a bunch of others.
7475
(check, Check { stage: u32, compiler: Compiler<'a> }),
7576
(check_linkcheck, CheckLinkcheck { stage: u32 }),
77+
(check_cargotest, CheckCargoTest { stage: u32 }),
7678

7779
// Distribution targets, creating tarballs
7880
(dist, Dist { stage: u32 }),
@@ -292,6 +294,9 @@ impl<'a> Step<'a> {
292294
Source::CheckLinkcheck { stage } => {
293295
vec![self.tool_linkchecker(stage), self.doc(stage)]
294296
}
297+
Source::CheckCargoTest { stage } => {
298+
vec![self.tool_cargotest(stage)]
299+
}
295300

296301
Source::ToolLinkchecker { stage } => {
297302
vec![self.libstd(self.compiler(stage))]
@@ -300,6 +305,9 @@ impl<'a> Step<'a> {
300305
Source::ToolRustbook { stage } => {
301306
vec![self.librustc(self.compiler(stage))]
302307
}
308+
Source::ToolCargoTest { stage } => {
309+
vec![self.libstd(self.compiler(stage))]
310+
}
303311

304312
Source::DistDocs { stage } => vec![self.doc(stage)],
305313
Source::DistMingw { _dummy: _ } => Vec::new(),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ standalone-docs:
3838
$(Q)$(BOOTSTRAP) --step doc-standalone
3939
check:
4040
$(Q)$(BOOTSTRAP) --step check
41+
cargotest:
42+
$(Q)$(BOOTSTRAP) --step cargotest
4143
dist:
4244
$(Q)$(BOOTSTRAP) --step dist
4345

branches/try/src/compiletest/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ impl fmt::Display for Mode {
6969
#[derive(Clone)]
7070
pub struct Config {
7171
// The library paths required for running the compiler
72-
pub compile_lib_path: String,
72+
pub compile_lib_path: PathBuf,
7373

7474
// The library paths required for running compiled programs
75-
pub run_lib_path: String,
75+
pub run_lib_path: PathBuf,
7676

7777
// The rustc executable
7878
pub rustc_path: PathBuf,

branches/try/src/compiletest/compiletest.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#![feature(rustc_private)]
1616
#![feature(str_char)]
1717
#![feature(test)]
18+
#![feature(question_mark)]
1819

1920
#![deny(warnings)]
2021

@@ -117,9 +118,17 @@ pub fn parse_config(args: Vec<String> ) -> Config {
117118
}
118119
}
119120

121+
fn make_absolute(path: PathBuf) -> PathBuf {
122+
if path.is_relative() {
123+
env::current_dir().unwrap().join(path)
124+
} else {
125+
path
126+
}
127+
}
128+
120129
Config {
121-
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
122-
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
130+
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
131+
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
123132
rustc_path: opt_path(matches, "rustc-path"),
124133
rustdoc_path: opt_path(matches, "rustdoc-path"),
125134
python: matches.opt_str("python").unwrap(),
@@ -280,16 +289,16 @@ fn collect_tests_from_dir(config: &Config,
280289
-> io::Result<()> {
281290
// Ignore directories that contain a file
282291
// `compiletest-ignore-dir`.
283-
for file in try!(fs::read_dir(dir)) {
284-
let file = try!(file);
292+
for file in fs::read_dir(dir)? {
293+
let file = file?;
285294
if file.file_name() == *"compiletest-ignore-dir" {
286295
return Ok(());
287296
}
288297
}
289298

290-
let dirs = try!(fs::read_dir(dir));
299+
let dirs = fs::read_dir(dir)?;
291300
for file in dirs {
292-
let file = try!(file);
301+
let file = file?;
293302
let file_path = file.path();
294303
debug!("inspecting file {:?}", file_path.display());
295304
if is_test(config, &file_path) {
@@ -310,11 +319,11 @@ fn collect_tests_from_dir(config: &Config,
310319
tests.push(make_test(config, &paths))
311320
} else if file_path.is_dir() {
312321
let relative_file_path = relative_dir_path.join(file.file_name());
313-
try!(collect_tests_from_dir(config,
314-
base,
315-
&file_path,
316-
&relative_file_path,
317-
tests));
322+
collect_tests_from_dir(config,
323+
base,
324+
&file_path,
325+
&relative_file_path,
326+
tests)?;
318327
}
319328
}
320329
Ok(())

branches/try/src/compiletest/runtest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ fn run_pretty_test_revision(config: &Config,
316316
testpaths,
317317
pretty_type.to_owned()),
318318
props.exec_env.clone(),
319-
&config.compile_lib_path,
319+
config.compile_lib_path.to_str().unwrap(),
320320
Some(aux_dir.to_str().unwrap()),
321321
Some(src))
322322
}
@@ -635,7 +635,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testpaths: &TestPa
635635
testpaths,
636636
proc_args,
637637
environment,
638-
&config.run_lib_path,
638+
config.run_lib_path.to_str().unwrap(),
639639
None,
640640
None);
641641
}
@@ -1315,7 +1315,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
13151315
testpaths,
13161316
make_run_args(config, props, testpaths),
13171317
env,
1318-
&config.run_lib_path,
1318+
config.run_lib_path.to_str().unwrap(),
13191319
Some(aux_dir.to_str().unwrap()),
13201320
None)
13211321
}
@@ -1387,7 +1387,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
13871387
&aux_testpaths,
13881388
aux_args,
13891389
Vec::new(),
1390-
&config.compile_lib_path,
1390+
config.compile_lib_path.to_str().unwrap(),
13911391
Some(aux_dir.to_str().unwrap()),
13921392
None);
13931393
if !auxres.status.success() {
@@ -1410,7 +1410,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
14101410
testpaths,
14111411
args,
14121412
props.rustc_env.clone(),
1413-
&config.compile_lib_path,
1413+
config.compile_lib_path.to_str().unwrap(),
14141414
Some(aux_dir.to_str().unwrap()),
14151415
input)
14161416
}

branches/try/src/doc/book/drop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ BOOM times 100!!!
5555
BOOM times 1!!!
5656
```
5757

58-
The TNT goes off before the firecracker does, because it was declared
58+
The `tnt` goes off before the `firecracker` does, because it was declared
5959
afterwards. Last in, first out.
6060

6161
So what is `Drop` good for? Generally, `Drop` is used to clean up any resources

branches/try/src/doc/book/lifetimes.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,12 @@ to it.
282282

283283
## Lifetime Elision
284284

285-
Rust supports powerful local type inference in function bodies, but it’s
286-
forbidden in item signatures to allow reasoning about the types based on
287-
the item signature alone. However, for ergonomic reasons a very restricted
288-
secondary inference algorithm called “lifetime elision” applies in function
289-
signatures. It infers only based on the signature components themselves and not
290-
based on the body of the function, only infers lifetime parameters, and does
291-
this with only three easily memorizable and unambiguous rules. This makes
292-
lifetime elision a shorthand for writing an item signature, while not hiding
285+
Rust supports powerful local type inference in the bodies of functions but not in their item signatures.
286+
It's forbidden to allow reasoning about types based on the item signature alone.
287+
However, for ergonomic reasons, a very restricted secondary inference algorithm called
288+
“lifetime elision” does apply when judging lifetimes. Lifetime elision is concerned solely to infer
289+
lifetime parameters using three easily memorizable and unambiguous rules. This means lifetime elision
290+
acts as a shorthand for writing an item signature, while not hiding
293291
away the actual types involved as full local inference would if applied to it.
294292

295293
When talking about lifetime elision, we use the term *input lifetime* and

branches/try/src/doc/book/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Patterns
22

33
Patterns are quite common in Rust. We use them in [variable
4-
bindings][bindings], [match statements][match], and other places, too. Let’s go
4+
bindings][bindings], [match expressions][match], and other places, too. Let’s go
55
on a whirlwind tour of all of the things patterns can do!
66

77
[bindings]: variable-bindings.html

branches/try/src/doc/reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,8 @@ type int8_t = i8;
19051905
- `should_panic` - indicates that this test function should panic, inverting the success condition.
19061906
- `cold` - The function is unlikely to be executed, so optimize it (and calls
19071907
to it) differently.
1908+
- `naked` - The function utilizes a custom ABI or custom inline ASM that requires
1909+
epilogue and prologue to be skipped.
19081910

19091911
### Static-only attributes
19101912

branches/try/src/libcollections/string.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use core::iter::FromIterator;
6161
use core::mem;
6262
use core::ops::{self, Add, Index, IndexMut};
6363
use core::ptr;
64-
use core::slice;
6564
use core::str::pattern::Pattern;
6665
use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
6766
use rustc_unicode::str as unicode_str;
@@ -970,22 +969,7 @@ impl String {
970969
pub fn push(&mut self, ch: char) {
971970
match ch.len_utf8() {
972971
1 => self.vec.push(ch as u8),
973-
ch_len => {
974-
let cur_len = self.len();
975-
// This may use up to 4 bytes.
976-
self.vec.reserve(ch_len);
977-
978-
unsafe {
979-
// Attempt to not use an intermediate buffer by just pushing bytes
980-
// directly onto this string.
981-
let slice = slice::from_raw_parts_mut(self.vec
982-
.as_mut_ptr()
983-
.offset(cur_len as isize),
984-
ch_len);
985-
let used = ch.encode_utf8(slice).unwrap_or(0);
986-
self.vec.set_len(cur_len + used);
987-
}
988-
}
972+
_ => self.vec.extend_from_slice(ch.encode_utf8().as_slice()),
989973
}
990974
}
991975

@@ -1136,9 +1120,10 @@ impl String {
11361120
let len = self.len();
11371121
assert!(idx <= len);
11381122
assert!(self.is_char_boundary(idx));
1139-
self.vec.reserve(4);
1140-
let mut bits = [0; 4];
1141-
let amt = ch.encode_utf8(&mut bits).unwrap();
1123+
let bits = ch.encode_utf8();
1124+
let bits = bits.as_slice();
1125+
let amt = bits.len();
1126+
self.vec.reserve(amt);
11421127

11431128
unsafe {
11441129
ptr::copy(self.vec.as_ptr().offset(idx as isize),

branches/try/src/libcollectionstest/str.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,9 @@ fn test_rev_iterator() {
794794

795795
#[test]
796796
fn test_chars_decoding() {
797-
let mut bytes = [0; 4];
798797
for c in (0..0x110000).filter_map(::std::char::from_u32) {
799-
let len = c.encode_utf8(&mut bytes).unwrap_or(0);
800-
let s = ::std::str::from_utf8(&bytes[..len]).unwrap();
798+
let bytes = c.encode_utf8();
799+
let s = ::std::str::from_utf8(bytes.as_slice()).unwrap();
801800
if Some(c) != s.chars().next() {
802801
panic!("character {:x}={} does not decode correctly", c as u32, c);
803802
}
@@ -806,10 +805,9 @@ fn test_chars_decoding() {
806805

807806
#[test]
808807
fn test_chars_rev_decoding() {
809-
let mut bytes = [0; 4];
810808
for c in (0..0x110000).filter_map(::std::char::from_u32) {
811-
let len = c.encode_utf8(&mut bytes).unwrap_or(0);
812-
let s = ::std::str::from_utf8(&bytes[..len]).unwrap();
809+
let bytes = c.encode_utf8();
810+
let s = ::std::str::from_utf8(bytes.as_slice()).unwrap();
813811
if Some(c) != s.chars().rev().next() {
814812
panic!("character {:x}={} does not decode correctly", c as u32, c);
815813
}

0 commit comments

Comments
 (0)