Skip to content

Commit 34fa318

Browse files
committed
---
yaml --- r: 194017 b: refs/heads/beta c: 212e031 h: refs/heads/master i: 194015: 651bf33 v: v3
1 parent 7698b5e commit 34fa318

File tree

91 files changed

+426
-360
lines changed

Some content is hidden

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

91 files changed

+426
-360
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: e2fa53e593a854a609ae9efe5a1bbe15265f0a6f
34+
refs/heads/beta: 212e03181e422f569b6426bc08b713a9efc0d0eb
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/compiletest/procsrv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
#![allow(deprecated)] // for old path, for dynamic_lib
1212

13-
use std::process::{ExitStatus, Command, Child, Output, Stdio};
14-
use std::io::prelude::*;
1513
use std::dynamic_lib::DynamicLibrary;
14+
use std::io::prelude::*;
15+
use std::old_path::Path;
16+
use std::process::{ExitStatus, Command, Child, Output, Stdio};
1617

1718
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1819
// Need to be sure to put both the lib_path and the aux path in the dylib

branches/beta/src/libcollections/fmt.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
//!
263263
//! ```
264264
//! # #![allow(unused_must_use)]
265+
//! use std::io::Write;
265266
//! let mut w = Vec::new();
266267
//! write!(&mut w, "Hello {}!", "world");
267268
//! ```
@@ -288,15 +289,15 @@
288289
//!
289290
//! ```
290291
//! use std::fmt;
291-
//! use std::old_io;
292+
//! use std::io::{self, Write};
292293
//!
293294
//! fmt::format(format_args!("this returns {}", "String"));
294295
//!
295-
//! let mut some_writer = old_io::stdout();
296+
//! let mut some_writer = io::stdout();
296297
//! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
297298
//!
298299
//! fn my_fmt_fn(args: fmt::Arguments) {
299-
//! write!(&mut old_io::stdout(), "{}", args);
300+
//! write!(&mut io::stdout(), "{}", args);
300301
//! }
301302
//! my_fmt_fn(format_args!("or a {} too", "function"));
302303
//! ```

branches/beta/src/libcore/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ macro_rules! try {
176176
///
177177
/// ```
178178
/// # #![allow(unused_must_use)]
179+
/// use std::io::Write;
179180
///
180181
/// let mut w = Vec::new();
181182
/// write!(&mut w, "test");

branches/beta/src/libcore/prelude.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ pub use marker::{Copy, Send, Sized, Sync};
2929
pub use ops::{Drop, Fn, FnMut, FnOnce};
3030

3131
// Reexported functions
32-
#[allow(deprecated)]
33-
pub use iter::range;
3432
pub use mem::drop;
3533

3634
// Reexported types and traits

branches/beta/src/libcore/result.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! let bad_result: Result<int, int> = bad_result.or_else(|i| Ok(11));
7979
//!
8080
//! // Consume the result and return the contents with `unwrap`.
81-
//! let final_awesome_result = good_result.unwrap();
81+
//! let final_awesome_result = good_result.ok().unwrap();
8282
//! ```
8383
//!
8484
//! # Results must be used
@@ -110,7 +110,8 @@
110110
//! something like this:
111111
//!
112112
//! ```{.ignore}
113-
//! use std::old_io::{File, Open, Write};
113+
//! use std::old_io::*;
114+
//! use std::old_path::Path;
114115
//!
115116
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
116117
//! // If `write_line` errors, then we'll never know, because the return
@@ -128,7 +129,8 @@
128129
//! a marginally useful message indicating why:
129130
//!
130131
//! ```{.no_run}
131-
//! use std::old_io::{File, Open, Write};
132+
//! use std::old_io::*;
133+
//! use std::old_path::Path;
132134
//!
133135
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
134136
//! file.write_line("important message").ok().expect("failed to write message");
@@ -138,7 +140,8 @@
138140
//! You might also simply assert success:
139141
//!
140142
//! ```{.no_run}
141-
//! # use std::old_io::{File, Open, Write};
143+
//! # use std::old_io::*;
144+
//! # use std::old_path::Path;
142145
//!
143146
//! # let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
144147
//! assert!(file.write_line("important message").is_ok());
@@ -148,7 +151,8 @@
148151
//! Or propagate the error up the call stack with `try!`:
149152
//!
150153
//! ```
151-
//! # use std::old_io::{File, Open, Write, IoError};
154+
//! # use std::old_io::*;
155+
//! # use std::old_path::Path;
152156
//! fn write_message() -> Result<(), IoError> {
153157
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
154158
//! try!(file.write_line("important message"));
@@ -167,7 +171,8 @@
167171
//! It replaces this:
168172
//!
169173
//! ```
170-
//! use std::old_io::{File, Open, Write, IoError};
174+
//! use std::old_io::*;
175+
//! use std::old_path::Path;
171176
//!
172177
//! struct Info {
173178
//! name: String,
@@ -191,7 +196,8 @@
191196
//! With this:
192197
//!
193198
//! ```
194-
//! use std::old_io::{File, Open, Write, IoError};
199+
//! use std::old_io::*;
200+
//! use std::old_path::Path;
195201
//!
196202
//! struct Info {
197203
//! name: String,
@@ -446,7 +452,7 @@ impl<T, E> Result<T, E> {
446452
/// ignoring I/O and parse errors:
447453
///
448454
/// ```
449-
/// use std::old_io::IoResult;
455+
/// use std::old_io::*;
450456
///
451457
/// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
452458
/// let mut buffer = &mut buffer;
@@ -460,7 +466,7 @@ impl<T, E> Result<T, E> {
460466
/// line.trim_right().parse::<int>().unwrap_or(0)
461467
/// });
462468
/// // Add the value if there were no errors, otherwise add 0
463-
/// sum += val.unwrap_or(0);
469+
/// sum += val.ok().unwrap_or(0);
464470
/// }
465471
///
466472
/// assert!(sum == 10);

branches/beta/src/libcoretest/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn test_bool_from_str() {
3535
fn check_contains_all_substrings(s: &str) {
3636
assert!(s.contains(""));
3737
for i in 0..s.len() {
38-
for j in range(i+1, s.len() + 1) {
38+
for j in i+1..s.len() + 1 {
3939
assert!(s.contains(&s[i..j]));
4040
}
4141
}

branches/beta/src/librustc/middle/astencode.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use std::io::SeekFrom;
4343
use std::io::prelude::*;
4444
use std::num::FromPrimitive;
4545
use std::rc::Rc;
46-
use std::fmt::Debug;
4746

4847
use rbml::reader;
4948
use rbml::writer::Encoder;
@@ -314,11 +313,9 @@ trait def_id_encoder_helpers {
314313
fn emit_def_id(&mut self, did: ast::DefId);
315314
}
316315

317-
impl<S:serialize::Encoder> def_id_encoder_helpers for S
318-
where <S as serialize::serialize::Encoder>::Error: Debug
319-
{
316+
impl<S:serialize::Encoder> def_id_encoder_helpers for S {
320317
fn emit_def_id(&mut self, did: ast::DefId) {
321-
did.encode(self).unwrap()
318+
did.encode(self).ok().unwrap()
322319
}
323320
}
324321

@@ -328,18 +325,15 @@ trait def_id_decoder_helpers {
328325
cdata: &cstore::crate_metadata) -> ast::DefId;
329326
}
330327

331-
impl<D:serialize::Decoder> def_id_decoder_helpers for D
332-
where <D as serialize::serialize::Decoder>::Error: Debug
333-
{
328+
impl<D:serialize::Decoder> def_id_decoder_helpers for D {
334329
fn read_def_id(&mut self, dcx: &DecodeContext) -> ast::DefId {
335-
let did: ast::DefId = Decodable::decode(self).unwrap();
330+
let did: ast::DefId = Decodable::decode(self).ok().unwrap();
336331
did.tr(dcx)
337332
}
338333

339334
fn read_def_id_nodcx(&mut self,
340-
cdata: &cstore::crate_metadata)
341-
-> ast::DefId {
342-
let did: ast::DefId = Decodable::decode(self).unwrap();
335+
cdata: &cstore::crate_metadata) -> ast::DefId {
336+
let did: ast::DefId = Decodable::decode(self).ok().unwrap();
343337
decoder::translate_def_id(cdata, did)
344338
}
345339
}
@@ -1790,7 +1784,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
17901784
fn read_closure_kind<'b, 'c>(&mut self, _dcx: &DecodeContext<'b, 'c, 'tcx>)
17911785
-> ty::ClosureKind
17921786
{
1793-
Decodable::decode(self).unwrap()
1787+
Decodable::decode(self).ok().unwrap()
17941788
}
17951789

17961790
fn read_closure_ty<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)

branches/beta/src/librustc/middle/cfg/graphviz.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ fn replace_newline_with_backslash_l(s: String) -> String {
5454
}
5555

5656
impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> {
57-
fn graph_id(&'a self) -> dot::Id<'a> { dot::Id::new(&self.name[..]).unwrap() }
57+
fn graph_id(&'a self) -> dot::Id<'a> { dot::Id::new(&self.name[..]).ok().unwrap() }
5858

5959
fn node_id(&'a self, &(i,_): &Node<'a>) -> dot::Id<'a> {
60-
dot::Id::new(format!("N{}", i.node_id())).unwrap()
60+
dot::Id::new(format!("N{}", i.node_id())).ok().unwrap()
6161
}
6262

6363
fn node_label(&'a self, &(i, n): &Node<'a>) -> dot::LabelText<'a> {

branches/beta/src/librustc/middle/infer/region_inference/graphviz.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a,
6969
return;
7070
}
7171

72-
let requested_output = env::var("RUST_REGION_GRAPH");
72+
let requested_output = env::var("RUST_REGION_GRAPH").ok();
7373
debug!("requested_output: {:?} requested_node: {:?}",
7474
requested_output, requested_node);
7575

7676
let output_path = {
7777
let output_template = match requested_output {
78-
Ok(ref s) if &**s == "help" => {
78+
Some(ref s) if &**s == "help" => {
7979
static PRINTED_YET: AtomicBool = ATOMIC_BOOL_INIT;
8080
if !PRINTED_YET.load(Ordering::SeqCst) {
8181
print_help_message();
@@ -84,8 +84,8 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a,
8484
return;
8585
}
8686

87-
Ok(other_path) => other_path,
88-
Err(_) => "/tmp/constraints.node%.dot".to_string(),
87+
Some(other_path) => other_path,
88+
None => "/tmp/constraints.node%.dot".to_string(),
8989
};
9090

9191
if output_template.len() == 0 {
@@ -171,7 +171,7 @@ impl<'a, 'tcx> ConstraintGraph<'a, 'tcx> {
171171

172172
impl<'a, 'tcx> dot::Labeller<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> {
173173
fn graph_id(&self) -> dot::Id {
174-
dot::Id::new(&*self.graph_name).unwrap()
174+
dot::Id::new(&*self.graph_name).ok().unwrap()
175175
}
176176
fn node_id(&self, n: &Node) -> dot::Id {
177177
let node_id = match self.node_ids.get(n) {

branches/beta/src/librustc_back/fs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use std::io;
12-
#[allow(deprecated)] use std::old_path;
12+
#[allow(deprecated)] use std::old_path::{self, GenericPath};
1313
#[allow(deprecated)] use std::old_io;
1414
use std::path::{Path, PathBuf};
1515

@@ -72,6 +72,7 @@ mod test {
7272
use std::old_io::fs::{File, symlink, mkdir, mkdir_recursive};
7373
use super::old_realpath as realpath;
7474
use std::old_io::TempDir;
75+
use std::old_path::{Path, GenericPath};
7576

7677
#[test]
7778
fn realpath_works() {

branches/beta/src/librustc_borrowck/borrowck/gather_loans/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for StaticInitializerCtxt<'a, 'tcx> {
491491
if let ast::ExprAddrOf(mutbl, ref base) = ex.node {
492492
let param_env = ty::empty_parameter_environment(self.bccx.tcx);
493493
let mc = mc::MemCategorizationContext::new(&param_env);
494-
let base_cmt = mc.cat_expr(&**base).unwrap();
494+
let base_cmt = mc.cat_expr(&**base).ok().unwrap();
495495
let borrow_kind = ty::BorrowKind::from_mutbl(mutbl);
496496
// Check that we don't allow borrows of unsafe static items.
497497
if check_aliasability(self.bccx, ex.span, euv::AddrOf,

branches/beta/src/librustdoc/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ use std::path::PathBuf;
6464
use std::rc::Rc;
6565
use std::sync::mpsc::channel;
6666

67+
#[allow(deprecated)] use std::old_path::Path;
68+
6769
use externalfiles::ExternalHtml;
6870
use serialize::Decodable;
6971
use serialize::json::{self, Json};

branches/beta/src/librustdoc/plugins.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::dynamic_lib as dl;
1616
use serialize::json;
1717
use std::mem;
1818
use std::string::String;
19+
use std::old_path::{Path, GenericPath};
1920

2021
pub type PluginJson = Option<(String, json::Json)>;
2122
pub type PluginResult = (clean::Crate, PluginJson);

branches/beta/src/libserialize/json.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,7 @@ mod tests {
26222622
use std::{i64, u64, f32, f64};
26232623
use std::collections::BTreeMap;
26242624
use std::string;
2625+
use std::old_io::Writer;
26252626

26262627
#[derive(RustcDecodable, Eq, PartialEq, Debug)]
26272628
struct OptionData {

branches/beta/src/libserialize/serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Core encoding and decoding interfaces.
1515
*/
1616

1717
#[allow(deprecated)]
18-
use std::old_path;
18+
use std::old_path::{self, GenericPath};
1919
use std::path;
2020
use std::rc::Rc;
2121
use std::cell::{Cell, RefCell};

branches/beta/src/libstd/dynamic_lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919
use prelude::v1::*;
2020

21+
use env;
2122
use ffi::CString;
2223
use mem;
23-
use env;
24-
use str;
24+
use old_path::{Path, GenericPath};
2525
use os;
26+
use str;
2627

2728
pub struct DynamicLibrary {
2829
handle: *mut u8
@@ -133,15 +134,15 @@ mod test {
133134
use super::*;
134135
use prelude::v1::*;
135136
use libc;
137+
use old_path::Path;
136138
use mem;
137139

138140
#[test]
139141
#[cfg_attr(any(windows, target_os = "android"), ignore)] // FIXME #8818, #10379
140142
fn test_loading_cosine() {
141143
// The math library does not need to be loaded since it is already
142144
// statically linked in
143-
let none: Option<&Path> = None; // appease the typechecker
144-
let libm = match DynamicLibrary::open(none) {
145+
let libm = match DynamicLibrary::open(None) {
145146
Err(error) => panic!("Could not load self as module: {}", error),
146147
Ok(libm) => libm
147148
};

branches/beta/src/libstd/env.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,11 @@ mod arch {
729729
mod tests {
730730
use prelude::v1::*;
731731
use super::*;
732+
732733
use iter::repeat;
733734
use rand::{self, Rng};
734735
use ffi::{OsString, OsStr};
735-
use path::PathBuf;
736+
use path::{Path, PathBuf};
736737

737738
fn make_rand_name() -> OsString {
738739
let mut rng = rand::thread_rng();

0 commit comments

Comments
 (0)