]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoerase types in the move-path abstract domain
Ariel Ben-Yehuda [Thu, 27 Jul 2017 20:12:08 +0000 (23:12 +0300)]
erase types in the move-path abstract domain

Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.

6 years agoAuto merge of #43498 - joshtriplett:fix-notices, r=aturon
bors [Thu, 27 Jul 2017 14:10:19 +0000 (14:10 +0000)]
Auto merge of #43498 - joshtriplett:fix-notices, r=aturon

Copyright/license headers

(As discussed with @aturon and @est31. CC @rust-lang/core.)

Currently, rust-lang/rust includes notices that say things like
```
The Rust Project is copyright 2010, The Rust Project
Developers.
```
or
```
Copyright (c) 2010 The Rust Project Developers
```
or
```
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
```

These notices aren't accurate. "Copyright YYYY Some Name" has a specific legal meaning, and "The Rust Project Developers" isn't a legal entity. In practice, the actual legal structure is that all Rust contributors retain their copyrights when contributing to Rust, and just license them under MIT/Apache-2.0. Our legal notices should reflect that.

This came up because of RFC 2044, which proposed fixing this for the RFC repository. That effort started out by copying the rust-lang/rust notices, propagating this issue.

Based on discussion with @aturon, the two of us propose the following:

- Delete the per-file notices entirely, for any files licensed under the standard terms. (Keep notices for anything that's *not* MIT/Apache-2.0.)
  - An alternative to that would be to just delete the first paragraph of the standard notice, and keep the second paragraph that points to the MIT and Apache 2.0 licenses.
- Delete the first paragraph of LICENSE-MIT (the inaccurate pseudo-copyright line), leaving only the text of the MIT license.
- Edit the COPYRIGHT file to more accurately describe the situation (changing the pseudo-copyright line immediately under "longer version", and editing the text that starts with "additional copyright may be ...", to just always state that copyrights are retained by the Rust contributors, and licensed under MIT/Apache-2.0 (with the exceptions to that explicitly noted in that file).

If @rust-lang/core is fine with this proposal, I'd be happy to provide a pull request with the proposed fixes.

6 years agoAuto merge of #43489 - petrochenkov:mutref, r=GuillaumeGomez
bors [Thu, 27 Jul 2017 11:40:12 +0000 (11:40 +0000)]
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

6 years agoAuto merge of #43479 - ivanbakel:loop_borrow_msg, r=estebank
bors [Thu, 27 Jul 2017 07:54:15 +0000 (07:54 +0000)]
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.

6 years agoAuto merge of #43477 - est31:master, r=alexcrichton
bors [Thu, 27 Jul 2017 04:25:37 +0000 (04:25 +0000)]
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.

6 years agoAuto merge of #43445 - zackmdavis:rustdoc_major_section_self-links, r=GuillaumeGomez
bors [Thu, 27 Jul 2017 02:05:54 +0000 (02:05 +0000)]
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.

6 years agoAdded tests for new loop borrow message
Isaac van Bakel [Thu, 27 Jul 2017 01:43:11 +0000 (02:43 +0100)]
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.

6 years agoCOPYRIGHT: Provide a better explanation of Rust copyrights
Josh Triplett [Wed, 26 Jul 2017 23:45:28 +0000 (16:45 -0700)]
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).

6 years agoLICENSE-MIT: Remove inaccurate (misattributed) copyright notice
Josh Triplett [Wed, 26 Jul 2017 23:34:15 +0000 (16:34 -0700)]
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.

6 years agoAuto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon
bors [Wed, 26 Jul 2017 23:40:48 +0000 (23:40 +0000)]
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

6 years agoAuto merge of #43487 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Wed, 26 Jul 2017 21:08:38 +0000 (21:08 +0000)]
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:

6 years agoAuto merge of #42059 - derekdreery:bugfix/fix_emscripten_tests, r=alexcrichton
bors [Wed, 26 Jul 2017 18:27:19 +0000 (18:27 +0000)]
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.

6 years agoBetter diagnostics and recovery for `mut ref` in patterns
Vadim Petrochenkov [Wed, 26 Jul 2017 15:59:07 +0000 (18:59 +0300)]
Better diagnostics and recovery for `mut ref` in patterns

6 years agoAuto merge of #43485 - nrc:rls-env-fix, r=Mark-Simulacrum
bors [Wed, 26 Jul 2017 14:08:50 +0000 (14:08 +0000)]
Auto merge of #43485 - nrc:rls-env-fix, r=Mark-Simulacrum

Update RLS

This pulls in https://github.com/rust-lang-nursery/rls/commit/79d659e5699fbf7db5b4819e9a442fb3f550472a 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

6 years agoRollup merge of #43480 - dhduvall:sparc-blake2b, r=eddyb
Mark Simulacrum [Wed, 26 Jul 2017 12:15:09 +0000 (06:15 -0600)]
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

6 years agoRollup merge of #43471 - ollie27:try_from_ints, r=nagisa
Mark Simulacrum [Wed, 26 Jul 2017 12:15:08 +0000 (06:15 -0600)]
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

6 years agoRollup merge of #43465 - topecongiro:needs-test, r=Mark-Simulacrum
Mark Simulacrum [Wed, 26 Jul 2017 12:15:07 +0000 (06:15 -0600)]
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.

6 years agoRollup merge of #43463 - nrc:catch-span, r=petrochenkov
Mark Simulacrum [Wed, 26 Jul 2017 12:15:06 +0000 (06:15 -0600)]
Rollup merge of #43463 - nrc:catch-span, r=petrochenkov

Fix the spans of catch blocks to include the `do`

6 years agoRollup merge of #43462 - dhduvall:solaris-libresolv, r=aturon
Mark Simulacrum [Wed, 26 Jul 2017 12:15:05 +0000 (06:15 -0600)]
Rollup merge of #43462 - dhduvall:solaris-libresolv, r=aturon

DNS functions are in libresolv on Solaris, just like on MacOS

6 years agoRollup merge of #43458 - RalfJung:verbose, r=nikomatsakis
Mark Simulacrum [Wed, 26 Jul 2017 12:15:05 +0000 (06:15 -0600)]
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.

6 years agoRollup merge of #43456 - joshlf:spawn-doc-grammar, r=alexcrichton
Mark Simulacrum [Wed, 26 Jul 2017 12:15:04 +0000 (06:15 -0600)]
Rollup merge of #43456 - joshlf:spawn-doc-grammar, r=alexcrichton

std::thread::spawn: Fix grammar in documentation

Closes #43435.

6 years agoRollup merge of #43455 - QuietMisdreavus:extend-spec-docs, r=steveklabnik
Mark Simulacrum [Wed, 26 Jul 2017 12:15:03 +0000 (06:15 -0600)]
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](https://github.com/rust-lang/rust/blob/5669c9988f50788b5ab5dee2d4538519d4e5663d/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.

6 years agoRollup merge of #43447 - estebank:import-span, r=nikomatsakis
Mark Simulacrum [Wed, 26 Jul 2017 12:15:02 +0000 (06:15 -0600)]
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.

6 years agoRollup merge of #42959 - SimonSapin:nonzero-checked, r=sfackler
Mark Simulacrum [Wed, 26 Jul 2017 12:15:01 +0000 (06:15 -0600)]
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.

6 years agoRemove custom node script
Richard Dodd [Wed, 26 Jul 2017 08:43:09 +0000 (09:43 +0100)]
Remove custom node script

6 years agoUpdate RLS
Nick Cameron [Tue, 25 Jul 2017 23:27:27 +0000 (11:27 +1200)]
Update RLS

6 years agoPoint at path segment on module not found
Esteban Küber [Sun, 23 Jul 2017 22:15:45 +0000 (15:15 -0700)]
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`
```

6 years agoAuto merge of #43226 - alexcrichton:aarch64-ci, r=aidanhs
bors [Wed, 26 Jul 2017 03:53:46 +0000 (03:53 +0000)]
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

6 years agoAuto merge of #43046 - milmazz:bootstrap-unittest, r=aidanhs
bors [Tue, 25 Jul 2017 23:46:14 +0000 (23:46 +0000)]
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

6 years agoConstrain the layout of Blake2bCtx for proper SPARC compilation
Danek Duvall [Tue, 25 Jul 2017 21:32:08 +0000 (14:32 -0700)]
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

6 years agoSwitch to begin_panic again
est31 [Tue, 25 Jul 2017 20:10:10 +0000 (22:10 +0200)]
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.

6 years agoModified error for loop mut borrow conflicts
Isaac van Bakel [Tue, 25 Jul 2017 00:13:18 +0000 (01:13 +0100)]
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.

6 years agoAuto merge of #43320 - alexcrichton:new-bootstrap, r=Mark-Simulacrum
bors [Tue, 25 Jul 2017 16:13:16 +0000 (16:13 +0000)]
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.

6 years agoadd a note to Vec's Extend<&T> impl about its slice specialization
QuietMisdreavus [Mon, 24 Jul 2017 15:16:16 +0000 (10:16 -0500)]
add a note to Vec's Extend<&T> impl about its slice specialization

6 years agostd: Stabilize the `str_{mut,box}_extras` feature
Alex Crichton [Thu, 20 Jul 2017 22:52:12 +0000 (15:52 -0700)]
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

6 years agoStabilize the `compile_error_macro` feature
Alex Crichton [Thu, 20 Jul 2017 22:50:33 +0000 (15:50 -0700)]
Stabilize the `compile_error_macro` feature

Stabilizes:

* `compile_error!` as a macro defined by rustc

Closes #40872

6 years agostd: Stabilize `manually_drop` feature
Alex Crichton [Thu, 20 Jul 2017 22:48:15 +0000 (15:48 -0700)]
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

6 years agostd: Stabilize `utf8_error_error_len` feature
Alex Crichton [Thu, 20 Jul 2017 22:46:46 +0000 (15:46 -0700)]
std: Stabilize `utf8_error_error_len` feature

Stabilizes:

* `Utf8Error::error_len`

Closes #40494

6 years agostd: Stabilize CString/OsString/PathBuf extra methods
Alex Crichton [Thu, 20 Jul 2017 22:44:35 +0000 (15:44 -0700)]
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

6 years agostd: Stabilize `str_checked_slicing` feature
Alex Crichton [Thu, 20 Jul 2017 22:42:14 +0000 (15:42 -0700)]
std: Stabilize `str_checked_slicing` feature

Stabilized

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

Closes #39932

6 years agostd: Stabilize `option_entry` feature
Alex Crichton [Thu, 20 Jul 2017 22:40:23 +0000 (15:40 -0700)]
std: Stabilize `option_entry` feature

Stabilized:

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

Closes #39288

6 years agostd: Stabilize `char_escape_debug`
Alex Crichton [Thu, 20 Jul 2017 22:38:59 +0000 (15:38 -0700)]
std: Stabilize `char_escape_debug`

Stabilizes:

* `<char>::escape_debug`
* `std::char::EscapeDebug`

Closes #35068

6 years agoBump master to 1.21.0
Alex Crichton [Mon, 17 Jul 2017 16:32:08 +0000 (09:32 -0700)]
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.

6 years agoAuto merge of #43419 - lu-zero:master, r=alexcrichton
bors [Tue, 25 Jul 2017 13:36:13 +0000 (13:36 +0000)]
Auto merge of #43419 - lu-zero:master, r=alexcrichton

Add support for the VSX and Altivec features on PowerPC

6 years agobootstrap: Major refactoring
Milton Mazzarri [Mon, 3 Jul 2017 04:32:42 +0000 (23:32 -0500)]
bootstrap: Major refactoring

This commit includes the following:

* Fix syntax errors in Python 3
* Include more docstrings in classes, methods, and functions
* Include unit tests using `unittest`
* Merge implementation of `{rustc,cargo}_out_of_date`
* Merge implementation of `RustBuild.{cargo,rustc}`
* Remove unnecessary source code
* Move all the attributes defined outside of `__init__`
* Remove remaining `%s` from print function
* Remove `WindowsError` reference on non-windows systems
* Rename some variables to be more explicit avoid their meaning
* Run bootstrap tests in the CI process
* Remove non-pythonic getters
* Remove duplicate code in `download_stage0` method
* Reduce the number of branches in `build_bootstrap` method
* Re-raise exception when we cannot execute uname in non-windows systems
* Avoid long lines

6 years agoAuto merge of #43384 - segevfiner:bootstrap-build-argument-fix, r=aidanhs
bors [Tue, 25 Jul 2017 08:04:15 +0000 (08:04 +0000)]
Auto merge of #43384 - segevfiner:bootstrap-build-argument-fix, r=aidanhs

rustbuild: Fix the --build argument to bootstrap.py

This makes the --build argument also apply for the downloading of the stage0 toolchain and building rustbuild.

Fixes #42116

6 years agoAdd missing impl and tests for int to int TryFrom impls
Oliver Middleton [Tue, 25 Jul 2017 05:19:30 +0000 (06:19 +0100)]
Add missing impl and tests for int to int TryFrom impls

6 years agoAuto merge of #43325 - ollie27:overflowing_literals, r=arielb1
bors [Tue, 25 Jul 2017 04:00:19 +0000 (04:00 +0000)]
Auto merge of #43325 - ollie27:overflowing_literals, r=arielb1

Fix overflowing_literals lint for large f32s

Float literals need to be parsed as the correct type so they can be
rounded correctly.

6 years agoAdd tests for issues with the E-needstest label
topecongiro [Tue, 25 Jul 2017 02:31:59 +0000 (11:31 +0900)]
Add tests for issues with the E-needstest label

6 years agoAuto merge of #43248 - llogiq:num-try-from, r=nagisa
bors [Tue, 25 Jul 2017 00:48:14 +0000 (00:48 +0000)]
Auto merge of #43248 - llogiq:num-try-from, r=nagisa

improve the TryFrom implementations

This removes the need for a 128 bit storage by making use of the fact that there can be either no over/underflow, either one or both, and each time the target type suffices to hold the limit for comparison. This also means that the implementation will work in targets without 128bit support (unless it's for 128bit types, of course).

The downside is that the code looks a bit more complex.

6 years agoFix the spans of catch blocks to include the `do`
Nick Cameron [Mon, 24 Jul 2017 23:39:41 +0000 (11:39 +1200)]
Fix the spans of catch blocks to include the `do`

6 years agoavoid printing 'static
Ralf Jung [Mon, 24 Jul 2017 23:32:11 +0000 (16:32 -0700)]
avoid printing 'static

6 years agoAdd a disabled builder for aarch64 emulated tests
Alex Crichton [Thu, 13 Jul 2017 21:17:33 +0000 (14:17 -0700)]
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

6 years agoDNS functions are in libresolv on Solaris, just like on MacOS
Danek Duvall [Mon, 24 Jul 2017 22:57:57 +0000 (15:57 -0700)]
DNS functions are in libresolv on Solaris, just like on MacOS

6 years agoFix printing regions with -Z verbose
Ralf Jung [Mon, 24 Jul 2017 20:43:05 +0000 (13:43 -0700)]
Fix printing regions with -Z verbose

6 years agoimprove the TryFrom implementations
Andre Bogus [Sat, 15 Jul 2017 06:35:25 +0000 (08:35 +0200)]
improve the TryFrom implementations

This removes the need for a 128 bit storage by making use of the fact that
there can be either no over/underflow, either one or both, and each time
the target type suffices to hold the limit for comparison.

The downside is that the code looks a bit more complex.

This test code included in this commit is from @oyvindln 's PR. They also
greatly helped fixing a number of errors I made along the way. Thanks a lot!

6 years agoAuto merge of #43454 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Mon, 24 Jul 2017 20:15:21 +0000 (20:15 +0000)]
Auto merge of #43454 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 11 pull requests

- Successful merges: #43297, #43322, #43342, #43361, #43366, #43374, #43379, #43401, #43421, #43428, #43446
- Failed merges:

6 years agostd::thread::spawn: Fix grammar in documentation
Joshua Liebow-Feeser [Mon, 24 Jul 2017 18:17:29 +0000 (11:17 -0700)]
std::thread::spawn: Fix grammar in documentation

6 years agoAuto merge of #43430 - Mark-Simulacrum:rustbuild-fixes, r=alexcrichton
bors [Mon, 24 Jul 2017 17:21:04 +0000 (17:21 +0000)]
Auto merge of #43430 - Mark-Simulacrum:rustbuild-fixes, r=alexcrichton

Rustbuild regression fixes

I believe this will fix https://github.com/rust-lang/rust/issues/43427.

This PR also avoids running pretty tests by-default.

r? @alexcrichton

6 years agoRollup merge of #43446 - zackmdavis:rustdoc_sidebar_unions, r=GuillaumeGomez
Mark Simulacrum [Mon, 24 Jul 2017 15:16:39 +0000 (09:16 -0600)]
Rollup merge of #43446 - zackmdavis:rustdoc_sidebar_unions, r=GuillaumeGomez

rustdoc: add unions to whitelist of sidebar types

This resolves #43405.

6 years agoRollup merge of #43428 - waywardmonkeys:doc-fixes, r=estebank
Mark Simulacrum [Mon, 24 Jul 2017 15:16:38 +0000 (09:16 -0600)]
Rollup merge of #43428 - waywardmonkeys:doc-fixes, r=estebank

Fix some doc/comment typos.

6 years agoRollup merge of #43421 - alexcrichton:add-some-build-scripts, r=Mark-Simulacrum
Mark Simulacrum [Mon, 24 Jul 2017 15:16:37 +0000 (09:16 -0600)]
Rollup merge of #43421 - alexcrichton:add-some-build-scripts, r=Mark-Simulacrum

rustc: Add some build scripts for librustc crates

This commit adds some "boilerplate" build scripts to librustc/libsyntax crates
to declare dependencies on various environment variables that are configured
throughout the build. Cargo recently gained the ability to depend on environment
variables in build scripts which can help trigger recompilation of a crate.

This should fix weird bugs where after you make a commit or a few days later
you'll get weird "not built with the same compiler" errors hopefully.

6 years agoRollup merge of #43401 - cuviper:homogeneous, r=Mark-Simulacrum
Mark Simulacrum [Mon, 24 Jul 2017 15:16:36 +0000 (09:16 -0600)]
Rollup merge of #43401 - cuviper:homogeneous, r=Mark-Simulacrum

Correct the spelling of "homogeneous"

None

6 years agoRollup merge of #43379 - s3rvac:fix-exit-status-success-description, r=GuillaumeGomez
Mark Simulacrum [Mon, 24 Jul 2017 15:16:35 +0000 (09:16 -0600)]
Rollup merge of #43379 - s3rvac:fix-exit-status-success-description, r=GuillaumeGomez

Add a missing verb to the description of std::process::ExitStatus::success()

"Signal termination not considered" -> "Signal termination **is** not considered"

The first line of the description was rewrapped so it fits into 80 characters.

6 years agoRollup merge of #43374 - stjepang:fix-sort-randomization-comment, r=alexcrichton
Mark Simulacrum [Mon, 24 Jul 2017 15:16:34 +0000 (09:16 -0600)]
Rollup merge of #43374 - stjepang:fix-sort-randomization-comment, r=alexcrichton

Clarify that sort_unstable is deterministic

@frankmcsherry complained that the documentation said "it is randomized but deterministic", which is a contradictory statement.

This PR uses a different and clearer wording.

6 years agoRollup merge of #43366 - leshow:bufreader-docs, r=aturon
Mark Simulacrum [Mon, 24 Jul 2017 15:16:33 +0000 (09:16 -0600)]
Rollup merge of #43366 - leshow:bufreader-docs, r=aturon

Fix docs: BufReader/File doesn't need to be mut

Neither `BufReader` nor `File` need to be declared `mut` for most of these examples. The cookbook example using `BufReader` doesn't declare them as `mut` either (https://brson.github.io/rust-cookbook/basics.html#ex-std-read-lines).

6 years agoRollup merge of #43361 - michaelwoerister:remove-retrace-path, r=nikomatsakis
Mark Simulacrum [Mon, 24 Jul 2017 15:16:32 +0000 (09:16 -0600)]
Rollup merge of #43361 - michaelwoerister:remove-retrace-path, r=nikomatsakis

Remove unused DefPathTable::retrace_path()

`DefPathTable::retrace_path()` is not used anymore for a while now and removing it also removes the need to build the costly `DefPathTable::key_to_index` map for every upstream crate.

cc #43300

r? @eddyb

6 years agoRollup merge of #43342 - ranweiler:no-std-exe-docs, r=alexcrichton
Mark Simulacrum [Mon, 24 Jul 2017 15:16:32 +0000 (09:16 -0600)]
Rollup merge of #43342 - ranweiler:no-std-exe-docs, r=alexcrichton

Document use of `compiler_builtins` with `no_std` binaries

See discussion in #43264.

The docs for the `compiler_builtins_lib` feature were removed in
PR #42899. But, though the `compiler_builtins` library has been
migrated out-of-tree, the language feature remains, and is needed to
use the stand-alone crate. So, we reintroduce the docs for the
feature, and add a reference to them when describing how to create a
`no_std` executable.

6 years agoRollup merge of #43322 - redox-os:redox_liblibc, r=alexcrichton
Mark Simulacrum [Mon, 24 Jul 2017 15:16:31 +0000 (09:16 -0600)]
Rollup merge of #43322 - redox-os:redox_liblibc, r=alexcrichton

Update liblibc

This updates liblibc to the latest master and fixes #43305

6 years agoRollup merge of #43297 - infinity0:master, r=alexcrichton
Mark Simulacrum [Mon, 24 Jul 2017 15:16:30 +0000 (09:16 -0600)]
Rollup merge of #43297 - infinity0:master, r=alexcrichton

configure: allow distros to disable debuginfo-only-std

This allows builders to generate debugging information for everything, even in a stable release build. This is useful for distros like Fedora (already carrying a [similar patch](https://src.fedoraproject.org/cgit/rpms/rust.git/tree/rust-1.16.0-configure-no-override.patch)) and Debian that automatically put all debuginfo in separate "debug symbol" packages.

This commit preserves the default behaviour of switching these on when a non-dev channel is selected, but allows the user to override this via the `./configure` command line.

In theory, one could also do this via `bootstrap/config.toml` but it doesn't work currently due to #43295.

6 years agoMake dist equivalent to old build system.
Mark Simulacrum [Sun, 23 Jul 2017 16:03:40 +0000 (10:03 -0600)]
Make dist equivalent to old build system.

6 years agoAuto merge of #43436 - zackmdavis:union_doc_fields_section_layout, r=GuillaumeGomez
bors [Mon, 24 Jul 2017 11:44:11 +0000 (11:44 +0000)]
Auto merge of #43436 - zackmdavis:union_doc_fields_section_layout, r=GuillaumeGomez

rustdoc: fix layout of Fields section in documentation for unions

Previously, the union fields would all render on the same line with
hideous spacing; comparison to the analogous section for structs makes
it undoubtable that `display: block` is the true intent.

Concisely and definitively resolves #43404 and its perfidious
malignancy.

6 years agoAdd support for PowerPC Altivec/VSX intrinsics
Luca Barbato [Mon, 24 Jul 2017 00:23:24 +0000 (00:23 +0000)]
Add support for PowerPC Altivec/VSX intrinsics

6 years agoAuto merge of #43327 - nrc:rls-config, r=eddyb
bors [Mon, 24 Jul 2017 07:29:25 +0000 (07:29 +0000)]
Auto merge of #43327 - nrc:rls-config, r=eddyb

Use a config struct for save-analysis

Replaces some existing customisation options, including removing the -Zsave-analysis-api flag

r? @eddyb

6 years agoMake keep_ast configurable by driver clients
Nick Cameron [Mon, 24 Jul 2017 05:06:42 +0000 (17:06 +1200)]
Make keep_ast configurable by driver clients

6 years agoCatch a panic in save-analysis
Nick Cameron [Mon, 24 Jul 2017 01:54:38 +0000 (13:54 +1200)]
Catch a panic in save-analysis

6 years agoRemove save-analysis-api references from tests and rustbuild
Nick Cameron [Fri, 21 Jul 2017 22:33:12 +0000 (10:33 +1200)]
Remove save-analysis-api references from tests and rustbuild

6 years agoPoint RLS submodule at a branch with required changes
Nick Cameron [Wed, 19 Jul 2017 01:32:12 +0000 (13:32 +1200)]
Point RLS submodule at a branch with required changes

And cargo update

6 years agoAuto merge of #43280 - lfairy:token-tree-iter-clone, r=nrc
bors [Mon, 24 Jul 2017 04:59:46 +0000 (04:59 +0000)]
Auto merge of #43280 - lfairy:token-tree-iter-clone, r=nrc

Add #[derive(Clone)] to TokenTreeIter

I've found this useful for writing backtracking parsers.

The underlying `Cursor` implements `Clone` already, so it's just a matter of adding `#[derive(Clone)]` to the type.

r? @jseyfried

6 years agoAuto merge of #43413 - mandeep:ops-generics, r=alexcrichton
bors [Mon, 24 Jul 2017 00:24:16 +0000 (00:24 +0000)]
Auto merge of #43413 - mandeep:ops-generics, r=alexcrichton

Add generic example of std::ops::Sub in doc comments

This PR adds an example of using generics with std::ops::Sub and is a follow up of PR #41612 and is related to issue #29365. I also wanted to add examples to Mul and Div, but I think these two traits are already loaded with examples.

6 years agorustdoc: add unions to whitelist of sidebar types
Zack M. Davis [Mon, 24 Jul 2017 00:18:58 +0000 (17:18 -0700)]
rustdoc: add unions to whitelist of sidebar types

This resolves #43405.

6 years agorustdoc: make major section headers self-links
Zack M. Davis [Sun, 23 Jul 2017 22:02:06 +0000 (15:02 -0700)]
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).

This should address most of #24484.

6 years agoAuto merge of #43096 - estebank:ascription-help, r=nikomatsakis
bors [Sun, 23 Jul 2017 20:56:20 +0000 (20:56 +0000)]
Auto merge of #43096 - estebank:ascription-help, r=nikomatsakis

Point at `:` when using it instead of `;`

When triggering type ascription in such a way that we can infer a
statement end was intended, add a suggestion for the change. Always
point out the reason for the expectation of a type is due to type
ascription.

Fix #42057, #41928.

6 years agorustdoc: fix layout of Fields section in documentation for unions
Zack M. Davis [Sun, 23 Jul 2017 18:27:27 +0000 (11:27 -0700)]
rustdoc: fix layout of Fields section in documentation for unions

Previously, the union fields would all render on the same line with
hideous spacing; comparison to the analogous section for structs makes
it undoubtable that `display: block` is the true intent.

Concisely and definitively resolves #43404 and its perfidious
malignancy.

6 years agoAuto merge of #43386 - oli-obk:suggestions, r=nikomatsakis
bors [Sun, 23 Jul 2017 18:13:20 +0000 (18:13 +0000)]
Auto merge of #43386 - oli-obk:suggestions, r=nikomatsakis

Adjust new suggestions to the suggestion guidelines

Addresses https://github.com/rust-lang/rust/pull/42033#discussion_r127694915

guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224

6 years agoDo not run pretty tests by default.
Mark Simulacrum [Sun, 23 Jul 2017 13:22:12 +0000 (07:22 -0600)]
Do not run pretty tests by default.

6 years agoFix some doc/comment typos.
Bruce Mitchener [Sun, 23 Jul 2017 15:06:16 +0000 (22:06 +0700)]
Fix some doc/comment typos.

6 years agoAuto merge of #43416 - tshepang:extra-layer, r=alexcrichton
bors [Sun, 23 Jul 2017 13:04:12 +0000 (13:04 +0000)]
Auto merge of #43416 - tshepang:extra-layer, r=alexcrichton

doc: provide an actual equivalent to filter_map

6 years agoAuto merge of #43256 - Others:patch-1, r=steveklabnik
bors [Sun, 23 Jul 2017 09:26:50 +0000 (09:26 +0000)]
Auto merge of #43256 - Others:patch-1, r=steveklabnik

Improve panic docs for Instant::duration_since

The docs for Instant::duration_since has a confusing section on panicking. It's
much more clear without the second two sentences of description.

6 years agorustc: Add some build scripts for librustc crates
Alex Crichton [Sat, 22 Jul 2017 04:22:26 +0000 (21:22 -0700)]
rustc: Add some build scripts for librustc crates

This commit adds some "boilerplate" build scripts to librustc/libsyntax crates
to declare dependencies on various environment variables that are configured
throughout the build. Cargo recently gained the ability to depend on environment
variables in build scripts which can help trigger recompilation of a crate.

This should fix weird bugs where after you make a commit or a few days later
you'll get weird "not built with the same compiler" errors hopefully.

6 years agoAuto merge of #43406 - canndrew:never-impl-clone, r=alexcrichton
bors [Sun, 23 Jul 2017 04:25:39 +0000 (04:25 +0000)]
Auto merge of #43406 - canndrew:never-impl-clone, r=alexcrichton

Add missing `!: Clone` impl

Fixes #43296

(untested because I'm having computer troubles, but a one-liner can't break anything right?)

6 years agoAuto merge of #43387 - TimNN:rustllvm50, r=alexcrichton
bors [Sun, 23 Jul 2017 01:57:37 +0000 (01:57 +0000)]
Auto merge of #43387 - TimNN:rustllvm50, r=alexcrichton

Update Rust LLVM bindings for LLVM 5.0

This is the initial set of changes to update the rust llvm bindings for 5.0. The llvm commits necessitating these changes are linked from the tracking issue, #43370.

6 years agoAdd support for the VSX and Altivec features on PowerPC
Luca Barbato [Sun, 23 Jul 2017 00:16:43 +0000 (00:16 +0000)]
Add support for the VSX and Altivec features on PowerPC

6 years agoAuto merge of #43382 - mmatyas:aarch64_ignore-stack-probes, r=alexcrichton
bors [Sat, 22 Jul 2017 23:24:09 +0000 (23:24 +0000)]
Auto merge of #43382 - mmatyas:aarch64_ignore-stack-probes, r=alexcrichton

Ignore stack probe tests on AArch64

Stack probes are only implemented for x86, and as such currently fail on AArch64. This patch ignores those tests on this architecture.

Fixes #43356.

r? @alexcrichton

6 years agodoc: provide an actual equivalent to filter_map
Tshepang Lekhonkhobe [Sat, 22 Jul 2017 21:22:01 +0000 (23:22 +0200)]
doc: provide an actual equivalent to filter_map

6 years agoRemove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs
Simon Sapin [Mon, 17 Jul 2017 12:52:36 +0000 (14:52 +0200)]
Remove unnecessary unsafe in test/ui/print_type_sizes/nullable.rs

6 years agoDon’t create NonZero(0) in test/ui/print_type_sizes/nullable.rs
Simon Sapin [Mon, 17 Jul 2017 12:49:19 +0000 (14:49 +0200)]
Don’t create NonZero(0) in test/ui/print_type_sizes/nullable.rs

6 years agoFix unstable feature name for some impls for Unique<T>
Simon Sapin [Mon, 17 Jul 2017 12:45:38 +0000 (14:45 +0200)]
Fix unstable feature name for some impls for Unique<T>

6 years agoUse safe conversion instead of unsafe constructor in issue-23433 test
Simon Sapin [Mon, 17 Jul 2017 12:38:20 +0000 (14:38 +0200)]
Use safe conversion instead of unsafe constructor in issue-23433 test

6 years agoUse checked NonZero constructor in MIR move path indices
Simon Sapin [Mon, 17 Jul 2017 12:32:37 +0000 (14:32 +0200)]
Use checked NonZero constructor in MIR move path indices

… to protect against UB in the unlikely case that `idx + 1` overflows.