Skip to content

Commit 663da1c

Browse files
---
yaml --- r: 273499 b: refs/heads/beta c: ca609cc h: refs/heads/master i: 273497: 27850d1 273495: 8ad77d6
1 parent d980cc2 commit 663da1c

File tree

171 files changed

+4131
-4359
lines changed

Some content is hidden

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

171 files changed

+4131
-4359
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: 7a38ac8e874d5f22a3a103acde9ef84268ec9388
26+
refs/heads/beta: ca609cc6743df537a287e7b4fe9833f2f8342047
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* | 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/beta/src/compiletest/compiletest.rs

Lines changed: 9 additions & 10 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

@@ -281,16 +280,16 @@ fn collect_tests_from_dir(config: &Config,
281280
-> io::Result<()> {
282281
// Ignore directories that contain a file
283282
// `compiletest-ignore-dir`.
284-
for file in fs::read_dir(dir)? {
285-
let file = file?;
283+
for file in try!(fs::read_dir(dir)) {
284+
let file = try!(file);
286285
if file.file_name() == *"compiletest-ignore-dir" {
287286
return Ok(());
288287
}
289288
}
290289

291-
let dirs = fs::read_dir(dir)?;
290+
let dirs = try!(fs::read_dir(dir));
292291
for file in dirs {
293-
let file = file?;
292+
let file = try!(file);
294293
let file_path = file.path();
295294
debug!("inspecting file {:?}", file_path.display());
296295
if is_test(config, &file_path) {
@@ -311,11 +310,11 @@ fn collect_tests_from_dir(config: &Config,
311310
tests.push(make_test(config, &paths))
312311
} else if file_path.is_dir() {
313312
let relative_file_path = relative_dir_path.join(file.file_name());
314-
collect_tests_from_dir(config,
315-
base,
316-
&file_path,
317-
&relative_file_path,
318-
tests)?;
313+
try!(collect_tests_from_dir(config,
314+
base,
315+
&file_path,
316+
&relative_file_path,
317+
tests));
319318
}
320319
}
321320
Ok(())

branches/beta/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/beta/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/beta/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/beta/src/libcore/clone.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,6 @@
1818
//! them cheap and safe to copy. For other types copies must be made
1919
//! explicitly, by convention implementing the `Clone` trait and calling
2020
//! the `clone` method.
21-
//!
22-
//! Basic usage example:
23-
//!
24-
//! ```
25-
//! let s = String::new(); // String type implements Clone
26-
//! let copy = s.clone(); // so we can clone it
27-
//! ```
28-
//!
29-
//! To easily implement the Clone trait, you can also use
30-
//! `#[derive(Clone)]`. Example:
31-
//!
32-
//! ```
33-
//! #[derive(Clone)] // we add the Clone trait to Morpheus struct
34-
//! struct Morpheus {
35-
//! blue_pill: f32,
36-
//! red_pill: i64,
37-
//! }
38-
//!
39-
//! fn main() {
40-
//! let f = Morpheus { blue_pill: 0.0, red_pill: 0 };
41-
//! let copy = f.clone(); // and now we can clone it!
42-
//! }
43-
//! ```
4421
4522
#![stable(feature = "rust1", since = "1.0.0")]
4623

branches/beta/src/libcore/fmt/builders.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a, 'b: 'a> fmt::Write for PadAdapter<'a, 'b> {
2929
fn write_str(&mut self, mut s: &str) -> fmt::Result {
3030
while !s.is_empty() {
3131
if self.on_newline {
32-
self.fmt.write_str(" ")?;
32+
try!(self.fmt.write_str(" "));
3333
}
3434

3535
let split = match s.find('\n') {
@@ -42,7 +42,7 @@ impl<'a, 'b: 'a> fmt::Write for PadAdapter<'a, 'b> {
4242
s.len()
4343
}
4444
};
45-
self.fmt.write_str(&s[..split])?;
45+
try!(self.fmt.write_str(&s[..split]));
4646
s = &s[split..];
4747
}
4848

@@ -169,10 +169,10 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
169169
if self.fields > 0 {
170170
self.result = self.result.and_then(|_| {
171171
if self.is_pretty() {
172-
self.fmt.write_str("\n")?;
172+
try!(self.fmt.write_str("\n"));
173173
}
174174
if self.fields == 1 && self.empty_name {
175-
self.fmt.write_str(",")?;
175+
try!(self.fmt.write_str(","));
176176
}
177177
self.fmt.write_str(")")
178178
});

branches/beta/src/libcore/fmt/mod.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -795,24 +795,24 @@ pub fn write(output: &mut Write, args: Arguments) -> Result {
795795
None => {
796796
// We can use default formatting parameters for all arguments.
797797
for (arg, piece) in args.args.iter().zip(pieces.by_ref()) {
798-
formatter.buf.write_str(*piece)?;
799-
(arg.formatter)(arg.value, &mut formatter)?;
798+
try!(formatter.buf.write_str(*piece));
799+
try!((arg.formatter)(arg.value, &mut formatter));
800800
}
801801
}
802802
Some(fmt) => {
803803
// Every spec has a corresponding argument that is preceded by
804804
// a string piece.
805805
for (arg, piece) in fmt.iter().zip(pieces.by_ref()) {
806-
formatter.buf.write_str(*piece)?;
807-
formatter.run(arg)?;
806+
try!(formatter.buf.write_str(*piece));
807+
try!(formatter.run(arg));
808808
}
809809
}
810810
}
811811

812812
// There can be only one trailing string piece left.
813813
match pieces.next() {
814814
Some(piece) => {
815-
formatter.buf.write_str(*piece)?;
815+
try!(formatter.buf.write_str(*piece));
816816
}
817817
None => {}
818818
}
@@ -897,9 +897,9 @@ impl<'a> Formatter<'a> {
897897
// Writes the sign if it exists, and then the prefix if it was requested
898898
let write_prefix = |f: &mut Formatter| {
899899
if let Some(c) = sign {
900-
f.buf.write_str(unsafe {
900+
try!(f.buf.write_str(unsafe {
901901
str::from_utf8_unchecked(c.encode_utf8().as_slice())
902-
})?;
902+
}));
903903
}
904904
if prefixed { f.buf.write_str(prefix) }
905905
else { Ok(()) }
@@ -910,26 +910,26 @@ impl<'a> Formatter<'a> {
910910
// If there's no minimum length requirements then we can just
911911
// write the bytes.
912912
None => {
913-
write_prefix(self)?; self.buf.write_str(buf)
913+
try!(write_prefix(self)); self.buf.write_str(buf)
914914
}
915915
// Check if we're over the minimum width, if so then we can also
916916
// just write the bytes.
917917
Some(min) if width >= min => {
918-
write_prefix(self)?; self.buf.write_str(buf)
918+
try!(write_prefix(self)); self.buf.write_str(buf)
919919
}
920920
// The sign and prefix goes before the padding if the fill character
921921
// is zero
922922
Some(min) if self.sign_aware_zero_pad() => {
923923
self.fill = '0';
924-
write_prefix(self)?;
924+
try!(write_prefix(self));
925925
self.with_padding(min - width, rt::v1::Alignment::Right, |f| {
926926
f.buf.write_str(buf)
927927
})
928928
}
929929
// Otherwise, the sign and prefix goes after the padding
930930
Some(min) => {
931931
self.with_padding(min - width, rt::v1::Alignment::Right, |f| {
932-
write_prefix(f)?; f.buf.write_str(buf)
932+
try!(write_prefix(f)); f.buf.write_str(buf)
933933
})
934934
}
935935
}
@@ -1008,13 +1008,13 @@ impl<'a> Formatter<'a> {
10081008
};
10091009

10101010
for _ in 0..pre_pad {
1011-
self.buf.write_str(fill)?;
1011+
try!(self.buf.write_str(fill));
10121012
}
10131013

1014-
f(self)?;
1014+
try!(f(self));
10151015

10161016
for _ in 0..post_pad {
1017-
self.buf.write_str(fill)?;
1017+
try!(self.buf.write_str(fill));
10181018
}
10191019

10201020
Ok(())
@@ -1033,7 +1033,7 @@ impl<'a> Formatter<'a> {
10331033
if self.sign_aware_zero_pad() {
10341034
// a sign always goes first
10351035
let sign = unsafe { str::from_utf8_unchecked(formatted.sign) };
1036-
self.buf.write_str(sign)?;
1036+
try!(self.buf.write_str(sign));
10371037

10381038
// remove the sign from the formatted parts
10391039
formatted.sign = b"";
@@ -1065,19 +1065,19 @@ impl<'a> Formatter<'a> {
10651065
}
10661066

10671067
if !formatted.sign.is_empty() {
1068-
write_bytes(self.buf, formatted.sign)?;
1068+
try!(write_bytes(self.buf, formatted.sign));
10691069
}
10701070
for part in formatted.parts {
10711071
match *part {
10721072
flt2dec::Part::Zero(mut nzeroes) => {
10731073
const ZEROES: &'static str = // 64 zeroes
10741074
"0000000000000000000000000000000000000000000000000000000000000000";
10751075
while nzeroes > ZEROES.len() {
1076-
self.buf.write_str(ZEROES)?;
1076+
try!(self.buf.write_str(ZEROES));
10771077
nzeroes -= ZEROES.len();
10781078
}
10791079
if nzeroes > 0 {
1080-
self.buf.write_str(&ZEROES[..nzeroes])?;
1080+
try!(self.buf.write_str(&ZEROES[..nzeroes]));
10811081
}
10821082
}
10831083
flt2dec::Part::Num(mut v) => {
@@ -1087,10 +1087,10 @@ impl<'a> Formatter<'a> {
10871087
*c = b'0' + (v % 10) as u8;
10881088
v /= 10;
10891089
}
1090-
write_bytes(self.buf, &s[..len])?;
1090+
try!(write_bytes(self.buf, &s[..len]));
10911091
}
10921092
flt2dec::Part::Copy(buf) => {
1093-
write_bytes(self.buf, buf)?;
1093+
try!(write_bytes(self.buf, buf));
10941094
}
10951095
}
10961096
}
@@ -1349,20 +1349,20 @@ impl Display for bool {
13491349
#[stable(feature = "rust1", since = "1.0.0")]
13501350
impl Debug for str {
13511351
fn fmt(&self, f: &mut Formatter) -> Result {
1352-
f.write_char('"')?;
1352+
try!(f.write_char('"'));
13531353
let mut from = 0;
13541354
for (i, c) in self.char_indices() {
13551355
let esc = c.escape_default();
13561356
// If char needs escaping, flush backlog so far and write, else skip
13571357
if esc.size_hint() != (1, Some(1)) {
1358-
f.write_str(&self[from..i])?;
1358+
try!(f.write_str(&self[from..i]));
13591359
for c in esc {
1360-
f.write_char(c)?;
1360+
try!(f.write_char(c));
13611361
}
13621362
from = i + c.len_utf8();
13631363
}
13641364
}
1365-
f.write_str(&self[from..])?;
1365+
try!(f.write_str(&self[from..]));
13661366
f.write_char('"')
13671367
}
13681368
}
@@ -1377,9 +1377,9 @@ impl Display for str {
13771377
#[stable(feature = "rust1", since = "1.0.0")]
13781378
impl Debug for char {
13791379
fn fmt(&self, f: &mut Formatter) -> Result {
1380-
f.write_char('\'')?;
1380+
try!(f.write_char('\''));
13811381
for c in self.escape_default() {
1382-
f.write_char(c)?
1382+
try!(f.write_char(c))
13831383
}
13841384
f.write_char('\'')
13851385
}

branches/beta/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
#![feature(rustc_attrs)]
7878
#![feature(staged_api)]
7979
#![feature(unboxed_closures)]
80-
#![feature(question_mark)]
8180

8281
#[macro_use]
8382
mod macros;

branches/beta/src/libcore/num/dec2flt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn dec2flt<T: RawFloat>(s: &str) -> Result<T, ParseFloatError> {
214214
}
215215
let (sign, s) = extract_sign(s);
216216
let flt = match parse_decimal(s) {
217-
ParseResult::Valid(decimal) => convert(decimal)?,
217+
ParseResult::Valid(decimal) => try!(convert(decimal)),
218218
ParseResult::ShortcutToInf => T::infinity(),
219219
ParseResult::ShortcutToZero => T::zero(),
220220
ParseResult::Invalid => match s {

branches/beta/src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Utf8Error {
240240
/// ```
241241
#[stable(feature = "rust1", since = "1.0.0")]
242242
pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
243-
run_utf8_validation(v)?;
243+
try!(run_utf8_validation(v));
244244
Ok(unsafe { from_utf8_unchecked(v) })
245245
}
246246

0 commit comments

Comments
 (0)