Skip to content

Commit e55a1f7

Browse files
committed
---
yaml --- r: 195381 b: refs/heads/snap-stage3 c: b77a09c h: refs/heads/master i: 195379: 4e5bef3 v: v3
1 parent 22ff97a commit e55a1f7

Some content is hidden

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

76 files changed

+689
-858
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 14192d6df5cc714e5c9a3ca70b08f2514d977be2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 403859322821d94748ff5aa09850939fb4fc5b72
4+
refs/heads/snap-stage3: b77a09c17e55e62bb5d7b2ce7ad5a138a77cba74
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ case $CFG_OSTYPE in
404404
CFG_OSTYPE=pc-windows-gnu
405405
;;
406406

407-
# Thad's Cygwin identifiers below
407+
# Thad's Cygwin identifers below
408408

409409
# Vista 32 bit
410410
CYGWIN_NT-6.0)
@@ -526,8 +526,7 @@ VAL_OPTIONS=""
526526
opt valgrind 0 "run tests with valgrind (memcheck by default)"
527527
opt helgrind 0 "run tests with helgrind instead of memcheck"
528528
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
529-
opt docs 1 "build standard library documentation"
530-
opt compiler-docs 0 "build compiler documentation"
529+
opt docs 1 "build documentation"
531530
opt optimize 1 "build optimized rust code"
532531
opt optimize-cxx 1 "build optimized C++ code"
533532
opt optimize-llvm 1 "build optimized LLVM"

branches/snap-stage3/mk/crates.mk

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -122,29 +122,17 @@ ONLY_RLIB_rustc_bitflags := 1
122122
# You should not need to edit below this line
123123
################################################################################
124124

125-
# On channels where the only usable crate is std, only build documentation for
126-
# std. This keeps distributions small and doesn't clutter up the API docs with
127-
# confusing internal details from the crates behind the facade.
128-
129-
ifeq ($(CFG_RELEASE_CHANNEL),stable)
130-
DOC_CRATES := std
131-
else
132-
ifeq ($(CFG_RELEASE_CHANNEL),beta)
133-
DOC_CRATES := std
134-
else
135125
DOC_CRATES := $(filter-out rustc, \
136-
$(filter-out rustc_trans, \
137-
$(filter-out rustc_typeck, \
138-
$(filter-out rustc_borrowck, \
139-
$(filter-out rustc_resolve, \
140-
$(filter-out rustc_driver, \
141-
$(filter-out rustc_privacy, \
142-
$(filter-out rustc_lint, \
143-
$(filter-out log, \
144-
$(filter-out getopts, \
145-
$(filter-out syntax, $(CRATES))))))))))))
146-
endif
147-
endif
126+
$(filter-out rustc_trans, \
127+
$(filter-out rustc_typeck, \
128+
$(filter-out rustc_borrowck, \
129+
$(filter-out rustc_resolve, \
130+
$(filter-out rustc_driver, \
131+
$(filter-out rustc_privacy, \
132+
$(filter-out rustc_lint, \
133+
$(filter-out log, \
134+
$(filter-out getopts, \
135+
$(filter-out syntax, $(CRATES))))))))))))
148136
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
149137
rustc_typeck rustc_driver syntax rustc_privacy \
150138
rustc_lint

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,7 @@ doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
259259
endef
260260

261261
$(foreach crate,$(DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),DOC_TARGETS)))
262-
263-
ifdef CFG_COMPILER_DOCS
264-
$(foreach crate,$(COMPILER_DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),COMPILER_DOC_TARGETS)))
265-
endif
262+
$(foreach crate,$(COMPILER_DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),COMPILER_DOC_TARGETS)))
266263

267264
ifdef CFG_DISABLE_DOCS
268265
$(info cfg: disabling doc build (CFG_DISABLE_DOCS))

branches/snap-stage3/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ define CFG_MAKE_TOOLCHAIN
179179

180180
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)
181181

182-
# On Bitrig, we need the relocation model to be PIC for everything
182+
# On Bitrig, we need the relocation model to be PIC for everthing
183183
ifeq (,$(filter $(OSTYPE_$(1)),bitrig))
184184
LLVM_MC_RELOCATION_MODEL="pic"
185185
else

branches/snap-stage3/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ endef
132132
# on $$(TSREQ$(1)_T_$(2)_H_$(3)), to ensure that no products will be
133133
# put into the target area until after the get-snapshot.py script has
134134
# had its chance to clean it out; otherwise the other products will be
135-
# inadvertently included in the clean out.
135+
# inadvertantly included in the clean out.
136136
SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD))
137137

138138
define TARGET_HOST_RULES

branches/snap-stage3/src/doc/reference.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,15 +1188,12 @@ the guarantee that these issues are never caused by safe code.
11881188

11891189
* Data races
11901190
* Dereferencing a null/dangling raw pointer
1191+
* Mutating an immutable value/reference without `UnsafeCell`
11911192
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values)
11921193
(uninitialized) memory
11931194
* Breaking the [pointer aliasing
11941195
rules](http://llvm.org/docs/LangRef.html#pointer-aliasing-rules)
11951196
with raw pointers (a subset of the rules used by C)
1196-
* `&mut` and `&` follow LLVM’s scoped [noalias] model, except if the `&T`
1197-
contains an `UnsafeCell<U>`. Unsafe code must not violate these aliasing
1198-
guarantees.
1199-
* Mutating an immutable value/reference without `UnsafeCell<U>`
12001197
* Invoking undefined behavior via compiler intrinsics:
12011198
* Indexing outside of the bounds of an object with `std::ptr::offset`
12021199
(`offset` intrinsic), with
@@ -1213,8 +1210,6 @@ the guarantee that these issues are never caused by safe code.
12131210
code. Rust's failure system is not compatible with exception handling in
12141211
other languages. Unwinding must be caught and handled at FFI boundaries.
12151212

1216-
[noalias]: http://llvm.org/docs/LangRef.html#noalias
1217-
12181213
##### Behaviour not considered unsafe
12191214

12201215
This is a list of behaviour not considered *unsafe* in Rust terms, but that may

branches/snap-stage3/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,5 @@ You can also take a slice of a vector, `String`, or `&str`, because they are
9999
backed by arrays. Slices have type `&[T]`, which we'll talk about when we cover
100100
generics.
101101

102-
We have now learned all of the most basic Rust concepts.
102+
We have now learned all of the most basic Rust concepts. Next, we learn how to
103+
get input from the keyboard.

branches/snap-stage3/src/doc/trpl/associated-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ let obj = Box::new(graph) as Box<Graph>;
170170
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171171
```
172172

173-
We can’t create a trait object like this, because we don’t know the associated
173+
We can’t create a trait object like this, becuase we don’t know the associated
174174
types. Instead, we can write this:
175175

176176
```rust

branches/snap-stage3/src/doc/trpl/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ This will create documentation for bar both inside the documentation for the
529529
crate `foo`, as well as the documentation for your crate. It will use the same
530530
documentation in both places.
531531

532-
This behavior can be suppressed with `no_inline`:
532+
This behavior can be supressed with `no_inline`:
533533

534534
```ignore
535535
extern crate foo;

branches/snap-stage3/src/doc/trpl/method-syntax.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ parameter, of which there are three variants: `self`, `&self`, and `&mut self`.
5050
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
53-
a mutable reference. We should default to using `&self`, as you should prefer
54-
borrowing over taking ownership, as well as taking immutable references
55-
over mutable ones. Here's an example of all three variants:
53+
a mutable reference. We should default to using `&self`, as it's the most
54+
common, as Rustaceans prefer borrowing over taking ownership, and references
55+
over mutable references. Here's an example of all three variants:
5656

5757
```rust
5858
struct Circle {

branches/snap-stage3/src/doc/trpl/ownership.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,10 @@ thread-safe counterpart of `Rc<T>`.
472472

473473
## Lifetime Elision
474474

475-
Rust supports powerful local type inference in function bodies, but it’s
476-
forbidden in item signatures to allow reasoning about the types just based in
477-
the item signature alone. However, for ergonomic reasons a very restricted
478-
secondary inference algorithm called “lifetime elision” applies in function
479-
signatures. It infers only based on the signature components themselves and not
480-
based on the body of the function, only infers lifetime paramters, and does
481-
this with only three easily memorizable and unambiguous rules. This makes
482-
lifetime elision a shorthand for writing an item signature, while not hiding
483-
away the actual types involved as full local inference would if applied to it.
475+
Earlier, we mentioned *lifetime elision*, a feature of Rust which allows you to
476+
not write lifetime annotations in certain circumstances. All references have a
477+
lifetime, and so if you elide a lifetime (like `&T` instead of `&'a T`), Rust
478+
will do three things to determine what those lifetimes should be.
484479

485480
When talking about lifetime elision, we use the term *input lifetime* and
486481
*output lifetime*. An *input lifetime* is a lifetime associated with a parameter

branches/snap-stage3/src/doc/trpl/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 {
231231
}
232232
233233
#[cfg(test)]
234-
mod tests {
234+
mod test {
235235
use super::add_two;
236236
237237
#[test]
@@ -241,7 +241,7 @@ mod tests {
241241
}
242242
```
243243

244-
There's a few changes here. The first is the introduction of a `mod tests` with
244+
There's a few changes here. The first is the introduction of a `mod test` with
245245
a `cfg` attribute. The module allows us to group all of our tests together, and
246246
to also define helper functions if needed, that don't become a part of the rest
247247
of our crate. The `cfg` attribute only compiles our test code if we're
@@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 {
260260
}
261261
262262
#[cfg(test)]
263-
mod tests {
263+
mod test {
264264
use super::*;
265265
266266
#[test]

branches/snap-stage3/src/etc/rustup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ case $CFG_OSTYPE in
335335
MINGW32*)
336336
CFG_OSTYPE=pc-mingw32
337337
;;
338-
# Thad's Cygwin identifiers below
338+
# Thad's Cygwin identifers below
339339

340340
# Vista 32 bit
341341
CYGWIN_NT-6.0)
@@ -437,7 +437,7 @@ CFG_TMP_DIR=$(mktemp -d 2>/dev/null \
437437
|| create_tmp_dir)
438438

439439
# If we're saving nightlies and we didn't specify which one, grab the latest
440-
# version from the perspective of the server. Buildbot has typically finished
440+
# verison from the perspective of the server. Buildbot has typically finished
441441
# building and uploading by ~8UTC, but we want to include a little buffer.
442442
#
443443
# FIXME It would be better to use the known most recent nightly that has been

branches/snap-stage3/src/libcollectionstest/bench.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ macro_rules! map_insert_rand_bench {
2222
let mut rng = rand::weak_rng();
2323

2424
for _ in 0..n {
25-
let i = rng.gen::<usize>() % n;
25+
let i = rng.gen() % n;
2626
map.insert(i, i);
2727
}
2828

2929
// measure
3030
b.iter(|| {
31-
let k = rng.gen::<usize>() % n;
31+
let k = rng.gen() % n;
3232
map.insert(k, k);
3333
map.remove(&k);
3434
});
@@ -77,7 +77,7 @@ macro_rules! map_find_rand_bench {
7777

7878
// setup
7979
let mut rng = rand::weak_rng();
80-
let mut keys: Vec<_> = (0..n).map(|_| rng.gen::<usize>() % n).collect();
80+
let mut keys: Vec<_> = (0..n).map(|_| rng.gen() % n).collect();
8181

8282
for &k in &keys {
8383
map.insert(k, k);

branches/snap-stage3/src/libcore/error.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,33 @@
4848
//! For example,
4949
//!
5050
//! ```
51-
//! #![feature(core)]
51+
//! # #![feature(os, old_io, old_path)]
5252
//! use std::error::FromError;
53-
//! use std::{io, str};
54-
//! use std::fs::File;
53+
//! use std::old_io::{File, IoError};
54+
//! use std::os::{MemoryMap, MapError};
55+
//! use std::old_path::Path;
5556
//!
5657
//! enum MyError {
57-
//! Io(io::Error),
58-
//! Utf8(str::Utf8Error),
58+
//! Io(IoError),
59+
//! Map(MapError)
5960
//! }
6061
//!
61-
//! impl FromError<io::Error> for MyError {
62-
//! fn from_error(err: io::Error) -> MyError { MyError::Io(err) }
62+
//! impl FromError<IoError> for MyError {
63+
//! fn from_error(err: IoError) -> MyError {
64+
//! MyError::Io(err)
65+
//! }
6366
//! }
6467
//!
65-
//! impl FromError<str::Utf8Error> for MyError {
66-
//! fn from_error(err: str::Utf8Error) -> MyError { MyError::Utf8(err) }
68+
//! impl FromError<MapError> for MyError {
69+
//! fn from_error(err: MapError) -> MyError {
70+
//! MyError::Map(err)
71+
//! }
6772
//! }
6873
//!
6974
//! #[allow(unused_variables)]
7075
//! fn open_and_map() -> Result<(), MyError> {
71-
//! let b = b"foo.txt";
72-
//! let s = try!(str::from_utf8(b));
73-
//! let f = try!(File::open(s));
74-
//!
76+
//! let f = try!(File::open(&Path::new("foo.txt")));
77+
//! let m = try!(MemoryMap::new(0, &[]));
7578
//! // do something interesting here...
7679
//! Ok(())
7780
//! }

branches/snap-stage3/src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub struct InvariantType<T>;
476476
/// particular, thanks to the `Reflect` bound, callers know that a
477477
/// function declared like `fn bar<T>(...)` will always act in
478478
/// precisely the same way no matter what type `T` is supplied,
479-
/// because there are no bounds declared on `T`. (The ability for a
479+
/// beacuse there are no bounds declared on `T`. (The ability for a
480480
/// caller to reason about what a function may do based solely on what
481481
/// generic bounds are declared is often called the ["parametricity
482482
/// property"][1].)

branches/snap-stage3/src/libcore/ops.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ pub trait Neg {
485485
macro_rules! neg_impl {
486486
($($t:ty)*) => ($(
487487
#[stable(feature = "rust1", since = "1.0.0")]
488-
#[allow(unsigned_negation)]
489488
impl Neg for $t {
490489
#[stable(feature = "rust1", since = "1.0.0")]
491490
type Output = $t;
@@ -499,7 +498,28 @@ macro_rules! neg_impl {
499498
)*)
500499
}
501500

502-
neg_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
501+
macro_rules! neg_uint_impl {
502+
($t:ty, $t_signed:ty) => {
503+
#[stable(feature = "rust1", since = "1.0.0")]
504+
impl Neg for $t {
505+
type Output = $t;
506+
507+
#[inline]
508+
fn neg(self) -> $t { -(self as $t_signed) as $t }
509+
}
510+
511+
forward_ref_unop! { impl Neg, neg for $t }
512+
}
513+
}
514+
515+
neg_impl! { isize i8 i16 i32 i64 f32 f64 }
516+
517+
neg_uint_impl! { usize, isize }
518+
neg_uint_impl! { u8, i8 }
519+
neg_uint_impl! { u16, i16 }
520+
neg_uint_impl! { u32, i32 }
521+
neg_uint_impl! { u64, i64 }
522+
503523

504524
/// The `Not` trait is used to specify the functionality of unary `!`.
505525
///

branches/snap-stage3/src/librand/distributions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn ziggurat<R: Rng, P, Z>(
256256
return zero_case(rng, u);
257257
}
258258
// algebraically equivalent to f1 + DRanU()*(f0 - f1) < 1
259-
if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen::<f64>() < pdf(x) {
259+
if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen() < pdf(x) {
260260
return x;
261261
}
262262
}

branches/snap-stage3/src/librand/distributions/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ macro_rules! float_impl {
154154
}
155155
}
156156
fn sample_range<R: Rng>(r: &Range<$ty>, rng: &mut R) -> $ty {
157-
r.low + r.range * rng.gen::<$ty>()
157+
r.low + r.range * rng.gen()
158158
}
159159
}
160160
}

branches/snap-stage3/src/librbml/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
//! - `Sub32` (`0d`): 4-byte unsigned integer for supplementary information.
8484
//! Those two tags normally occur as the first subdocument of certain tags,
8585
//! namely `Enum`, `Vec` and `Map`, to provide a variant or size information.
86-
//! They can be used interchangeably.
86+
//! They can be used interchangably.
8787
//!
8888
//! Predefined tags with an explicit length:
8989
//!

0 commit comments

Comments
 (0)