Skip to content

Commit 3e7385a

Browse files
committed
Auto merge of #23806 - Manishearth:rollup, r=Manishearth
- Successful merges: #23332, #23751, #23788, #23803, #23804 - Failed merges:
2 parents f8b6e28 + 95f4061 commit 3e7385a

Some content is hidden

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

75 files changed

+103
-102
lines changed

src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Linux or a Mac, all you need to do is this (note that you don't need to type
66
in the `$`s, they just indicate the start of each command):
77

88
```bash
9-
$ curl -L https://static.rust-lang.org/rustup.sh | sudo sh
9+
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
1010
```
1111

1212
If you're concerned about the [potential insecurity](http://curlpipesh.tumblr.com/) of using `curl | sudo sh`,
1313
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:
1414

1515
```bash
16-
$ curl -L https://static.rust-lang.org/rustup.sh -O
16+
$ curl -f -L https://static.rust-lang.org/rustup.sh -O
1717
$ sudo sh rustup.sh
1818
```
1919

src/doc/trpl/method-syntax.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ You can think of this first parameter as being the `x` in `x.foo()`. The three
5151
variants correspond to the three kinds of thing `x` could be: `self` if it's
5252
just a value on the stack, `&self` if it's a reference, and `&mut self` if it's
5353
a mutable reference. We should default to using `&self`, as it's the most
54-
common. Here's an example of all three variants:
54+
common, as Rustaceans prefer borrowing over taking ownership, and references
55+
over mutable references. Here's an example of all three variants:
5556

5657
```rust
5758
struct Circle {
@@ -100,16 +101,16 @@ impl Circle {
100101
std::f64::consts::PI * (self.radius * self.radius)
101102
}
102103
103-
fn grow(&self) -> Circle {
104-
Circle { x: self.x, y: self.y, radius: (self.radius * 10.0) }
104+
fn grow(&self, increment: f64) -> Circle {
105+
Circle { x: self.x, y: self.y, radius: self.radius + increment }
105106
}
106107
}
107108
108109
fn main() {
109110
let c = Circle { x: 0.0, y: 0.0, radius: 2.0 };
110111
println!("{}", c.area());
111112
112-
let d = c.grow().area();
113+
let d = c.grow(2.0).area();
113114
println!("{}", d);
114115
}
115116
```
@@ -124,7 +125,7 @@ fn grow(&self) -> Circle {
124125
```
125126

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

129130
## Static methods
130131

src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl Foo for OverrideDefault {
479479
}
480480

481481
let default = UseDefault;
482-
default.baz(); // prints "We called bar."
482+
default.baz(); // prints "We called baz."
483483

484484
let over = OverrideDefault;
485485
over.baz(); // prints "Override baz!"

src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ use core::prelude::*;
7676
use core::atomic;
7777
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7878
use core::fmt;
79-
use core::cmp::{Ordering};
79+
use core::cmp::Ordering;
8080
use core::default::Default;
8181
use core::mem::{min_align_of, size_of};
8282
use core::mem;

src/libcollections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::default::Default;
2424
use core::fmt::Debug;
2525
use core::hash::{Hash, Hasher};
2626
use core::iter::{Map, FromIterator, IntoIterator};
27-
use core::ops::{Index};
27+
use core::ops::Index;
2828
use core::{iter, fmt, mem, usize};
2929
use Bound::{self, Included, Excluded, Unbounded};
3030

src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use core::prelude::*;
5252
use alloc::boxed::Box;
5353
use alloc::heap::{EMPTY, allocate, reallocate, deallocate};
5454
use core::cmp::max;
55-
use core::cmp::{Ordering};
55+
use core::cmp::Ordering;
5656
use core::default::Default;
5757
use core::fmt;
5858
use core::hash::{self, Hash};

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ use self::Option::*;
148148
use clone::Clone;
149149
use cmp::{Eq, Ord};
150150
use default::Default;
151-
use iter::{ExactSizeIterator};
151+
use iter::ExactSizeIterator;
152152
use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, IntoIterator};
153153
use mem;
154154
use ops::FnOnce;

src/librand/distributions/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
// this is surprisingly complicated to be both generic & correct
1414

15-
use core::prelude::{PartialOrd};
15+
use core::prelude::PartialOrd;
1616
use core::num::Int;
1717
use core::num::wrapping::WrappingOps;
1818

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use metadata::cstore;
2222
use metadata::decoder;
2323
use metadata::tyencode;
2424
use middle::def;
25-
use middle::ty::{lookup_item_type};
25+
use middle::ty::lookup_item_type;
2626
use middle::ty::{self, Ty};
2727
use middle::stability;
2828
use util::nodemap::{FnvHashMap, NodeMap, NodeSet};

src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
//! no means all of the necessary details. Take a look at the rest of
213213
//! metadata::loader or metadata::creader for all the juicy details!
214214
215-
use back::archive::{METADATA_FILENAME};
215+
use back::archive::METADATA_FILENAME;
216216
use back::svh::Svh;
217217
use session::Session;
218218
use session::search_paths::PathKind;

0 commit comments

Comments
 (0)