Skip to content

Commit 8e9bd6c

Browse files
committed
Auto merge of #27066 - rust-lang:rollup_central, r=steveklabnik
Everything on this branch has passed check-stage2 on linux. This is a temporary integration branch until [our buildbot problems](https://internals.rust-lang.org/t/buildbot-is-down-for-a-bit/2365/3) get fixed. As the day progresses I'll merge more PRs into this branch once I get them through make check. This branch isn't complete, keeping it up here so more people can merge PRs into integration if they want. r? @Manishearth
2 parents e4e9319 + c9e6d9a commit 8e9bd6c

Some content is hidden

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

47 files changed

+2441
-947
lines changed

.travis.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
# Use something that's not 'ruby' so we don't set up things like
2-
# RVM/bundler/ruby and whatnot. Right now 'rust' as a language actually
3-
# downloads a rust/cargo snapshot, which we don't really want for building rust.
1+
# ccache support is disabled unless your language is a C-derivative. However
2+
# `language: C` unconditionally sets `CC=compiler`. If we just set it in our
3+
# `env` it will be overwritten by the default (gcc 4.6).
44
language: c
5+
compiler: /usr/bin/gcc-4.7
6+
cache: ccache
57
sudo: false
68

79
# The test suite is in general way too stressful for travis, especially in
810
# terms of time limit and reliability. In the past we've tried to scale things
911
# back to only build the stage1 compiler and run a subset of tests, but this
1012
# didn't end up panning out very well.
1113
#
12-
# As a result, we're just using travis to run `make tidy` now. It'll help
13-
# everyone find out about their trailing spaces early on!
14+
# As a result, we're just using travis to run `make tidy` and *only* build
15+
# stage1 but *not* test it for now (a strict subset of the bootstrap). This will
16+
# catch "obvious" errors like style or not even compiling.
17+
#
18+
# We need gcc4.7 or higher to build LLVM, and travis (well, Ubuntu 12.04)
19+
# currently ships with 4.6. Gotta download our own.
1420
before_script:
15-
- ./configure --llvm-root=path/to/nowhere
21+
- ./configure --enable-ccache
1622
script:
1723
- make tidy
24+
- make rustc-stage1 -j4
25+
26+
env:
27+
- CXX=/usr/bin/g++-4.7
28+
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- gcc-4.7
35+
- g++-4.7
1836

1937
# Real testing happens on http://buildbot.rust-lang.org/
2038
#

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ Documentation improvements are very welcome. The source of `doc.rust-lang.org`
133133
is located in `src/doc` in the tree, and standard API documentation is generated
134134
from the source code itself.
135135

136-
Documentation pull requests function in the same as other pull requests, though
137-
you may see a slightly different form of `r+`:
136+
Documentation pull requests function in the same way as other pull requests,
137+
though you may see a slightly different form of `r+`:
138138

139139
@bors: r+ 38fe8d2 rollup
140140

RELEASES.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Breaking Changes
2828
in, and the same value reported by clang's
2929
`alignof`. [`mem::min_align_of`] is deprecated. This is not known to
3030
break real code.
31+
* [The `#[packed]` attribute is no longer silently accepted by the
32+
compiler][packed]. This attribute did nothing and code that
33+
mentioned it likely did not work as intended.
3134

3235
Language
3336
--------
@@ -140,7 +143,7 @@ Misc
140143
[fat]: https://github.com/rust-lang/rust/pull/26411
141144
[dst]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
142145
[parcodegen]: https://github.com/rust-lang/rust/pull/26018
143-
146+
[packed]: https://github.com/rust-lang/rust/pull/25541
144147

145148
Version 1.1.0 (June 2015)
146149
=========================

configure

+23-11
Original file line numberDiff line numberDiff line change
@@ -1031,15 +1031,12 @@ fi
10311031

10321032
if [ ! -z "$CFG_ENABLE_CCACHE" ]
10331033
then
1034-
if [ -z "$CC" ]
1034+
if [ -z "$CFG_CCACHE" ]
10351035
then
1036-
if [ -z "$CFG_CCACHE" ]
1037-
then
1038-
err "ccache requested but not found"
1039-
fi
1040-
1041-
CFG_CC="ccache $CFG_CC"
1036+
err "ccache requested but not found"
10421037
fi
1038+
1039+
CFG_CC="ccache $CFG_CC"
10431040
fi
10441041

10451042
if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
@@ -1528,11 +1525,26 @@ do
15281525

15291526
(*)
15301527
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1531-
LLVM_CXX_32="$CXX"
1532-
LLVM_CC_32="$CC"
1528+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1529+
then
1530+
if [ -z "$CFG_CCACHE" ]
1531+
then
1532+
err "ccache requested but not found"
1533+
fi
1534+
1535+
LLVM_CXX_32="ccache $CXX"
1536+
LLVM_CC_32="ccache $CC"
1537+
1538+
LLVM_CXX_64="ccache $CXX"
1539+
LLVM_CC_64="ccache $CC"
1540+
else
1541+
LLVM_CXX_32="$CXX"
1542+
LLVM_CC_32="$CC"
1543+
1544+
LLVM_CXX_64="$CXX"
1545+
LLVM_CC_64="$CC"
1546+
fi
15331547

1534-
LLVM_CXX_64="$CXX"
1535-
LLVM_CC_64="$CC"
15361548
;;
15371549
esac
15381550

src/doc/reference.md

+74-51
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ The type of an _unsuffixed_ integer literal is determined by type inference:
343343
* If an integer type can be _uniquely_ determined from the surrounding
344344
program context, the unsuffixed integer literal has that type.
345345

346-
* If the program context underconstrains the type, it defaults to the
346+
* If the program context under-constrains the type, it defaults to the
347347
signed 32-bit integer `i32`.
348348

349-
* If the program context overconstrains the type, it is considered a
349+
* If the program context over-constrains the type, it is considered a
350350
static type error.
351351

352352
Examples of integer literals of various forms:
@@ -382,9 +382,9 @@ type inference:
382382
surrounding program context, the unsuffixed floating-point literal
383383
has that type.
384384

385-
* If the program context underconstrains the type, it defaults to `f64`.
385+
* If the program context under-constrains the type, it defaults to `f64`.
386386

387-
* If the program context overconstrains the type, it is considered a
387+
* If the program context over-constrains the type, it is considered a
388388
static type error.
389389

390390
Examples of floating-point literals of various forms:
@@ -1292,7 +1292,7 @@ All access to a static is safe, but there are a number of restrictions on
12921292
statics:
12931293

12941294
* Statics may not contain any destructors.
1295-
* The types of static values must ascribe to `Sync` to allow threadsafe access.
1295+
* The types of static values must ascribe to `Sync` to allow thread-safe access.
12961296
* Statics may not refer to other statics by value, only by reference.
12971297
* Constants cannot refer to statics.
12981298

@@ -1694,7 +1694,7 @@ explain, here's a few use cases and what they would entail:
16941694
* A crate needs a global available "helper module" to itself, but it doesn't
16951695
want to expose the helper module as a public API. To accomplish this, the
16961696
root of the crate's hierarchy would have a private module which then
1697-
internally has a "public api". Because the entire crate is a descendant of
1697+
internally has a "public API". Because the entire crate is a descendant of
16981698
the root, then the entire local crate can access this private module through
16991699
the second case.
17001700

@@ -1957,8 +1957,6 @@ macro scope.
19571957
object file that this item's contents will be placed into.
19581958
- `no_mangle` - on any item, do not apply the standard name mangling. Set the
19591959
symbol for this item to its identifier.
1960-
- `packed` - on structs or enums, eliminate any padding that would be used to
1961-
align fields.
19621960
- `simd` - on certain tuple structs, derive the arithmetic operators, which
19631961
lower to the target's SIMD instructions, if any; the `simd` feature gate
19641962
is necessary to use this attribute.
@@ -3663,47 +3661,71 @@ sites are:
36633661

36643662
* `let` statements where an explicit type is given.
36653663

3666-
In `let _: U = e;`, `e` is coerced to have type `U`.
3664+
For example, `128` is coerced to have type `i8` in the following:
3665+
3666+
```rust
3667+
let _: i8 = 128;
3668+
```
36673669

36683670
* `static` and `const` statements (similar to `let` statements).
36693671

3670-
* arguments for function calls.
3672+
* Arguments for function calls
3673+
3674+
The value being coerced is the actual parameter, and it is coerced to
3675+
the type of the formal parameter.
3676+
3677+
For example, `128` is coerced to have type `i8` in the following:
3678+
3679+
```rust
3680+
fn bar(_: i8) { }
36713681

3672-
The value being coerced is the
3673-
actual parameter and it is coerced to the type of the formal parameter. For
3674-
example, let `foo` be defined as `fn foo(x: U) { ... }` and call it as
3675-
`foo(e);`. Then `e` is coerced to have type `U`;
3682+
fn main() {
3683+
bar(128);
3684+
}
3685+
```
36763686

3677-
* instantiations of struct or variant fields.
3687+
* Instantiations of struct or variant fields
36783688

3679-
Assume we have a `struct
3680-
Foo { x: U }` and instantiate it as `Foo { x: e }`. Then `e` is coerced to
3681-
have type `U`.
3689+
For example, `128` is coerced to have type `i8` in the following:
36823690

3683-
* function results (either the final line of a block if it is not semicolon
3684-
terminated or any expression in a `return` statement).
3691+
```rust
3692+
struct Foo { x: i8 }
36853693

3686-
In `fn foo() -> U { e }`, `e` is coerced to to have type `U`.
3694+
fn main() {
3695+
Foo { x: 128 };
3696+
}
3697+
```
3698+
3699+
* Function results, either the final line of a block if it is not
3700+
semicolon-terminated or any expression in a `return` statement
3701+
3702+
For example, `128` is coerced to have type `i8` in the following:
3703+
3704+
```rust
3705+
fn foo() -> i8 {
3706+
128
3707+
}
3708+
```
36873709

36883710
If the expression in one of these coercion sites is a coercion-propagating
36893711
expression, then the relevant sub-expressions in that expression are also
36903712
coercion sites. Propagation recurses from these new coercion sites.
36913713
Propagating expressions and their relevant sub-expressions are:
36923714

3693-
* array literals, where the array has type `[U; n]`. Each sub-expression in
3715+
* Array literals, where the array has type `[U; n]`. Each sub-expression in
36943716
the array literal is a coercion site for coercion to type `U`.
36953717

3696-
* array literals with repeating syntax, where the array has type `[U; n]`. The
3718+
* Array literals with repeating syntax, where the array has type `[U; n]`. The
36973719
repeated sub-expression is a coercion site for coercion to type `U`.
36983720

3699-
* tuples, where a tuple is a coercion site to type `(U_0, U_1, ..., U_n)`.
3721+
* Tuples, where a tuple is a coercion site to type `(U_0, U_1, ..., U_n)`.
37003722
Each sub-expression is a coercion site to the respective type, e.g. the
37013723
zeroth sub-expression is a coercion site to type `U_0`.
37023724

3703-
* parenthesised sub-expressions (`(e)`). If the expression has type `U`, then
3725+
* Parenthesised sub-expressions (`(e)`): if the expression has type `U`, then
37043726
the sub-expression is a coercion site to `U`.
37053727

3706-
* blocks. If a block has type `U`, then the last expression in the block (if
3728+
* Blocks: if a block has type `U`, then the last expression in the block (if
37073729
it is not semicolon-terminated) is a coercion site to `U`. This includes
37083730
blocks which are part of control flow statements, such as `if`/`else`, if
37093731
the block has a known type.
@@ -3712,45 +3734,46 @@ the block has a known type.
37123734

37133735
Coercion is allowed between the following types:
37143736

3715-
* `T` to `U` if `T` is a subtype of `U` (*reflexive case*).
3737+
* `T` to `U` if `T` is a subtype of `U` (*reflexive case*)
37163738

37173739
* `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to `T_3`
3718-
(*transitive case*).
3740+
(*transitive case*)
37193741

37203742
Note that this is not fully supported yet
37213743

3722-
* `&mut T` to `&T`.
3744+
* `&mut T` to `&T`
37233745

3724-
* `*mut T` to `*const T`.
3746+
* `*mut T` to `*const T`
37253747

3726-
* `&T` to `*const T`.
3748+
* `&T` to `*const T`
37273749

3728-
* `&mut T` to `*mut T`.
3750+
* `&mut T` to `*mut T`
37293751

37303752
* `&T` to `&U` if `T` implements `Deref<Target = U>`. For example:
37313753

3732-
```rust
3733-
use std::ops::Deref;
3754+
```rust
3755+
use std::ops::Deref;
37343756

3735-
struct CharContainer {
3736-
value: char
3737-
}
3757+
struct CharContainer {
3758+
value: char
3759+
}
37383760

3739-
impl Deref for CharContainer {
3740-
type Target = char;
3761+
impl Deref for CharContainer {
3762+
type Target = char;
37413763

3742-
fn deref<'a>(&'a self) -> &'a char {
3743-
&self.value
3744-
}
3745-
}
3764+
fn deref<'a>(&'a self) -> &'a char {
3765+
&self.value
3766+
}
3767+
}
37463768

3747-
fn foo(arg: &char) {}
3769+
fn foo(arg: &char) {}
3770+
3771+
fn main() {
3772+
let x = &mut CharContainer { value: 'y' };
3773+
foo(x); //&mut CharContainer is coerced to &char.
3774+
}
3775+
```
37483776

3749-
fn main() {
3750-
let x = &mut CharContainer { value: 'y' };
3751-
foo(x); //&mut CharContainer is coerced to &char.
3752-
}
3753-
```
37543777
* `&mut T` to `&mut U` if `T` implements `DerefMut<Target = U>`.
37553778

37563779
* TyCtor(`T`) to TyCtor(coerce_inner(`T`)), where TyCtor(`T`) is one of
@@ -3964,7 +3987,7 @@ In general, `--crate-type=bin` or `--crate-type=lib` should be sufficient for
39643987
all compilation needs, and the other options are just available if more
39653988
fine-grained control is desired over the output format of a Rust crate.
39663989

3967-
# Appendix: Rationales and design tradeoffs
3990+
# Appendix: Rationales and design trade-offs
39683991

39693992
*TODO*.
39703993

@@ -3974,7 +3997,7 @@ Rust is not a particularly original language, with design elements coming from
39743997
a wide range of sources. Some of these are listed below (including elements
39753998
that have since been removed):
39763999

3977-
* SML, OCaml: algebraic datatypes, pattern matching, type inference,
4000+
* SML, OCaml: algebraic data types, pattern matching, type inference,
39784001
semicolon statement separation
39794002
* C++: references, RAII, smart pointers, move semantics, monomorphisation,
39804003
memory model

src/doc/trpl/error-handling.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ is very wrong. Wrong enough that we can't continue with things in the current
5050
state. Another example is using the `unreachable!()` macro:
5151

5252
```rust,ignore
53+
use Event::NewRelease;
54+
5355
enum Event {
5456
NewRelease,
5557
}
@@ -71,7 +73,7 @@ fn descriptive_probability(event: Event) -> &'static str {
7173
}
7274
7375
fn main() {
74-
std::io::println(descriptive_probability(NewRelease));
76+
println!("{}", descriptive_probability(NewRelease));
7577
}
7678
```
7779

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ After `bar()` is over, its frame is deallocated, leaving just `foo()` and
176176
| 1 | a | 5 |
177177
| 0 | x | 42 |
178178

179-
And then `foo()` ends, leaving just `main()`
179+
And then `foo()` ends, leaving just `main()`:
180180

181181
| Address | Name | Value |
182182
|---------|------|-------|
@@ -537,7 +537,7 @@ Generally, you should prefer stack allocation, and so, Rust stack-allocates by
537537
default. The LIFO model of the stack is simpler, at a fundamental level. This
538538
has two big impacts: runtime efficiency and semantic impact.
539539

540-
## Runtime Efficiency.
540+
## Runtime Efficiency
541541

542542
Managing the memory for the stack is trivial: The machine just
543543
increments or decrements a single value, the so-called “stack pointer”.

0 commit comments

Comments
 (0)