Commit Graph

65997 Commits

Author SHA1 Message Date
Guillaume Gomez
2f2623b79d Update tests 2017-07-27 20:40:20 +02:00
Guillaume Gomez
1cebf98e4c Make a lint instead 2017-07-27 20:38:33 +02:00
Guillaume Gomez
b68a03bded Change doc comment to code comment 2017-07-27 20:38:32 +02:00
Guillaume Gomez
7e70a63e61 Throw errors when doc comments are added where they're unused 2017-07-27 20:38:32 +02:00
bors
0565653eec 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.
2017-07-27 14:10:19 +00: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
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
Vadim Petrochenkov
dda30f6902 Better diagnostics and recovery for mut ref in patterns 2017-07-26 18:59:07 +03: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
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
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
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
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
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
Alex Crichton
4c9c6e824b std: Stabilize char_escape_debug
Stabilizes:

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

Closes #35068
2017-07-25 07:09:31 -07:00
Alex Crichton
9010567dcc 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 07:03:19 -07:00
bors
a643bdc681 Auto merge of #43419 - lu-zero:master, r=alexcrichton
Add support for the VSX and Altivec features on PowerPC
2017-07-25 13:36:13 +00:00
Milton Mazzarri
f516765b94 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
2017-07-25 06:37:10 -05:00
bors
5c126bdee6 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
2017-07-25 08:04:15 +00:00
Oliver Middleton
9ea65a8a71 Add missing impl and tests for int to int TryFrom impls 2017-07-25 06:19:30 +01:00