Skip to content

Commit b289b82

Browse files
committed
---
yaml --- r: 276532 b: refs/heads/try c: 3ee841c h: refs/heads/master
1 parent 062d349 commit b289b82

File tree

343 files changed

+6257
-9725
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

+6257
-9725
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: a8d59e0ca62a47e87bf4b5288b9aaf586ae3c640
4+
refs/heads/try: 3ee841c3351326a7bea83b689f54d9fee27e6e85
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* | 7.3*)
1037+
(7.0* | 7.1* | 7.2*)
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-
-Cmetadata="test-crate" -L "$$(RT_OUTPUT_DIR_$(2))" \
386+
-L "$$(RT_OUTPUT_DIR_$(2))" \
387387
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
388388
$$(RUSTFLAGS_$(4))
389389

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,3 @@ 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: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ 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-
}
189186
DocBook { stage } => {
190187
doc::rustbook(self, stage, target.target, "book", &doc_out);
191188
}
@@ -213,9 +210,6 @@ impl Build {
213210
CheckLinkcheck { stage } => {
214211
check::linkcheck(self, stage, target.target);
215212
}
216-
CheckCargoTest { stage } => {
217-
check::cargotest(self, stage, target.target);
218-
}
219213

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

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ 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 }),
5150

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

7977
// Distribution targets, creating tarballs
8078
(dist, Dist { stage: u32 }),
@@ -294,9 +292,6 @@ impl<'a> Step<'a> {
294292
Source::CheckLinkcheck { stage } => {
295293
vec![self.tool_linkchecker(stage), self.doc(stage)]
296294
}
297-
Source::CheckCargoTest { stage } => {
298-
vec![self.tool_cargotest(stage)]
299-
}
300295

301296
Source::ToolLinkchecker { stage } => {
302297
vec![self.libstd(self.compiler(stage))]
@@ -305,9 +300,6 @@ impl<'a> Step<'a> {
305300
Source::ToolRustbook { stage } => {
306301
vec![self.librustc(self.compiler(stage))]
307302
}
308-
Source::ToolCargoTest { stage } => {
309-
vec![self.libstd(self.compiler(stage))]
310-
}
311303

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

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

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

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: PathBuf,
72+
pub compile_lib_path: String,
7373

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

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

branches/try/src/compiletest/compiletest.rs

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

2019
#![deny(warnings)]
2120

@@ -118,17 +117,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
118117
}
119118
}
120119

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-
129120
Config {
130-
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
131-
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
121+
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
122+
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
132123
rustc_path: opt_path(matches, "rustc-path"),
133124
rustdoc_path: opt_path(matches, "rustdoc-path"),
134125
python: matches.opt_str("python").unwrap(),
@@ -289,16 +280,16 @@ fn collect_tests_from_dir(config: &Config,
289280
-> io::Result<()> {
290281
// Ignore directories that contain a file
291282
// `compiletest-ignore-dir`.
292-
for file in fs::read_dir(dir)? {
293-
let file = file?;
283+
for file in try!(fs::read_dir(dir)) {
284+
let file = try!(file);
294285
if file.file_name() == *"compiletest-ignore-dir" {
295286
return Ok(());
296287
}
297288
}
298289

299-
let dirs = fs::read_dir(dir)?;
290+
let dirs = try!(fs::read_dir(dir));
300291
for file in dirs {
301-
let file = file?;
292+
let file = try!(file);
302293
let file_path = file.path();
303294
debug!("inspecting file {:?}", file_path.display());
304295
if is_test(config, &file_path) {
@@ -319,11 +310,11 @@ fn collect_tests_from_dir(config: &Config,
319310
tests.push(make_test(config, &paths))
320311
} else if file_path.is_dir() {
321312
let relative_file_path = relative_dir_path.join(file.file_name());
322-
collect_tests_from_dir(config,
323-
base,
324-
&file_path,
325-
&relative_file_path,
326-
tests)?;
313+
try!(collect_tests_from_dir(config,
314+
base,
315+
&file_path,
316+
&relative_file_path,
317+
tests));
327318
}
328319
}
329320
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.to_str().unwrap(),
319+
&config.compile_lib_path,
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.to_str().unwrap(),
638+
&config.run_lib_path,
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.to_str().unwrap(),
1318+
&config.run_lib_path,
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.to_str().unwrap(),
1390+
&config.compile_lib_path,
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.to_str().unwrap(),
1413+
&config.compile_lib_path,
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: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,14 @@ to it.
282282

283283
## Lifetime Elision
284284

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
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
291293
away the actual types involved as full local inference would if applied to it.
292294

293295
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 expressions][match], and other places, too. Let’s go
4+
bindings][bindings], [match statements][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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,8 +1905,6 @@ 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.
19101908

19111909
### Static-only attributes
19121910

branches/try/src/libcollections/string.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ use core::iter::FromIterator;
6161
use core::mem;
6262
use core::ops::{self, Add, Index, IndexMut};
6363
use core::ptr;
64+
use core::slice;
6465
use core::str::pattern::Pattern;
6566
use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
6667
use rustc_unicode::str as unicode_str;
@@ -969,7 +970,22 @@ impl String {
969970
pub fn push(&mut self, ch: char) {
970971
match ch.len_utf8() {
971972
1 => self.vec.push(ch as u8),
972-
_ => self.vec.extend_from_slice(ch.encode_utf8().as_slice()),
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+
}
973989
}
974990
}
975991

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

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

branches/try/src/libcollectionstest/str.rs

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

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

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

0 commit comments

Comments
 (0)