Skip to content

Commit 109577a

Browse files
committed
---
yaml --- r: 217071 b: refs/heads/stable c: cce30b2 h: refs/heads/master i: 217069: ad364d4 217067: 206f9d1 217063: 6bfe552 217055: 8772481 v: v3
1 parent c45f40f commit 109577a

Some content is hidden

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

52 files changed

+185
-502
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 0a1a53d6933b53b804269ce236760847c5dd00fa
32+
refs/heads/stable: cce30b2ae659ac70b500f0bd1a2c7f71eeab0a41
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/configure

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ probe() {
106106
T=$(command -v $P 2>&1)
107107
if [ $? -eq 0 ]
108108
then
109-
VER0=$($P --version 2>/dev/null \
110-
| grep -o '[vV]\?[0-9][0-9.][a-z0-9.-]*' | head -1 )
109+
VER0=$($P --version 2>/dev/null | head -1 \
110+
| sed -e 's/[^0-9]*\([vV]\?[0-9.]\+[^ ]*\).*/\1/' )
111111
if [ $? -eq 0 -a "x${VER0}" != "x" ]
112112
then
113113
VER="($VER0)"
@@ -711,20 +711,6 @@ else
711711
probe_need CFG_GIT git
712712
fi
713713

714-
# Use `md5sum` on GNU platforms, or `md5 -q` on BSD
715-
probe CFG_MD5 md5
716-
probe CFG_MD5SUM md5sum
717-
if [ -n "$CFG_MD5" ]
718-
then
719-
CFG_HASH_COMMAND="$CFG_MD5 -q | head -c 8"
720-
elif [ -n "$CFG_MD5SUM" ]
721-
then
722-
CFG_HASH_COMMAND="$CFG_MD5SUM | head -c 8"
723-
else
724-
err 'could not find one of: md5 md5sum'
725-
fi
726-
putvar CFG_HASH_COMMAND
727-
728714
probe CFG_CLANG clang++
729715
probe CFG_CCACHE ccache
730716
probe CFG_GCC gcc

branches/stable/mk/main.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ CFG_RELEASE_NUM=1.1.0
2020
# versions (section 9)
2121
CFG_PRERELEASE_VERSION=.1
2222

23-
# Append a version-dependent hash to each library, so we can install different
24-
# versions in the same place
25-
CFG_FILENAME_EXTRA=$(shell printf '%s' $(CFG_RELEASE) | $(CFG_HASH_COMMAND))
23+
CFG_FILENAME_EXTRA=4e7c5e5c
2624

2725
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2826
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"

branches/stable/src/doc/reference.md

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,6 @@ vtable when the trait is used as a [trait object](#trait-objects).
13461346
Traits are implemented for specific types through separate
13471347
[implementations](#implementations).
13481348

1349-
Consider the following trait:
1350-
13511349
```
13521350
# type Surface = i32;
13531351
# type BoundingBox = i32;
@@ -1362,20 +1360,6 @@ This defines a trait with two methods. All values that have
13621360
`draw` and `bounding_box` methods called, using `value.bounding_box()`
13631361
[syntax](#method-call-expressions).
13641362

1365-
Traits can include default implementations of methods, as in:
1366-
1367-
```
1368-
trait Foo {
1369-
fn bar(&self);
1370-
1371-
fn baz(&self) { println!("We called baz."); }
1372-
}
1373-
```
1374-
1375-
Here the `baz` method has a default implementation, so types that implement
1376-
`Foo` need only implement `bar`. It is also possible for implementing types
1377-
to override a method that has a default implementation.
1378-
13791363
Type parameters can be specified for a trait to make it generic. These appear
13801364
after the trait name, using the same syntax used in [generic
13811365
functions](#generic-functions).
@@ -1388,35 +1372,6 @@ trait Seq<T> {
13881372
}
13891373
```
13901374

1391-
It is also possible to define associated types for a trait. Consider the
1392-
following example of a `Container` trait. Notice how the type is available
1393-
for use in the method signatures:
1394-
1395-
```
1396-
trait Container {
1397-
type E;
1398-
fn empty() -> Self;
1399-
fn insert(&mut self, Self::E);
1400-
}
1401-
```
1402-
1403-
In order for a type to implement this trait, it must not only provide
1404-
implementations for every method, but it must specify the type `E`. Here's
1405-
an implementation of `Container` for the standard library type `Vec`:
1406-
1407-
```
1408-
# trait Container {
1409-
# type E;
1410-
# fn empty() -> Self;
1411-
# fn insert(&mut self, Self::E);
1412-
# }
1413-
impl<T> Container for Vec<T> {
1414-
type E = T;
1415-
fn empty() -> Vec<T> { Vec::new() }
1416-
fn insert(&mut self, x: T) { self.push(x); }
1417-
}
1418-
```
1419-
14201375
Generic functions may use traits as _bounds_ on their type parameters. This
14211376
will have two effects: only types that have the trait may instantiate the
14221377
parameter, and within the generic function, the methods of the trait can be
@@ -3515,21 +3470,13 @@ more of the closure traits:
35153470

35163471
### Trait objects
35173472

3518-
In Rust, a type like `&SomeTrait` or `Box<SomeTrait>` is called a _trait object_.
3519-
Each instance of a trait object includes:
3520-
3521-
- a pointer to an instance of a type `T` that implements `SomeTrait`
3522-
- a _virtual method table_, often just called a _vtable_, which contains, for
3523-
each method of `SomeTrait` that `T` implements, a pointer to `T`'s
3524-
implementation (i.e. a function pointer).
3525-
3526-
The purpose of trait objects is to permit "late binding" of methods. A call to
3527-
a method on a trait object is only resolved to a vtable entry at compile time.
3528-
The actual implementation for each vtable entry can vary on an object-by-object
3529-
basis.
3530-
3531-
Note that for a trait object to be instantiated, the trait must be
3532-
_object-safe_. Object safety rules are defined in [RFC 255][rfc255].
3473+
Every trait item (see [traits](#traits)) defines a type with the same name as
3474+
the trait. This type is called the _trait object_ of the trait. Trait objects
3475+
permit "late binding" of methods, dispatched using _virtual method tables_
3476+
("vtables"). Whereas most calls to trait methods are "early bound" (statically
3477+
resolved) to specific implementations at compile time, a call to a method on an
3478+
trait objects is only resolved to a vtable entry at compile time. The actual
3479+
implementation for each vtable entry can vary on an object-by-object basis.
35333480

35343481
Given a pointer-typed expression `E` of type `&T` or `Box<T>`, where `T`
35353482
implements trait `R`, casting `E` to the corresponding pointer type `&R` or

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ data, we call the `clone()` method. In this example, `y` is no longer a referenc
175175
to the vector stored in `x`, but a copy of its first element, `"Hello"`. Now
176176
that we don’t have a reference, our `push()` works just fine.
177177

178-
[move]: ownership.html#move-semantics
178+
[move]: move-semantics.html
179179

180180
If we truly want a reference, we need the other option: ensure that our reference
181181
goes out of scope before we try to do the mutation. That looks like this:

branches/stable/src/doc/trpl/dining-philosophers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ which blocks execution until the thread has completed execution. This ensures
450450
that the threads complete their work before the program exits.
451451

452452
If you run this program, you’ll see that the philosophers eat out of order!
453-
We have multi-threading!
453+
We have mult-threading!
454454

455455
```text
456456
Gilles Deleuze is eating.

branches/stable/src/doc/trpl/error-handling.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ match version {
181181
This function makes use of an enum, `ParseError`, to enumerate the various
182182
errors that can occur.
183183

184-
The [`Debug`](../std/fmt/trait.Debug.html) trait is what lets us print the enum value using the `{:?}` format operation.
185-
186184
# Non-recoverable errors with `panic!`
187185

188186
In the case of an error that is unexpected and not recoverable, the `panic!`

branches/stable/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Rust programs use [jemalloc][jemalloc] for this purpose.
266266
Anyway, back to our example. Since this memory is on the heap, it can stay
267267
alive longer than the function which allocates the box. In this case, however,
268268
it doesn’t.[^moving] When the function is over, we need to free the stack frame
269-
for `main()`. `Box<T>`, though, has a trick up its sleeve: [Drop][drop]. The
269+
for `main()`. `Box<T>`, though, has a trick up its sleve: [Drop][drop]. The
270270
implementation of `Drop` for `Box` deallocates the memory that was allocated
271271
when it was created. Great! So when `x` goes away, it first frees the memory
272272
allocated on the heap:

branches/stable/src/libcollections/vec.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,39 @@
1818
//! You can explicitly create a `Vec<T>` with `new()`:
1919
//!
2020
//! ```
21-
//! let v: Vec<i32> = Vec::new();
21+
//! let xs: Vec<i32> = Vec::new();
2222
//! ```
2323
//!
2424
//! ...or by using the `vec!` macro:
2525
//!
2626
//! ```
27-
//! let v: Vec<i32> = vec![];
27+
//! let ys: Vec<i32> = vec![];
2828
//!
29-
//! let v = vec![1, 2, 3, 4, 5];
30-
//!
31-
//! let v = vec![0; 10]; // ten zeroes
29+
//! let zs = vec![1i32, 2, 3, 4, 5];
3230
//! ```
3331
//!
3432
//! You can `push` values onto the end of a vector (which will grow the vector as needed):
3533
//!
3634
//! ```
37-
//! let mut v = vec![1, 2];
35+
//! let mut xs = vec![1i32, 2];
3836
//!
39-
//! v.push(3);
37+
//! xs.push(3);
4038
//! ```
4139
//!
4240
//! Popping values works in much the same way:
4341
//!
4442
//! ```
45-
//! let mut v = vec![1, 2];
43+
//! let mut xs = vec![1i32, 2];
4644
//!
47-
//! let two = v.pop();
45+
//! let two = xs.pop();
4846
//! ```
4947
//!
5048
//! Vectors also support indexing (through the `Index` and `IndexMut` traits):
5149
//!
5250
//! ```
53-
//! let mut v = vec![1, 2, 3];
54-
//! let three = v[2];
55-
//! v[1] = v[1] + 5;
51+
//! let mut xs = vec![1i32, 2, 3];
52+
//! let three = xs[2];
53+
//! xs[1] = xs[1] + 5;
5654
//! ```
5755
5856
#![stable(feature = "rust1", since = "1.0.0")]

branches/stable/src/libcore/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ macro_rules! try {
167167
})
168168
}
169169

170-
/// Use the `format!` syntax to write data into a buffer of type `&mut Write`.
170+
/// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
171171
/// See `std::fmt` for more information.
172172
///
173173
/// # Examples

branches/stable/src/librustc/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ be taken.
427427

428428
E0271: r##"
429429
This is because of a type mismatch between the associated type of some
430-
trait (e.g. `T::Bar`, where `T` implements `trait Quux { type Bar; }`)
431-
and another type `U` that is required to be equal to `T::Bar`, but is not.
430+
trait (e.g. T::Bar, where T implements trait Quux { type Bar; })
431+
and another type U that is required to be equal to T::Bar, but is not.
432432
Examples follow.
433433
434434
Here is a basic example:

branches/stable/src/librustc_back/archive.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -306,21 +306,6 @@ impl<'a> ArchiveBuilder<'a> {
306306
if filename.contains(".SYMDEF") { continue }
307307
if skip(filename) { continue }
308308

309-
// Archives on unix systems typically do not have slashes in
310-
// filenames as the `ar` utility generally only uses the last
311-
// component of a path for the filename list in the archive. On
312-
// Windows, however, archives assembled with `lib.exe` will preserve
313-
// the full path to the file that was placed in the archive,
314-
// including path separators.
315-
//
316-
// The code below is munging paths so it'll go wrong pretty quickly
317-
// if there's some unexpected slashes in the filename, so here we
318-
// just chop off everything but the filename component. Note that
319-
// this can cause duplicate filenames, but that's also handled below
320-
// as well.
321-
let filename = Path::new(filename).file_name().unwrap()
322-
.to_str().unwrap();
323-
324309
// An archive can contain files of the same name multiple times, so
325310
// we need to be sure to not have them overwrite one another when we
326311
// extract them. Consequently we need to find a truly unique file

branches/stable/src/librustc_resolve/diagnostics.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Imports (`use` statements) are not allowed after non-item statements, such as
2020
variable declarations and expression statements.
2121
2222
Here is an example that demonstrates the error:
23-
2423
```
2524
fn f() {
2625
// Variable declaration before import
@@ -34,7 +33,6 @@ The solution is to declare the imports at the top of the block, function, or
3433
file.
3534
3635
Here is the previous example again, with the correct order:
37-
3836
```
3937
fn f() {
4038
use std::io::Read;
@@ -54,7 +52,6 @@ The name chosen for an external crate conflicts with another external crate that
5452
has been imported into the current module.
5553
5654
Wrong example:
57-
5855
```
5956
extern crate a;
6057
extern crate crate_a as a;
@@ -64,7 +61,6 @@ The solution is to choose a different name that doesn't conflict with any
6461
external crate imported into the current module.
6562
6663
Correct example:
67-
6864
```
6965
extern crate a;
7066
extern crate crate_a as other_name;
@@ -75,7 +71,6 @@ E0260: r##"
7571
The name for an item declaration conflicts with an external crate's name.
7672
7773
For instance,
78-
7974
```
8075
extern crate abc;
8176

branches/stable/src/librustc_resolve/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,18 +2528,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
25282528
// If anything ends up here entirely resolved,
25292529
// it's an error. If anything ends up here
25302530
// partially resolved, that's OK, because it may
2531-
// be a `T::CONST` that typeck will resolve.
2531+
// be a `T::CONST` that typeck will resolve to
2532+
// an inherent impl.
25322533
if path_res.depth == 0 {
25332534
self.resolve_error(
25342535
path.span,
25352536
&format!("`{}` is not an enum variant, struct or const",
25362537
token::get_ident(
25372538
path.segments.last().unwrap().identifier)));
25382539
} else {
2539-
let const_name = path.segments.last().unwrap()
2540-
.identifier.name;
2541-
let traits = self.get_traits_containing_item(const_name);
2542-
self.trait_map.insert(pattern.id, traits);
25432540
self.record_def(pattern.id, path_res);
25442541
}
25452542
}

0 commit comments

Comments
 (0)