Skip to content

Commit d63a7d6

Browse files
committed
---
yaml --- r: 235287 b: refs/heads/stable c: 5b6a464 h: refs/heads/master i: 235285: 7b52bf4 235283: 426cb19 235279: 9fb1eeb v: v3
1 parent c13af72 commit d63a7d6

Some content is hidden

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

54 files changed

+422
-1023
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 517e087c16749086a3a0fec453af3d1c53232605
32+
refs/heads/stable: 5b6a4643583c2b580b9a57f48dd94ba5d7824765
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/compiletest/runtest.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,11 +1702,8 @@ fn run_codegen_test(config: &Config, props: &TestProps, testfile: &Path) {
17021702
}
17031703

17041704
fn charset() -> &'static str {
1705-
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
1706-
if cfg!(target_os = "bitrig") {
1705+
if cfg!(any(target_os = "bitrig", target_os = "freebsd")) {
17071706
"auto"
1708-
} else if cfg!(target_os = "freebsd") {
1709-
"ISO-8859-1"
17101707
} else {
17111708
"UTF-8"
17121709
}

branches/stable/src/doc/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Second, it makes cost explicit. In general, the only safe way to have a
9999
non-exhaustive match would be to panic the thread if nothing is matched, though
100100
it could fall through if the type of the `match` expression is `()`. This sort
101101
of hidden cost and special casing is against the language's philosophy. It's
102-
easy to ignore all unspecified cases by using the `_` wildcard:
102+
easy to ignore certain cases by using the `_` wildcard:
103103

104104
```rust,ignore
105105
match val.do_something() {

branches/stable/src/doc/trpl/concurrency.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ system is up to the task, and gives you powerful ways to reason about
1010
concurrent code at compile time.
1111

1212
Before we talk about the concurrency features that come with Rust, it's important
13-
to understand something: Rust is low-level enough that the vast majority of
14-
this is provided by the standard library, not by the language. This means that
15-
if you don't like some aspect of the way Rust handles concurrency, you can
16-
implement an alternative way of doing things.
17-
[mio](https://github.com/carllerche/mio) is a real-world example of this
18-
principle in action.
13+
to understand something: Rust is low-level enough that all of this is provided
14+
by the standard library, not by the language. This means that if you don't like
15+
some aspect of the way Rust handles concurrency, you can implement an alternative
16+
way of doing things. [mio](https://github.com/carllerche/mio) is a real-world
17+
example of this principle in action.
1918

2019
## Background: `Send` and `Sync`
2120

branches/stable/src/doc/trpl/guessing-game.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,10 @@ rand="0.3.0"
360360
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
361361
everything that follows it is part of it, until the next section starts.
362362
Cargo uses the dependencies section to know what dependencies on external
363-
crates you have, and what versions you require. In this case, we’ve specified version `0.3.0`,
364-
which Cargo understands to be any release that’s compatible with this specific version.
363+
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
365364
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
366-
numbers. If we wanted to use only `0.3.0` exactly, we could use `=0.3.0`. If we
367-
wanted to use the latest version we could use `*`; We could use a range of
368-
versions. [Cargo’s documentation][cargodoc] contains more details.
365+
numbers. If we wanted to use the latest version we could use `*` or we could use a range
366+
of versions. [Cargo’s documentation][cargodoc] contains more details.
369367

370368
[semver]: http://semver.org
371369
[cargodoc]: http://doc.crates.io/crates-io.html

branches/stable/src/doc/trpl/lifetimes.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ the lifetime `'a` has snuck in between the `&` and the `mut i32`. We read `&mut
101101
i32` as ‘a mutable reference to an i32’ and `&'a mut i32` as ‘a mutable
102102
reference to an `i32` with the lifetime `'a`’.
103103

104-
# In `struct`s
105-
106104
You’ll also need explicit lifetimes when working with [`struct`][structs]s:
107105

108106
```rust
@@ -139,33 +137,6 @@ x: &'a i32,
139137
uses it. So why do we need a lifetime here? We need to ensure that any reference
140138
to a `Foo` cannot outlive the reference to an `i32` it contains.
141139

142-
## `impl` blocks
143-
144-
Let’s implement a method on `Foo`:
145-
146-
```rust
147-
struct Foo<'a> {
148-
x: &'a i32,
149-
}
150-
151-
impl<'a> Foo<'a> {
152-
fn x(&self) -> &'a i32 { self.x }
153-
}
154-
155-
fn main() {
156-
let y = &5; // this is the same as `let _y = 5; let y = &_y;`
157-
let f = Foo { x: y };
158-
159-
println!("x is: {}", f.x());
160-
}
161-
```
162-
163-
As you can see, we need to declare a lifetime for `Foo` in the `impl` line. We repeat
164-
`'a` twice, just like on functions: `impl<'a>` defines a lifetime `'a`, and `Foo<'a>`
165-
uses it.
166-
167-
## Multiple lifetimes
168-
169140
If you have multiple references, you can use the same lifetime multiple times:
170141

171142
```rust

branches/stable/src/doc/trpl/unsafe.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ this, Rust has a keyword, `unsafe`. Code using `unsafe` has less restrictions
88
than normal code does.
99

1010
Let’s go over the syntax, and then we’ll talk semantics. `unsafe` is used in
11-
four contexts. The first one is to mark a function as unsafe:
11+
two contexts. The first one is to mark a function as unsafe:
1212

1313
```rust
1414
unsafe fn danger_will_robinson() {
@@ -27,40 +27,15 @@ unsafe {
2727
}
2828
```
2929

30-
The third is for unsafe traits:
31-
32-
```rust
33-
unsafe trait Scary { }
34-
```
35-
36-
And the fourth is for `impl`ementing one of those traits:
37-
38-
```rust
39-
# unsafe trait Scary { }
40-
unsafe impl Scary for i32 {}
41-
```
42-
4330
It’s important to be able to explicitly delineate code that may have bugs that
4431
cause big problems. If a Rust program segfaults, you can be sure it’s somewhere
4532
in the sections marked `unsafe`.
4633

4734
# What does ‘safe’ mean?
4835

49-
Safe, in the context of Rust, means ‘doesn’t do anything unsafe’. It’s also
50-
important to know that there are certain behaviors that are probably not
51-
desirable in your code, but are expressly _not_ unsafe:
36+
Safe, in the context of Rust, means “doesn’t do anything unsafe.” Easy!
5237

53-
* Deadlocks
54-
* Leaks of memory or other resources
55-
* Exiting without calling destructors
56-
* Integer overflow
57-
58-
Rust cannot prevent all kinds of software problems. Buggy code can and will be
59-
written in Rust. These things aren’t great, but they don’t qualify as `unsafe`
60-
specifically.
61-
62-
In addition, the following are all undefined behaviors in Rust, and must be
63-
avoided, even when writing `unsafe` code:
38+
Okay, let’s try again: what is not safe to do? Here’s a list:
6439

6540
* Data races
6641
* Dereferencing a null/dangling raw pointer
@@ -89,6 +64,18 @@ avoided, even when writing `unsafe` code:
8964
[undef]: http://llvm.org/docs/LangRef.html#undefined-values
9065
[aliasing]: http://llvm.org/docs/LangRef.html#pointer-aliasing-rules
9166

67+
Whew! That’s a bunch of stuff. It’s also important to notice all kinds of
68+
behaviors that are certainly bad, but are expressly _not_ unsafe:
69+
70+
* Deadlocks
71+
* Leaks of memory or other resources
72+
* Exiting without calling destructors
73+
* Integer overflow
74+
75+
Rust cannot prevent all kinds of software problems. Buggy code can and will be
76+
written in Rust. These things aren’t great, but they don’t qualify as `unsafe`
77+
specifically.
78+
9279
# Unsafe Superpowers
9380

9481
In both unsafe functions and unsafe blocks, Rust will let you do three things

branches/stable/src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,4 @@ pub fn oom() -> ! {
148148
// optimize it out).
149149
#[doc(hidden)]
150150
#[unstable(feature = "issue_14344_fixme")]
151-
#[cfg(stage0)]
152151
pub fn fixme_14344_be_sure_to_link_to_collections() {}

branches/stable/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ pub mod btree_set {
138138
// FIXME(#14344) this shouldn't be necessary
139139
#[doc(hidden)]
140140
#[unstable(feature = "issue_14344_fixme")]
141-
#[cfg(stage0)]
142141
pub fn fixme_14344_be_sure_to_link_to_collections() {}
143142

144143
#[cfg(not(test))]

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

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ impl<'a> Display for Arguments<'a> {
273273
///
274274
/// Generally speaking, you should just `derive` a `Debug` implementation.
275275
///
276-
/// When used with the alternate format specifier `#?`, the output is pretty-printed.
277-
///
278276
/// For more information on formatters, see [the module-level documentation][module].
279277
///
280278
/// [module]: ../index.html
@@ -316,42 +314,13 @@ impl<'a> Display for Arguments<'a> {
316314
/// println!("The origin is: {:?}", origin);
317315
/// ```
318316
///
319-
/// This outputs:
320-
///
321-
/// ```text
322-
/// The origin is: Point { x: 0, y: 0 }
323-
/// ```
324-
///
325317
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
326318
/// implementations, such as [`debug_struct`][debug_struct].
327319
///
328320
/// `Debug` implementations using either `derive` or the debug builder API
329321
/// on `Formatter` support pretty printing using the alternate flag: `{:#?}`.
330322
///
331323
/// [debug_struct]: ../std/fmt/struct.Formatter.html#method.debug_struct
332-
///
333-
/// Pretty printing with `#?`:
334-
///
335-
/// ```
336-
/// #[derive(Debug)]
337-
/// struct Point {
338-
/// x: i32,
339-
/// y: i32,
340-
/// }
341-
///
342-
/// let origin = Point { x: 0, y: 0 };
343-
///
344-
/// println!("The origin is: {:#?}", origin);
345-
/// ```
346-
///
347-
/// This outputs:
348-
///
349-
/// ```text
350-
/// The origin is: Point {
351-
/// x: 0,
352-
/// y: 0
353-
/// }
354-
/// ```
355324
#[stable(feature = "rust1", since = "1.0.0")]
356325
#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \
357326
defined in your crate, add `#[derive(Debug)]` or \
@@ -410,8 +379,6 @@ pub trait Display {
410379
///
411380
/// The `Octal` trait should format its output as a number in base-8.
412381
///
413-
/// The alternate flag, `#`, adds a `0o` in front of the output.
414-
///
415382
/// For more information on formatters, see [the module-level documentation][module].
416383
///
417384
/// [module]: ../index.html
@@ -424,7 +391,6 @@ pub trait Display {
424391
/// let x = 42; // 42 is '52' in octal
425392
///
426393
/// assert_eq!(format!("{:o}", x), "52");
427-
/// assert_eq!(format!("{:#o}", x), "0o52");
428394
/// ```
429395
///
430396
/// Implementing `Octal` on a type:
@@ -457,8 +423,6 @@ pub trait Octal {
457423
///
458424
/// The `Binary` trait should format its output as a number in binary.
459425
///
460-
/// The alternate flag, `#`, adds a `0b` in front of the output.
461-
///
462426
/// For more information on formatters, see [the module-level documentation][module].
463427
///
464428
/// [module]: ../index.html
@@ -471,7 +435,6 @@ pub trait Octal {
471435
/// let x = 42; // 42 is '101010' in binary
472436
///
473437
/// assert_eq!(format!("{:b}", x), "101010");
474-
/// assert_eq!(format!("{:#b}", x), "0b101010");
475438
/// ```
476439
///
477440
/// Implementing `Binary` on a type:
@@ -505,8 +468,6 @@ pub trait Binary {
505468
/// The `LowerHex` trait should format its output as a number in hexidecimal, with `a` through `f`
506469
/// in lower case.
507470
///
508-
/// The alternate flag, `#`, adds a `0x` in front of the output.
509-
///
510471
/// For more information on formatters, see [the module-level documentation][module].
511472
///
512473
/// [module]: ../index.html
@@ -519,7 +480,6 @@ pub trait Binary {
519480
/// let x = 42; // 42 is '2a' in hex
520481
///
521482
/// assert_eq!(format!("{:x}", x), "2a");
522-
/// assert_eq!(format!("{:#x}", x), "0x2a");
523483
/// ```
524484
///
525485
/// Implementing `LowerHex` on a type:
@@ -553,8 +513,6 @@ pub trait LowerHex {
553513
/// The `UpperHex` trait should format its output as a number in hexidecimal, with `A` through `F`
554514
/// in upper case.
555515
///
556-
/// The alternate flag, `#`, adds a `0x` in front of the output.
557-
///
558516
/// For more information on formatters, see [the module-level documentation][module].
559517
///
560518
/// [module]: ../index.html
@@ -567,7 +525,6 @@ pub trait LowerHex {
567525
/// let x = 42; // 42 is '2A' in hex
568526
///
569527
/// assert_eq!(format!("{:X}", x), "2A");
570-
/// assert_eq!(format!("{:#X}", x), "0x2A");
571528
/// ```
572529
///
573530
/// Implementing `UpperHex` on a type:

branches/stable/src/libcore/num/wrapping.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,6 @@ macro_rules! wrapping_impl {
119119
}
120120
}
121121

122-
#[stable(feature = "wrapping_div", since = "1.3.0")]
123-
impl Div for Wrapping<$t> {
124-
type Output = Wrapping<$t>;
125-
126-
#[inline(always)]
127-
fn div(self, other: Wrapping<$t>) -> Wrapping<$t> {
128-
Wrapping(self.0.wrapping_div(other.0))
129-
}
130-
}
131-
132122
#[stable(feature = "rust1", since = "1.0.0")]
133123
impl Not for Wrapping<$t> {
134124
type Output = Wrapping<$t>;

branches/stable/src/libcore/slice.rs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,14 +1368,10 @@ pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
13681368
///
13691369
/// The `len` argument is the number of **elements**, not the number of bytes.
13701370
///
1371-
/// # Unsafety
1372-
///
13731371
/// This function is unsafe as there is no guarantee that the given pointer is
13741372
/// valid for `len` elements, nor whether the lifetime inferred is a suitable
13751373
/// lifetime for the returned slice.
13761374
///
1377-
/// `p` must be non-null, even for zero-length slices.
1378-
///
13791375
/// # Caveat
13801376
///
13811377
/// The lifetime for the returned slice is inferred from its usage. To
@@ -1463,30 +1459,12 @@ pub mod bytes {
14631459
#[stable(feature = "rust1", since = "1.0.0")]
14641460
impl<A, B> PartialEq<[B]> for [A] where A: PartialEq<B> {
14651461
fn eq(&self, other: &[B]) -> bool {
1466-
if self.len() != other.len() {
1467-
return false;
1468-
}
1469-
1470-
for i in 0..self.len() {
1471-
if !self[i].eq(&other[i]) {
1472-
return false;
1473-
}
1474-
}
1475-
1476-
true
1462+
self.len() == other.len() &&
1463+
order::eq(self.iter(), other.iter())
14771464
}
14781465
fn ne(&self, other: &[B]) -> bool {
1479-
if self.len() != other.len() {
1480-
return true;
1481-
}
1482-
1483-
for i in 0..self.len() {
1484-
if self[i].ne(&other[i]) {
1485-
return true;
1486-
}
1487-
}
1488-
1489-
false
1466+
self.len() != other.len() ||
1467+
order::ne(self.iter(), other.iter())
14901468
}
14911469
}
14921470

branches/stable/src/liblibc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6431,7 +6431,6 @@ pub mod funcs {
64316431
}
64326432

64336433
#[doc(hidden)]
6434-
#[cfg(stage0)]
64356434
pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
64366435

64376436
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

0 commit comments

Comments
 (0)