Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of all PRs in queue (temporary integration branch) #27066

Merged
merged 72 commits into from
Jul 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
b85aa78
fix typo: "requests function in the same [way] as other"
rutsky Jun 30, 2015
aacb5f6
add missing colon
rutsky Jun 30, 2015
dbaaa2c
remove terminating dot from caption
rutsky Jun 30, 2015
36882a0
rustdoc: Reset the title when pressing the back button
nhowell Jul 2, 2015
0d3954f
reference: improve coercions section
tshepang Jul 5, 2015
4ee7047
reference: miscellaneous fixes
tshepang Jul 5, 2015
e08c5f7
Change some free functions into methods in libsyntax/diagnostic.rs
ftxqxd Jul 6, 2015
c3fd0e1
Remove token::get_name when unneeded
GuillaumeGomez Jul 8, 2015
0bf9fbb
Suggest using `ref` inline in an error
ftxqxd Jul 6, 2015
2e00b31
We just have to replace error codes but code is good now
GuillaumeGomez Jul 11, 2015
8b731a5
Add error codes
GuillaumeGomez Jul 12, 2015
f1b231d
Remove unused method
GuillaumeGomez Jul 12, 2015
48ee57e
Update error codes
GuillaumeGomez Jul 12, 2015
cbf0b1b
Remove warnings by centralizing error codes usage
GuillaumeGomez Jul 13, 2015
4ec3ab6
diagnostics: Fix E0303 explanation.
michaelsproul Jul 13, 2015
26ef17d
Add regression test for #22312
frewsxcv Jul 12, 2015
00f7268
Add regression test for #20544
frewsxcv Jul 12, 2015
9d94ef5
Add regression tests for #23595
frewsxcv Jul 12, 2015
f52a87c
Centralize error spaning and add an enum to make this treatment easier
GuillaumeGomez Jul 13, 2015
eaee43a
Fix section of __morestack for aarch64-unknown-linux-gnu
akosthekiss Jul 13, 2015
2e1f75a
Fixed snippet to return the proper error.
Jul 13, 2015
68781e2
std: Refining crate docs
brson Jul 11, 2015
4089ba8
Fix local path
brson Jul 11, 2015
3a180d1
Address feedback
brson Jul 14, 2015
e6e6368
save-analysis: make generated_code pub
nrc Jul 14, 2015
41b0568
save-analysis: tweak constructors
nrc Jul 14, 2015
94f13ac
save-analysis: handle a few more kinds of paths
nrc Jul 14, 2015
49d3a93
save-analysis: fix def_ids for method calls
nrc Jul 14, 2015
c5f7c19
End of error code spanning centralization
GuillaumeGomez Jul 14, 2015
7954096
Add regression test for #21140
frewsxcv Jul 12, 2015
31262c2
Arguments are now passed directly to the function instead of the enum…
GuillaumeGomez Jul 14, 2015
a878f35
don't ICE when FRU is used on an enum variant
arielb1 Jul 13, 2015
86d954b
core: Revive SipHash's tests
bluss Jul 14, 2015
6d5ae6b
Address more feedback
brson Jul 14, 2015
a266ab0
Mention that removal of `#[packed]` was a breaking change in 1.2
brson Jul 14, 2015
60133aa
Remove macro, import function and enum
GuillaumeGomez Jul 14, 2015
833e88d
Don't mention packed attribute in reference.md
Stebalien Jul 14, 2015
2881bba
Address more feedback
brson Jul 14, 2015
441b1c6
Some more default implementations for the compiler driver callbacks.
nrc Jul 14, 2015
5ec1dea
Change int/uint => isize/usize in compiler docs.
Jul 14, 2015
e8a0328
Ratchet up travis to build stage1 and our own LLVM.
Gankra Jul 14, 2015
98f2872
Add specializations of read_to_end for Stdin, TcpStream and File,
AlisdairO Jul 10, 2015
cfa8e48
doc: add rel=prev/next for links to adjacent sections
vincentbernat Jul 15, 2015
e1073dd
Remove reference to gdb-pretty-struct-and-enums.rs
tamird Jul 16, 2015
feb06b1
Rollup merge of #27061 - tamird:patch-1, r=alexcrichton
Manishearth Jul 16, 2015
9847532
Rollup merge of #26693 - rutsky:patch-1, r=Manishearth
Manishearth Jul 16, 2015
9ac3f42
Rollup merge of #26695 - rutsky:patch-2, r=Manishearth
Manishearth Jul 16, 2015
3a5bc73
Rollup merge of #26977 - brson:stddoc, r=Gankro
Manishearth Jul 16, 2015
62bb71e
Rollup merge of #27013 - michaelsproul:fix-E0303, r=alexcrichton
Manishearth Jul 16, 2015
a4060d0
Rollup merge of #27020 - goyox86:goyox86/fix-error-handling-snippet, …
Manishearth Jul 16, 2015
2c49927
Rollup merge of #27028 - Gankro:travis, r=alexcrichton
Manishearth Jul 16, 2015
43bb514
Rollup merge of #27029 - nrc:save-pub-gen-code, r=alexcrichton
Manishearth Jul 16, 2015
828ebb8
Rollup merge of #26819 - P1start:ref-suggestion, r=nikomatsakis
Manishearth Jul 16, 2015
38e875a
Rollup merge of #26838 - P1start:refactor-diagnostic, r=alexcrichton
Manishearth Jul 16, 2015
1da1a46
Rollup merge of #26898 - GuillaumeGomez:fixup, r=eddyb
Manishearth Jul 16, 2015
12899e7
Rollup merge of #26950 - AlisdairO:memset, r=alexcrichton
Manishearth Jul 16, 2015
31d6716
Rollup merge of #26988 - frewsxcv:regression-tests, r=alexcrichton
Manishearth Jul 16, 2015
b64af26
Rollup merge of #27018 - arielb1:enum-update, r=eddyb
Manishearth Jul 16, 2015
b8a9c80
Rollup merge of #27019 - akiss77:pr-aarch64-morestack-section, r=alex…
Manishearth Jul 16, 2015
77d5fca
Rollup merge of #27030 - nrc:save-ctors, r=alexcrichton
Manishearth Jul 16, 2015
c8ec909
Rollup merge of #27039 - bluss:siphash-tests, r=alexcrichton
Manishearth Jul 16, 2015
2a74fa3
Rollup merge of #27046 - nrc:driver-defaults, r=alexcrichton
Manishearth Jul 16, 2015
30ac7e7
Fixup #27046 with pattern bindings
Manishearth Jul 16, 2015
7c202a3
Fixup test
Manishearth Jul 16, 2015
69e6dc0
Fix diagnostics name clash
Manishearth Jul 16, 2015
3ba0b3c
Merge branch 'fix/doc/rel-prev-next' of https://github.com/vincentber…
steveklabnik Jul 16, 2015
2fb87ed
Merge branch 'uint-usize-rustc-docs' of https://github.com/nham/rust …
steveklabnik Jul 16, 2015
c451bb8
Merge branch 'nopacked' of https://github.com/Stebalien/rust into rol…
steveklabnik Jul 16, 2015
48ddf90
Merge branch 'doc_io_traits_enums' of https://github.com/steveklabnik…
steveklabnik Jul 16, 2015
72722e3
Merge branch 'coercions' of https://github.com/tshepang/rust into rol…
steveklabnik Jul 16, 2015
d354d41
Merge branch 'more-ref-fixes' of https://github.com/tshepang/rust int…
steveklabnik Jul 16, 2015
c9e6d9a
Merge branch 'fix-26673' of https://github.com/nhowell/rust into roll…
steveklabnik Jul 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
# Use something that's not 'ruby' so we don't set up things like
# RVM/bundler/ruby and whatnot. Right now 'rust' as a language actually
# downloads a rust/cargo snapshot, which we don't really want for building rust.
# ccache support is disabled unless your language is a C-derivative. However
# `language: C` unconditionally sets `CC=compiler`. If we just set it in our
# `env` it will be overwritten by the default (gcc 4.6).
language: c
compiler: /usr/bin/gcc-4.7
cache: ccache
sudo: false

# The test suite is in general way too stressful for travis, especially in
# terms of time limit and reliability. In the past we've tried to scale things
# back to only build the stage1 compiler and run a subset of tests, but this
# didn't end up panning out very well.
#
# As a result, we're just using travis to run `make tidy` now. It'll help
# everyone find out about their trailing spaces early on!
# As a result, we're just using travis to run `make tidy` and *only* build
# stage1 but *not* test it for now (a strict subset of the bootstrap). This will
# catch "obvious" errors like style or not even compiling.
#
# We need gcc4.7 or higher to build LLVM, and travis (well, Ubuntu 12.04)
# currently ships with 4.6. Gotta download our own.
before_script:
- ./configure --llvm-root=path/to/nowhere
- ./configure --enable-ccache
script:
- make tidy
- make rustc-stage1 -j4

env:
- CXX=/usr/bin/g++-4.7

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.7
- g++-4.7

# Real testing happens on http://buildbot.rust-lang.org/
#
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ Documentation improvements are very welcome. The source of `doc.rust-lang.org`
is located in `src/doc` in the tree, and standard API documentation is generated
from the source code itself.

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

@bors: r+ 38fe8d2 rollup

Expand Down
5 changes: 4 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Breaking Changes
in, and the same value reported by clang's
`alignof`. [`mem::min_align_of`] is deprecated. This is not known to
break real code.
* [The `#[packed]` attribute is no longer silently accepted by the
compiler][packed]. This attribute did nothing and code that
mentioned it likely did not work as intended.

Language
--------
Expand Down Expand Up @@ -140,7 +143,7 @@ Misc
[fat]: https://github.com/rust-lang/rust/pull/26411
[dst]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
[parcodegen]: https://github.com/rust-lang/rust/pull/26018

[packed]: https://github.com/rust-lang/rust/pull/25541

Version 1.1.0 (June 2015)
=========================
Expand Down
34 changes: 23 additions & 11 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1031,15 +1031,12 @@ fi

if [ ! -z "$CFG_ENABLE_CCACHE" ]
then
if [ -z "$CC" ]
if [ -z "$CFG_CCACHE" ]
then
if [ -z "$CFG_CCACHE" ]
then
err "ccache requested but not found"
fi

CFG_CC="ccache $CFG_CC"
err "ccache requested but not found"
fi

CFG_CC="ccache $CFG_CC"
fi

if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
Expand Down Expand Up @@ -1528,11 +1525,26 @@ do

(*)
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
LLVM_CXX_32="$CXX"
LLVM_CC_32="$CC"
if [ ! -z "$CFG_ENABLE_CCACHE" ]
then
if [ -z "$CFG_CCACHE" ]
then
err "ccache requested but not found"
fi

LLVM_CXX_32="ccache $CXX"
LLVM_CC_32="ccache $CC"

LLVM_CXX_64="ccache $CXX"
LLVM_CC_64="ccache $CC"
else
LLVM_CXX_32="$CXX"
LLVM_CC_32="$CC"

LLVM_CXX_64="$CXX"
LLVM_CC_64="$CC"
fi

LLVM_CXX_64="$CXX"
LLVM_CC_64="$CC"
;;
esac

Expand Down
125 changes: 74 additions & 51 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ The type of an _unsuffixed_ integer literal is determined by type inference:
* If an integer type can be _uniquely_ determined from the surrounding
program context, the unsuffixed integer literal has that type.

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

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

Examples of integer literals of various forms:
Expand Down Expand Up @@ -382,9 +382,9 @@ type inference:
surrounding program context, the unsuffixed floating-point literal
has that type.

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

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

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

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

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

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

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

In `let _: U = e;`, `e` is coerced to have type `U`.
For example, `128` is coerced to have type `i8` in the following:

```rust
let _: i8 = 128;
```

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

* arguments for function calls.
* Arguments for function calls

The value being coerced is the actual parameter, and it is coerced to
the type of the formal parameter.

For example, `128` is coerced to have type `i8` in the following:

```rust
fn bar(_: i8) { }

The value being coerced is the
actual parameter and it is coerced to the type of the formal parameter. For
example, let `foo` be defined as `fn foo(x: U) { ... }` and call it as
`foo(e);`. Then `e` is coerced to have type `U`;
fn main() {
bar(128);
}
```

* instantiations of struct or variant fields.
* Instantiations of struct or variant fields

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

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

In `fn foo() -> U { e }`, `e` is coerced to to have type `U`.
fn main() {
Foo { x: 128 };
}
```

* Function results, either the final line of a block if it is not
semicolon-terminated or any expression in a `return` statement

For example, `128` is coerced to have type `i8` in the following:

```rust
fn foo() -> i8 {
128
}
```

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

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

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

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

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

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

Coercion is allowed between the following types:

* `T` to `U` if `T` is a subtype of `U` (*reflexive case*).
* `T` to `U` if `T` is a subtype of `U` (*reflexive case*)

* `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to `T_3`
(*transitive case*).
(*transitive case*)

Note that this is not fully supported yet

* `&mut T` to `&T`.
* `&mut T` to `&T`

* `*mut T` to `*const T`.
* `*mut T` to `*const T`

* `&T` to `*const T`.
* `&T` to `*const T`

* `&mut T` to `*mut T`.
* `&mut T` to `*mut T`

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

```rust
use std::ops::Deref;
```rust
use std::ops::Deref;

struct CharContainer {
value: char
}
struct CharContainer {
value: char
}

impl Deref for CharContainer {
type Target = char;
impl Deref for CharContainer {
type Target = char;

fn deref<'a>(&'a self) -> &'a char {
&self.value
}
}
fn deref<'a>(&'a self) -> &'a char {
&self.value
}
}

fn foo(arg: &char) {}
fn foo(arg: &char) {}

fn main() {
let x = &mut CharContainer { value: 'y' };
foo(x); //&mut CharContainer is coerced to &char.
}
```

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

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

# Appendix: Rationales and design tradeoffs
# Appendix: Rationales and design trade-offs

*TODO*.

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

* SML, OCaml: algebraic datatypes, pattern matching, type inference,
* SML, OCaml: algebraic data types, pattern matching, type inference,
semicolon statement separation
* C++: references, RAII, smart pointers, move semantics, monomorphisation,
memory model
Expand Down
4 changes: 3 additions & 1 deletion src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ is very wrong. Wrong enough that we can't continue with things in the current
state. Another example is using the `unreachable!()` macro:

```rust,ignore
use Event::NewRelease;

enum Event {
NewRelease,
}
Expand All @@ -71,7 +73,7 @@ fn descriptive_probability(event: Event) -> &'static str {
}

fn main() {
std::io::println(descriptive_probability(NewRelease));
println!("{}", descriptive_probability(NewRelease));
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/the-stack-and-the-heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ After `bar()` is over, its frame is deallocated, leaving just `foo()` and
| 1 | a | 5 |
| 0 | x | 42 |

And then `foo()` ends, leaving just `main()`
And then `foo()` ends, leaving just `main()`:

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

## Runtime Efficiency.
## Runtime Efficiency

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