Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #23806

Merged
merged 11 commits into from
Mar 28, 2015
4 changes: 2 additions & 2 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Linux or a Mac, all you need to do is this (note that you don't need to type
in the `$`s, they just indicate the start of each command):

```bash
$ curl -L https://static.rust-lang.org/rustup.sh | sudo sh
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
```

If you're concerned about the [potential insecurity](http://curlpipesh.tumblr.com/) of using `curl | sudo sh`,
please keep reading and see our disclaimer below. And feel free to use a two-step version of the installation and examine our installation script:

```bash
$ curl -L https://static.rust-lang.org/rustup.sh -O
$ curl -f -L https://static.rust-lang.org/rustup.sh -O
$ sudo sh rustup.sh
```

Expand Down
11 changes: 6 additions & 5 deletions src/doc/trpl/method-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ You can think of this first parameter as being the `x` in `x.foo()`. The three
variants correspond to the three kinds of thing `x` could be: `self` if it's
just a value on the stack, `&self` if it's a reference, and `&mut self` if it's
a mutable reference. We should default to using `&self`, as it's the most
common. Here's an example of all three variants:
common, as Rustaceans prefer borrowing over taking ownership, and references
over mutable references. Here's an example of all three variants:

```rust
struct Circle {
Expand Down Expand Up @@ -100,16 +101,16 @@ impl Circle {
std::f64::consts::PI * (self.radius * self.radius)
}

fn grow(&self) -> Circle {
Circle { x: self.x, y: self.y, radius: (self.radius * 10.0) }
fn grow(&self, increment: f64) -> Circle {
Circle { x: self.x, y: self.y, radius: self.radius + increment }
}
}

fn main() {
let c = Circle { x: 0.0, y: 0.0, radius: 2.0 };
println!("{}", c.area());

let d = c.grow().area();
let d = c.grow(2.0).area();
println!("{}", d);
}
```
Expand All @@ -124,7 +125,7 @@ fn grow(&self) -> Circle {
```

We just say we're returning a `Circle`. With this method, we can grow a new
circle with an area that's 100 times larger than the old one.
circle to any arbitrary size.

## Static methods

Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ use core::prelude::*;
use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::fmt;
use core::cmp::{Ordering};
use core::cmp::Ordering;
use core::default::Default;
use core::mem::{min_align_of, size_of};
use core::mem;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use core::default::Default;
use core::fmt::Debug;
use core::hash::{Hash, Hasher};
use core::iter::{Map, FromIterator, IntoIterator};
use core::ops::{Index};
use core::ops::Index;
use core::{iter, fmt, mem, usize};
use Bound::{self, Included, Excluded, Unbounded};

Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use core::prelude::*;
use alloc::boxed::Box;
use alloc::heap::{EMPTY, allocate, reallocate, deallocate};
use core::cmp::max;
use core::cmp::{Ordering};
use core::cmp::Ordering;
use core::default::Default;
use core::fmt;
use core::hash::{self, Hash};
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ use fmt::{Debug, Display};

/// Base functionality for all errors in Rust.
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Error: Debug + Display + Send {
pub trait Error: Debug + Display {
/// A short description of the error.
///
/// The description should not contain newlines or sentence-ending
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ use self::Option::*;
use clone::Clone;
use cmp::{Eq, Ord};
use default::Default;
use iter::{ExactSizeIterator};
use iter::ExactSizeIterator;
use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, IntoIterator};
use mem;
use ops::FnOnce;
Expand Down
2 changes: 1 addition & 1 deletion src/librand/distributions/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// this is surprisingly complicated to be both generic & correct

use core::prelude::{PartialOrd};
use core::prelude::PartialOrd;
use core::num::Int;
use core::num::wrapping::WrappingOps;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use metadata::cstore;
use metadata::decoder;
use metadata::tyencode;
use middle::def;
use middle::ty::{lookup_item_type};
use middle::ty::lookup_item_type;
use middle::ty::{self, Ty};
use middle::stability;
use util::nodemap::{FnvHashMap, NodeMap, NodeSet};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
//! no means all of the necessary details. Take a look at the rest of
//! metadata::loader or metadata::creader for all the juicy details!

use back::archive::{METADATA_FILENAME};
use back::archive::METADATA_FILENAME;
use back::svh::Svh;
use session::Session;
use session::search_paths::PathKind;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/astencode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use rbml::writer::Encoder;
use rbml;
use serialize;
use serialize::{Decodable, Decoder, DecoderHelpers, Encodable};
use serialize::{EncoderHelpers};
use serialize::EncoderHelpers;

#[cfg(test)] use std::io::Cursor;
#[cfg(test)] use syntax::parse;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use middle::const_eval::{const_expr_to_pat, lookup_const_by_id};
use middle::def::*;
use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor, Init};
use middle::expr_use_visitor::{JustWrite, LoanCause, MutateMode};
use middle::expr_use_visitor::{WriteAndRead};
use middle::expr_use_visitor::WriteAndRead;
use middle::expr_use_visitor as euv;
use middle::mem_categorization::cmt;
use middle::pat_util::*;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/infer/bivariate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
//! In particular, it might be enough to say (A,B) are bivariant for
//! all (A,B).

use middle::ty::{BuiltinBounds};
use middle::ty::BuiltinBounds;
use middle::ty::{self, Ty};
use middle::ty::TyVar;
use middle::infer::combine::*;
use middle::infer::{cres};
use middle::infer::type_variable::{BiTo};
use util::ppaux::{Repr};
use middle::infer::cres;
use middle::infer::type_variable::BiTo;
use util::ppaux::Repr;

pub struct Bivariate<'f, 'tcx: 'f> {
fields: CombineFields<'f, 'tcx>
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/infer/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use middle::subst;
use middle::subst::{ErasedRegions, NonerasedRegions, Substs};
use middle::ty::{FloatVar, FnSig, IntVar, TyVar};
use middle::ty::{IntType, UintType};
use middle::ty::{BuiltinBounds};
use middle::ty::BuiltinBounds;
use middle::ty::{self, Ty};
use middle::ty_fold;
use middle::ty_fold::{TypeFolder, TypeFoldable};
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/infer/equate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use middle::ty::{self, Ty};
use middle::ty::TyVar;
use middle::infer::combine::*;
use middle::infer::{cres};
use middle::infer::{Subtype};
use middle::infer::type_variable::{EqTo};
use util::ppaux::{Repr};
use middle::infer::cres;
use middle::infer::Subtype;
use middle::infer::type_variable::EqTo;
use util::ppaux::Repr;

pub struct Equate<'f, 'tcx: 'f> {
fields: CombineFields<'f, 'tcx>
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/infer/glb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use super::combine::*;
use super::lattice::*;
use super::higher_ranked::HigherRankedRelations;
use super::{cres};
use super::cres;
use super::Subtype;

use middle::ty::{self, Ty};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/infer/lattice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use super::combine::*;
use super::glb::Glb;
use super::lub::Lub;

use middle::ty::{TyVar};
use middle::ty::TyVar;
use middle::ty::{self, Ty};
use util::ppaux::Repr;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/infer/lub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use super::combine::*;
use super::higher_ranked::HigherRankedRelations;
use super::lattice::*;
use super::{cres};
use super::{Subtype};
use super::cres;
use super::Subtype;

use middle::ty::{self, Ty};
use util::ppaux::Repr;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, UnconstrainedNumeric};
use middle::ty::replace_late_bound_regions;
use middle::ty::{self, Ty};
use middle::ty_fold::{TypeFolder, TypeFoldable};
use std::cell::{RefCell};
use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
use syntax::ast;
use syntax::codemap;
use syntax::codemap::Span;
use util::nodemap::FnvHashMap;
use util::ppaux::{ty_to_string};
use util::ppaux::ty_to_string;
use util::ppaux::{Repr, UserString};

use self::combine::{Combine, Combineable, CombineFields};
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/infer/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
// except according to those terms.

use super::combine::*;
use super::{cres};
use super::cres;
use super::higher_ranked::HigherRankedRelations;
use super::{Subtype};
use super::Subtype;
use super::type_variable::{SubtypeOf, SupertypeOf};

use middle::ty::{self, Ty};
use middle::ty::TyVar;
use util::ppaux::{Repr};
use util::ppaux::Repr;

/// "Greatest lower bound" (common subtype)
pub struct Sub<'f, 'tcx: 'f> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use middle::check_const;
use middle::def;
use middle::region;
use middle::ty::{self, Ty};
use util::nodemap::{NodeMap};
use util::nodemap::NodeMap;
use util::ppaux::{Repr, UserString};

use syntax::ast::{MutImmutable, MutMutable};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/pat_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use middle::ty;
use util::nodemap::FnvHashMap;

use syntax::ast;
use syntax::ast_util::{walk_pat};
use syntax::ast_util::walk_pat;
use syntax::codemap::{Span, DUMMY_SP};

pub type PatIdMap = FnvHashMap<ast::Ident, ast::NodeId>;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::cell::RefCell;
use syntax::codemap::{self, Span};
use syntax::{ast, visit};
use syntax::ast::{Block, Item, FnDecl, NodeId, Arm, Pat, Stmt, Expr, Local};
use syntax::ast_util::{stmt_id};
use syntax::ast_util::stmt_id;
use syntax::ast_map;
use syntax::ptr::P;
use syntax::visit::{Visitor, FnKind};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use syntax::ast;
use syntax::codemap::Span;
use syntax::parse::token::special_idents;
use syntax::parse::token;
use syntax::print::pprust::{lifetime_to_string};
use syntax::print::pprust::lifetime_to_string;
use syntax::visit;
use syntax::visit::Visitor;
use util::nodemap::NodeMap;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use super::Normalized;
use super::SelectionContext;
use super::{ObligationCause};
use super::ObligationCause;
use super::PredicateObligation;
use super::project;
use super::util;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use middle::infer::{InferCtxt};
use middle::infer::InferCtxt;
use middle::ty::{self, RegionEscape, Ty};
use std::collections::HashSet;
use std::default::Default;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ use super::DerivedObligationCause;
use super::project;
use super::project::{normalize_with_depth, Normalized};
use super::{PredicateObligation, TraitObligation, ObligationCause};
use super::{report_overflow_error};
use super::report_overflow_error;
use super::{ObligationCauseCode, BuiltinDerivedObligation, ImplDerivedObligation};
use super::{SelectionError, Unimplemented, OutputTypeParameterMismatch};
use super::{Selection};
use super::{SelectionResult};
use super::Selection;
use super::SelectionResult;
use super::{VtableBuiltin, VtableImpl, VtableParam, VtableClosure,
VtableFnPointer, VtableObject, VtableDefaultImpl};
use super::{VtableImplData, VtableObjectData, VtableBuiltinData, VtableDefaultImplData};
use super::object_safety;
use super::{util};
use super::util;

use middle::fast_reject;
use middle::subst::{Subst, Substs, TypeSpace, VecPerParamSpace};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use util::ppaux::ty_to_string;
use util::ppaux::{Repr, UserString};
use util::common::{memoized, ErrorReported};
use util::nodemap::{NodeMap, NodeSet, DefIdMap, DefIdSet};
use util::nodemap::{FnvHashMap};
use util::nodemap::FnvHashMap;

use arena::TypedArena;
use std::borrow::{Borrow, Cow};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/plugin/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use session::Session;

use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT};
use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MacroRulesTT};
use syntax::ext::base::{MacroExpanderFn};
use syntax::ext::base::MacroExpanderFn;
use syntax::codemap::Span;
use syntax::parse::token;
use syntax::ptr::P;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/util/nodemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#![allow(non_snake_case)]

use std::collections::hash_state::{DefaultState};
use std::collections::hash_state::DefaultState;
use std::collections::{HashMap, HashSet};
use std::default::Default;
use std::hash::{Hasher, Hash};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use middle::ty::{mt, Ty, ParamTy};
use middle::ty::{ty_bool, ty_char, ty_struct, ty_enum};
use middle::ty::{ty_err, ty_str, ty_vec, ty_float, ty_bare_fn};
use middle::ty::{ty_param, ty_ptr, ty_rptr, ty_tup};
use middle::ty::{ty_closure};
use middle::ty::ty_closure;
use middle::ty::{ty_uniq, ty_trait, ty_int, ty_uint, ty_infer};
use middle::ty;
use middle::ty_fold::TypeFoldable;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_borrowck/borrowck/fragments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
use self::Fragment::*;

use borrowck::InteriorKind::{InteriorField, InteriorElement};
use borrowck::{LoanPath};
use borrowck::LoanPath;
use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
use borrowck::LoanPathElem::{LpDeref, LpInterior};
use borrowck::move_data::{InvalidMovePathIndex};
use borrowck::move_data::InvalidMovePathIndex;
use borrowck::move_data::{MoveData, MovePathIndex};
use rustc::middle::ty;
use rustc::middle::mem_categorization as mc;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/gather_loans/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use rustc::middle::expr_use_visitor as euv;
use rustc::middle::mem_categorization as mc;
use rustc::middle::region;
use rustc::middle::ty;
use rustc::util::ppaux::{Repr};
use rustc::util::ppaux::Repr;
use syntax::ast;
use syntax::codemap::Span;
use syntax::visit;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc::middle::cfg::graphviz as cfg_dot;
use borrowck;
use borrowck::{BorrowckCtxt, LoanPath};
use dot;
use rustc::middle::cfg::{CFGIndex};
use rustc::middle::cfg::CFGIndex;
use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
use rustc::middle::dataflow;
use std::rc::Rc;
Expand Down
Loading