Skip to content

Commit 574ba2d

Browse files
committed
---
yaml --- r: 273483 b: refs/heads/beta c: 2acad9c h: refs/heads/master i: 273481: 51ccdb4 273479: 657cd3b
1 parent 4a78ea3 commit 574ba2d

File tree

70 files changed

+3214
-579
lines changed

Some content is hidden

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

70 files changed

+3214
-579
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 4c71347e94a420ea063a17f017ee20d516919091
26+
refs/heads/beta: 2acad9c17edbdecf8060324ba11768b0a9c7c635
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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/beta/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
9797
log graphviz rustc_llvm rustc_back rustc_data_structures\
9898
rustc_const_eval
9999
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
100-
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
100+
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
101101
DEPS_rustc_data_structures := std log serialize
102102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
103103
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \

branches/beta/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/beta/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/beta/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/beta/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/beta/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/beta/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/beta/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/beta/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)