Commit Graph

66011 Commits

Author SHA1 Message Date
gaurikholkar
4fb1808ab6 Adding E0623, to detect missing lifetimes when both regions are anonymous 2017-07-28 08:51:58 +05:30
bors
8a78a12a55 Auto merge of #43438 - petrochenkov:path, r=jseyfried
syntax: Simplify parsing of paths

Discern between `Path` and `Path<>` in AST (but not in HIR).
Give span to angle bracketed generic arguments (`::<'a, T>` in `path::segment::<'a, T>`).

This is a refactoring in preparation for https://internals.rust-lang.org/t/macro-path-uses-novel-syntax/5561/3, but it doesn't add anything to the grammar yet.

r? @jseyfried
2017-07-27 22:22:01 +00:00
Vadim Petrochenkov
1e8a7f68e9 Avoid duplicated errors for generic arguments in macro paths 2017-07-27 23:01:17 +03:00
Vadim Petrochenkov
128f565dae Give span to angle bracketed generic arguments 2017-07-27 22:59:35 +03:00
Vadim Petrochenkov
ce3beb609f Discern between Path and Path<> in AST 2017-07-27 22:59:35 +03:00
Vadim Petrochenkov
da77a1a0ac Simplify parsing of paths 2017-07-27 22:59:34 +03:00
bors
52a3309695 Auto merge of #43443 - bitshifter:issue-43317, r=nikomatsakis
Improve checking of conflicting packed and align representation hints on structs and unions.

Fixes #43317 and improves #33626.
2017-07-27 19:48:13 +00:00
bors
5cc1baa290 Auto merge of #43482 - Mark-Simulacrum:single-rustdoc, r=alexcrichton
Compile rustdoc on-demand

Fixes #43284, fixes #38318, and fixes #39505.

Doesn't directly help with https://github.com/rust-lang/rust/issues/42686, since we need to rebuild just as much. In fact, this hurts it, since `./x.py doc --stage 0` will now fail. I'm not sure if it did before, but with these changes it runs into the problem where we attempt to use artifacts from bootstrap rustc with a non-bootstrap rustdoc, running into version conflicts. I believe this is solvable, but leaving for a future PR.

This means that rustdoc will no longer be compiled when compiling rustc, by default. However, it is still built from `./x.py build` (for hosts, but not targets, since we don't produce compiler toolchains for them) and will be built for doc tests and crate tests.

After this, the recommended workflow if you want a rustdoc is: `./x.py build --stage 1 src/tools/rustdoc` which will give you a working rustdoc in `build/triple/stage1/bin/rustdoc`. Note that you can add `src/libstd` onto the command to compile libstd as well so that the rustdoc can easily compile crates in the wild. `./x.py doc --stage 1 src/libstd` will document `libstd` with a freshly built rustdoc (if necessary), and will not rebuild rustc on modifications to rustdoc.

r? @alexcrichton
2017-07-27 17:07:58 +00:00
Mark Simulacrum
9ee877bbe6 Correct a few run.host invocations where run.target is intended. 2017-07-27 09:58:03 -06: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
Mark Simulacrum
3c43163da7 Explain why we subtract one from the stage 2017-07-27 05:51:23 -06:00
Mark Simulacrum
cb27faf70f Make sure CFG_RELEASE_CHANNEL is always set.
Previously we'd build libsyntax without it when documenting and that'd
cause us to recompile it when building normally for no reason.
2017-07-27 05:51:23 -06:00
Mark Simulacrum
3b90551610 Allow changing rustdoc which builds the book. 2017-07-27 05:51:23 -06:00
Mark Simulacrum
4e5333cb2b Don't needlessly build rustdoc for compiletest.
For most tests, rustdoc isn't needed, so avoid building it.
2017-07-27 05:51:22 -06:00
Mark Simulacrum
e2e9b40e9a Build rustdoc on-demand.
Rustdoc is no longer compiled in every stage, alongside rustc, instead
it is only compiled when requested, and generally only for the last
stage.
2017-07-27 05:51:22 -06:00
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
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