Skip to content

Commit 8b85c12

Browse files
committed
---
yaml --- r: 271453 b: refs/heads/auto c: 7027521 h: refs/heads/master i: 271451: 2a12e98
1 parent 0ad699b commit 8b85c12

File tree

164 files changed

+4080
-4225
lines changed

Some content is hidden

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

164 files changed

+4080
-4225
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 98f0a9128f0fc6545de14a5de8f0e91675045e56
11+
refs/heads/auto: 7027521daa0e4b3891151a9e0700786febf1cfa2
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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

branches/auto/src/libgraphviz/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@
295295
#![cfg_attr(not(stage0), deny(warnings))]
296296

297297
#![feature(str_escape)]
298-
#![feature(question_mark)]
299298

300299
use self::LabelText::*;
301300

@@ -663,7 +662,7 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G,
663662
{
664663
fn writeln<W: Write>(w: &mut W, arg: &[&str]) -> io::Result<()> {
665664
for &s in arg {
666-
w.write_all(s.as_bytes())?;
665+
try!(w.write_all(s.as_bytes()));
667666
}
668667
write!(w, "\n")
669668
}
@@ -672,9 +671,9 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G,
672671
w.write_all(b" ")
673672
}
674673

675-
writeln(w, &["digraph ", g.graph_id().as_slice(), " {"])?;
674+
try!(writeln(w, &["digraph ", g.graph_id().as_slice(), " {"]));
676675
for n in g.nodes().iter() {
677-
indent(w)?;
676+
try!(indent(w));
678677
let id = g.node_id(n);
679678

680679
let escaped = &g.node_label(n).to_dot_string();
@@ -703,12 +702,12 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G,
703702
}
704703

705704
text.push(";");
706-
writeln(w, &text)?;
705+
try!(writeln(w, &text));
707706
}
708707

709708
for e in g.edges().iter() {
710709
let escaped_label = &g.edge_label(e).to_dot_string();
711-
indent(w)?;
710+
try!(indent(w));
712711
let source = g.source(e);
713712
let target = g.target(e);
714713
let source_id = g.node_id(&source);
@@ -730,7 +729,7 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G,
730729
}
731730

732731
text.push(";");
733-
writeln(w, &text)?;
732+
try!(writeln(w, &text));
734733
}
735734

736735
writeln(w, &["}"])
@@ -960,7 +959,7 @@ mod tests {
960959
let mut writer = Vec::new();
961960
render(&g, &mut writer).unwrap();
962961
let mut s = String::new();
963-
Read::read_to_string(&mut &*writer, &mut s)?;
962+
try!(Read::read_to_string(&mut &*writer, &mut s));
964963
Ok(s)
965964
}
966965

0 commit comments

Comments
 (0)