Commit Graph

66476 Commits

Author SHA1 Message Date
Mark Simulacrum
fe0eca0d3f Change tools to take a compiler instead of a stage. 2017-07-27 05:51:22 -06:00
Mark Simulacrum
f4240a4b20 Remove src/driver 2017-07-27 05:51:22 -06:00
bors
f60d373422 Auto merge of #43489 - petrochenkov:mutref, r=GuillaumeGomez
Better diagnostics and recovery for `mut ref` in patterns

Fixes https://github.com/rust-lang/rust/issues/43286
Supersedes https://github.com/rust-lang/rust/pull/43451

r? @GuillaumeGomez
2017-07-27 11:40:12 +00:00
Eduard-Mihai Burtescu
4c900c5248 rustc_const_eval: always require correct Substs. 2017-07-27 12:22:26 +03:00
bors
da4d49002d Auto merge of #43479 - ivanbakel:loop_borrow_msg, r=estebank
Extended error message for mut borrow conflicts in loops

RFC issue: https://github.com/rust-lang/rfcs/issues/2080

The error message for multiple mutable borrows on the same value over loop iterations now makes it clear that the conflict comes from the borrow outlasting the loop. The wording of the error is based on the special case of the moved-value error for a value moved in a loop. Following the example of that error, the code remains the same for the special case.

This is mainly because I felt the current message is confusing in the loop case : https://github.com/rust-lang/rust/issues/43437. It's not clear that the two conflicting borrows are in different iterations of the loop, and instead it just looks like the compiler has an issue with a single line.
2017-07-27 07:54:15 +00:00
bors
e574ba4994 Auto merge of #43477 - est31:master, r=alexcrichton
Switch to begin_panic again

In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.
2017-07-27 04:25:37 +00:00
bors
4a42ff4823 Auto merge of #43445 - zackmdavis:rustdoc_major_section_self-links, r=GuillaumeGomez
rustdoc: make major section headers self-links

The sidebar already has links to these h2's ids, but for convenience,
the h2 itself should also be a link (retaining its present appearance).

![doc_sec_self-links](https://user-images.githubusercontent.com/1076988/28503806-cdce4e00-6fc1-11e7-832a-2ed1fc62808f.png)

This should address most of #24484.
2017-07-27 02:05:54 +00:00
Isaac van Bakel
688852047c Added tests for new loop borrow message
One set of tests is to ensure the current message is correct.
The other set is to check the messages are generated correctly for every
type of loop.
2017-07-27 02:43:11 +01:00
Josh Triplett
f1de27fe6b COPYRIGHT: Provide a better explanation of Rust copyrights
Avoid implying that any copyrights have been assigned to a separate
entity (such as "The Rust Project Developers") Rust contributors retain
their copyrights, and do not assign them to anyone by contributing.

Remove the inaccurate notice, and provide a clear explanation. Avoid
stating that all files contain copyright notices and/or license notices,
and especially avoid suggesting that the license terms only apply to
files marked as such.

In the process, this also drops a separate notice that implies only some
copyrights are retained by contributors (suggesting that others are
not).
2017-07-26 16:52:15 -07:00
Josh Triplett
2a8807e889 LICENSE-MIT: Remove inaccurate (misattributed) copyright notice
LICENSE-MIT contains the line "Copyright (c) 2015 The Rust Project
Developers", which implies that an entity called "The Rust Project
Developers" holds copyrights in Rust. Rust contributors retain
their copyrights, and do not assign them to anyone by contributing.
Remove the inaccurate notice.
2017-07-26 16:51:58 -07:00
bors
ddaab61101 Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon
Stabilize more APIs for the 1.20.0 release

In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
2017-07-26 23:40:48 +00:00
bors
599be0d18f Auto merge of #43487 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

- Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480
- Failed merges:
2017-07-26 21:08:38 +00:00
bors
d02fb3bcf4 Auto merge of #42059 - derekdreery:bugfix/fix_emscripten_tests, r=alexcrichton
Make compiletest set cwd before running js tests

Proposed fix for #38800.

Not all tests pass yet - I will mention failures here once the test suite has finished.
2017-07-26 18:27:19 +00:00
Luca Barbato
a1995d3973 Add Vector Compare Greater-Than 2017-07-26 17:19:32 +00:00
Vadim Petrochenkov
dda30f6902 Better diagnostics and recovery for mut ref in patterns 2017-07-26 18:59:07 +03:00
Florian Zeitz
ac43d58d3a trans: Optimize initialization using repeat expressions
This elides initialization for zero-sized arrays:
* for zero-sized elements we previously emitted an empty loop
* for arrays with a length of zero we previously emitted a loop with zero
  iterations

This emits llvm.memset() instead of a loop over each element when:
* all elements are zero integers
* elements are byte sized
2017-07-26 16:27:25 +02:00
Florian Zeitz
d721c1f9e3 trans: Reorder basic blocks in slice_for_each
This is mainly for readability of the generated LLVM IR and subsequently
assembly. There is a slight positive performance impact, likely due to
I-cache effects.
2017-07-26 16:23:07 +02:00
bors
2fc3aec431 Auto merge of #43485 - nrc:rls-env-fix, r=Mark-Simulacrum
Update RLS

This pulls in 79d659e569 It should fix #43453. It increases the timeout for test runs and forces builds in RLS tests to happen sequentially, this prevents interference between env vars passed to Cargo or rustc.

r? @Mark-Simulacrum
2017-07-26 14:08:50 +00:00
Luca Barbato
e2b5a6b3bc Add Vector Compare Equal 2017-07-26 13:13:52 +00:00
Mark Simulacrum
959ebd6785 Rollup merge of #43480 - dhduvall:sparc-blake2b, r=eddyb
Constrain the layout of Blake2bCtx for proper SPARC compilation

On SPARC, optimization fuel ends up emitting incorrect load and store
instructions for the transmute() call in blake2b_compress().  If we
force Blake2bCtx to be repr(C), the problem disappears.

Fixes #43346
2017-07-26 06:15:09 -06:00
Mark Simulacrum
ed09d6dfe1 Rollup merge of #43471 - ollie27:try_from_ints, r=nagisa
Add missing impl and tests for int to int TryFrom impls

These were missing from #43248.

r? @nagisa
2017-07-26 06:15:08 -06:00
Mark Simulacrum
9f4450b5a0 Rollup merge of #43465 - topecongiro:needs-test, r=Mark-Simulacrum
Add tests for issues with the E-needstest label

Fixes #19181.
Fixes #29516.
Fixes #29798.
Fixes #33504.
Fixes #34780.
Fixes #39211.
Fixes #39467.
Fixes #39720.
2017-07-26 06:15:07 -06:00
Mark Simulacrum
f7d06b3418 Rollup merge of #43463 - nrc:catch-span, r=petrochenkov
Fix the spans of catch blocks to include the `do`
2017-07-26 06:15:06 -06:00
Mark Simulacrum
9d02019f8f Rollup merge of #43462 - dhduvall:solaris-libresolv, r=aturon
DNS functions are in libresolv on Solaris, just like on MacOS
2017-07-26 06:15:05 -06:00
Mark Simulacrum
7fa104f041 Rollup merge of #43458 - RalfJung:verbose, r=nikomatsakis
Fix printing regions with -Z verbose

When dumping MIR with `-Z verbose`, it would print regions on types, but not in the code. It seems the Rvalue printing code tried to be smart and guessed when the `Display` for `Region` would not possibly print anything.

This PR makes it no longer be smart, and just always use the `Display` like all the other code (e.g. printing types) does.
2017-07-26 06:15:05 -06:00
Mark Simulacrum
25e5f0a48d Rollup merge of #43456 - joshlf:spawn-doc-grammar, r=alexcrichton
std:🧵:spawn: Fix grammar in documentation

Closes #43435.
2017-07-26 06:15:04 -06:00
Mark Simulacrum
3751d20ec9 Rollup merge of #43455 - QuietMisdreavus:extend-spec-docs, r=steveklabnik
add a note to Vec's Extend<&T> impl about its slice specialization

From the regular documentation view, it's not at all apparent that [this specialization](5669c9988f/src/liballoc/vec.rs (L1879-L1891)) exists for `slice::Iter`. This adds a documentation blurb to the Extend impl itself to note that this optimization exists.
2017-07-26 06:15:03 -06:00
Mark Simulacrum
b583392058 Rollup merge of #43447 - estebank:import-span, r=nikomatsakis
Point at path segment on module not found

Point at the correct path segment on a import statement where a module
doesn't exist.

New output:

```rust
error[E0432]: unresolved import `std::bar`
 --> <anon>:1:10
  |
1 | use std::bar::{foo1, foo2};
  |          ^^^ Could not find `bar` in `std`
```

instead of:

```rust
error[E0432]: unresolved import `std::bar::foo1`
 --> <anon>:1:16
  |
1 | use std::bar::{foo1, foo2};
  |                ^^^^ Could not find `bar` in `std`

error[E0432]: unresolved import `std::bar::foo2`
 --> <anon>:1:22
  |
1 | use std::bar::{foo1, foo2};
  |                      ^^^^ Could not find `bar` in `std`
```

Fix #43040.
2017-07-26 06:15:02 -06:00
Mark Simulacrum
b5b7266b78 Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfackler
Make the "main" constructors of NonZero/Shared/Unique return Option

Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441.

This is a breaking change to unstable APIs.

The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts.

In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-26 06:15:01 -06:00
Luca Barbato
4f6c03e243 Add Vector Compare Bounds Floating-Point 2017-07-26 09:58:17 +00:00
Richard Dodd
874ecdc09f Remove custom node script 2017-07-26 09:43:09 +01:00
Nick Cameron
b23c83e0c2 Update RLS 2017-07-26 18:51:32 +12:00
Esteban Küber
d96f9d47ac Point at return type always when type mismatch against it
Before this, the diagnostic errors would only point at the return type
when changing it would be a possible solution to a type error. Add a
label to the return type without a suggestion to change in order to make
the source of the expected type obvious.

Follow up to #42850, fixes #25133, fixes #41897.
2017-07-25 22:11:15 -07:00
Esteban Küber
552ff07758 Point at path segment on module not found
Point at the correct path segment on a import statement where a module
doesn't exist.

New output:

```rust
error[E0432]: unresolved import `std::bar`
 --> <anon>:1:10
  |
1 | use std::bar::{foo1, foo2};
  |          ^^^ Could not find `bar` in `std`
```

instead of:

```rust
error[E0432]: unresolved import `std::bar::foo1`
 --> <anon>:1:16
  |
1 | use std::bar::{foo1, foo2};
  |                ^^^^ Could not find `bar` in `std`

error[E0432]: unresolved import `std::bar::foo2`
 --> <anon>:1:22
  |
1 | use std::bar::{foo1, foo2};
  |                      ^^^^ Could not find `bar` in `std`
```
2017-07-25 21:25:43 -07:00
bors
bad58f2791 Auto merge of #43226 - alexcrichton:aarch64-ci, r=aidanhs
Add a disabled builder for aarch64 emulated tests

This commit adds a disabled builder which will run all tests for the standard
library for aarch64 in a QEMU instance. Once we get enough capacity to run this
on Travis this can be used to boost our platform coverage of AArch64
2017-07-26 03:53:46 +00:00
bors
b5e8a8ef97 Auto merge of #43046 - milmazz:bootstrap-unittest, r=aidanhs
bootstrap: Add doctests and unitests

This commit includes the following changes:

* Include more docstrings in classes, methods, and functions
* Add doctests, which are great for self-documenting our source code
* Add some unit tests with the `unittest` module
* Remove `WindowsError` reference on non-windows systems
* Rename some variables to be more explicit about their meaning
* Move all the attributes defined outside of `__init__`
* Add initial support for Python 3

r? @alexcrichton
2017-07-25 23:46:14 +00:00
Ian Douglas Scott
e9c55d1f79
Correct 'stable' attribute 2017-07-25 16:44:25 -07:00
Danek Duvall
f0fda53cc1 Constrain the layout of Blake2bCtx for proper SPARC compilation
On SPARC, optimization fuel ends up emitting incorrect load and store
instructions for the transmute() call in blake2b_compress().  If we
force Blake2bCtx to be repr(C), the problem disappears.

Fixes #43346
2017-07-25 14:32:08 -07:00
est31
90ac6408ba Switch to begin_panic again
In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.
2017-07-25 22:10:10 +02:00
Isaac van Bakel
c802fc7103 Modified error for loop mut borrow conflicts
Error message now makes clear that mutable borrow conflicts on a single
value in a loop body is caused by the borrow outlasting a single pass of
the loop.
Loop conflicts are detected by seeing when two borrow locations are the
same - which indicates the same code being run more than once.
2017-07-25 18:58:38 +01:00
Luca Barbato
ccdfd7f7e6 Add mradds to the powerpc intrinsics 2017-07-25 16:49:38 +00:00
bors
c417ee9ae8 Auto merge of #43320 - alexcrichton:new-bootstrap, r=Mark-Simulacrum
Bump master to 1.21.0

This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.
2017-07-25 16:13:16 +00:00
QuietMisdreavus
6e36769d29 add a note to Vec's Extend<&T> impl about its slice specialization 2017-07-25 10:55:23 -05:00
Alex Crichton
16707d4348 std: Stabilize the str_{mut,box}_extras feature
Stabilizes

* `<&mut str>::as_bytes_mut`
* `<Box<str>>::into_boxed_bytes`
* `std::str::from_boxed_utf8_unchecked`
* `std::str::from_utf8_mut`
* `std::str::from_utf8_unchecked_mut`

Closes #41119
2017-07-25 07:10:42 -07:00
Alex Crichton
20b4f86d13 Stabilize the compile_error_macro feature
Stabilizes:

* `compile_error!` as a macro defined by rustc

Closes #40872
2017-07-25 07:09:31 -07:00
Alex Crichton
daeb6077c8 std: Stabilize manually_drop feature
Stabilizes

* `core::mem::ManuallyDrop`
* `std::mem::ManuallyDrop`
* `ManuallyDrop::new`
* `ManuallyDrop::into_inner`
* `ManuallyDrop::drop`
* `Deref for ManuallyDrop`
* `DerefMut for ManuallyDrop`

Closes #40673
2017-07-25 07:09:31 -07:00
Alex Crichton
3fae48107f std: Stabilize utf8_error_error_len feature
Stabilizes:

* `Utf8Error::error_len`

Closes #40494
2017-07-25 07:09:31 -07:00
Alex Crichton
cbfce40e1c std: Stabilize CString/OsString/PathBuf extra methods
Stabilizes:

* `CString::as_c_str`
* `CString::into_boxed_c_str`
* `CStr::into_c_string`
* `OsString::into_boxed_os_str`
* `OsStr::into_os_string`
* `PathBuf::into_boxed_path`
* `PathBuf::into_path_buf`

Closes #40380
2017-07-25 07:09:31 -07:00
Alex Crichton
46de2af063 std: Stabilize str_checked_slicing feature
Stabilized

* `<str>::get`
* `<str>::get_mut`
* `<str>::get_unchecked`
* `<str>::get_unchecked_mut`

Closes #39932
2017-07-25 07:09:31 -07:00
Alex Crichton
64c1b23374 std: Stabilize option_entry feature
Stabilized:

* `Option::get_or_insert`
* `Option::get_or_insert_with`

Closes #39288
2017-07-25 07:09:31 -07:00