Commit Graph

80283 Commits

Author SHA1 Message Date
David Wood
7eba13f451
Correctly handle an activation from dead code. 2018-07-04 20:08:15 +01:00
bors
4af9132a02 Auto merge of #51611 - QuietMisdreavus:slippery-macros, r=ollie27
rustdoc: import cross-crate macros alongside everything else

The thrilling conclusion of the cross-crate macro saga in rustdoc! After https://github.com/rust-lang/rust/pull/51425 made sure we saw all the namespaces of an import (and prevented us from losing the `vec!` macro in std's documentation), here is the PR to handle cross-crate macro re-exports at the same time as everything else. This way, attributes like `#[doc(hidden)]` and `#[doc(no_inline)]` can be used to control how the documentation for these macros is seen, rather than rustdoc inlining every macro every time.

Fixes https://github.com/rust-lang/rust/issues/50647
2018-07-04 18:15:14 +00:00
Lucas Morales
ff2ff2b2b8
rustdoc book on codeblock hash escaping 2018-07-04 12:41:45 -04:00
bors
0ad8f9e5b1 Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapin
Add #[repr(transparent)] to some libcore types

* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`

CC https://github.com/rust-lang/rust/issues/43036
2018-07-04 16:21:42 +00:00
CrLF0710
30063ae2a5
Shorten the line
Shorten the line to make tidy happy.
2018-07-04 23:36:51 +08:00
CrLF0710
1dae60ea4c
Include VS 2017 in error message.
Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-04 22:49:35 +08:00
bors
eded1aa14c Auto merge of #51870 - nnethercote:reuse-DefsUsesVisitor, r=nikomatsakis
Reuse the `DefsUsesVisitor` in `simulate_block()`.

This avoids a bunch of allocations for the bitsets within it,
speeding up a number of NLL benchmarks, the best by 1%.

r? @nikomatsakis
2018-07-04 14:12:14 +00:00
flip1995
c3949009ad
Improving span of unknown lint tool error message 2018-07-04 14:28:44 +02:00
bors
a22bcd8aab Auto merge of #51935 - cramertj:unpin-references, r=withoutboats
Unpin references

I also considered adding an impl for raw pointers as well, but that makes it easy to accidentally have unsound owning-collections that might otherwise be able to project pinned-ness (e.g. `Box`).

cc @RalfJung

r? @withoutboats
2018-07-04 11:32:40 +00:00
flip1995
a9634fcd01
Unstable book documentation of tool lints 2018-07-04 12:16:46 +02:00
flip1995
dddb8d2eba
Implementation of tool lints 2018-07-04 12:16:46 +02:00
flip1995
ed29e86c39
Tests for tool_lints 2018-07-04 12:16:45 +02:00
bors
8dd715ee5e Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm
Move self trait predicate to items

This is a "reimagination" of @tmandry's PR #50183. The main effect is described in this comment from one of the commits:

---

Before we had the following results for `predicates_of`:

```rust
trait Foo { // predicates_of: Self: Foo
  fn bar(); // predicates_of: Self: Foo (inherited from trait)
}
```

Now we have removed the `Self: Foo` from the trait. However, we still
add it to the trait ITEM. This is because when people do things like
`<T as Foo>::bar()`, they still need to prove that `T: Foo`, and
having it in the `predicates_of` seems to be the cleanest way to
ensure that happens right now (otherwise, we'd need special case code
in various places):

```rust
trait Foo { // predicates_of: []
  fn bar(); // predicates_of: Self: Foo
}
```

However, we sometimes want to get the list of *just* the predicates
truly defined on a trait item (e.g., for chalk, but also for a few
other bits of code). For that, we define `predicates_defined_on`,
which does not contain the `Self: Foo` predicate yet, and we plumb
that through metadata and so forth.

---

I'm assigning @eddyb as the main reviewer, but I thought I might delegate to scalexm for this one in any case. I also want to post an alternative that I'll leave in the comments; it occurred to me as I was writing. =)

r? @eddyb
cc @scalexm @tmandry @leodasvacas
2018-07-04 09:33:33 +00:00
Niko Matsakis
727f01700b write code to extract region names and emit new style message 2018-07-04 05:09:33 -04:00
Rémy Rakic
0190286d48 NLL Liveness: Skip regionless types when visiting free regions
The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions
2018-07-04 08:50:12 +02:00
Nicholas Nethercote
b0c78120e3 Reuse the DefsUsesVisitor in simulate_block().
This avoids a bunch of allocations for the bitsets within it,
speeding up a number of NLL benchmarks, the best by 1%.
2018-07-04 13:05:03 +10:00
Alex Crichton
ef41cf0288 Compile stage0 tools with the raw bootstrap compiler
This commit updates the stage0 build of tools to use the libraries of the stage0
compiler instead of the compiled libraries by the stage0 compiler. This should
enable us to avoid any stage0 hacks (like missing SIMD).
2018-07-03 18:06:29 -07:00
bors
a739c51d10 Auto merge of #51926 - matthewjasper:Initialization-span, r=nikomatsakis
[NLL] Use better span for initializing a variable twice

Closes #51217

When assigning to a (projection from a) local immutable local which starts initialised (everything except `let PATTERN;`):

* Point to the declaration of that local
* Make the error message refer to the local, rather than the projection.

r? @nikomatsakis
2018-07-03 23:54:25 +00:00
Niko Matsakis
fa02d68eec universal_regions: rustfmt 2018-07-03 18:10:08 -04:00
Niko Matsakis
8b3ce9ca68 always create a category, even it is just "boring" 2018-07-03 18:10:08 -04:00
Niko Matsakis
aae177e005 promote error-reporting to a module 2018-07-03 18:10:08 -04:00
Niko Matsakis
351e78de26 add assert_crate_local method to ClearCrossCrate 2018-07-03 18:10:08 -04:00
Niko Matsakis
37db94d3f2 store the HirId of the upvar 2018-07-03 18:10:08 -04:00
Niko Matsakis
f03c0366ad add "free region helpers" 2018-07-03 18:10:08 -04:00
Niko Matsakis
dddd4075b1 generalize find_constraint_paths_between_regions 2018-07-03 18:10:08 -04:00
Niko Matsakis
09f431fad5 simplify and cleanup error-reporting walk code 2018-07-03 18:10:08 -04:00
Niko Matsakis
ea0224f5ab error_report: rustfmt 2018-07-03 18:10:08 -04:00
bors
fb97bb50d1 Auto merge of #51900 - PramodBisht:51813_b, r=nikomatsakis
introduce dirty list to dataflow

@nikomatsakis my naive implementation never worked, So, I decided to implement using `work_queue` data structure. This PR also includes your commits from `nll-liveness-dirty-list` branch. Those commits should not visible once your branch is merged.

r? @nikomatsakis
2018-07-03 21:48:37 +00:00
Zach Wolfe
ecaa7bc490
Update outdated comment: ByVal -> Scalar. 2018-07-03 16:09:13 -05:00
Ralf Jung
f96c246869 Strenghten synchronization in Arc::is_unique
Previously, `is_unique` would not synchronize at all with a `drop` that returned
early because it was not the last reference, leading to a data race.

Fixes #51780
2018-07-03 22:33:17 +02:00
Ethan McCue
6f223cfc07
Any docs preposition change
This changes the docs referring to where a user should be wary of depending on "Any" trait impls from warning about relying on them "outside" of their code to warning about relying on them "inside" of their code.
2018-07-03 13:13:49 -07:00
Matthew Jasper
125c9d99e5 Fix various nll unused mut errors 2018-07-03 20:12:09 +01:00
Mike Sullivan
dd069ea9f6 rust: add initial changes to support powerpc64le musl
amend powerpc64le_unknown_linux_musl.rs to fix copyright date
2018-07-03 18:18:03 +00:00
bors
739320a601 Auto merge of #51450 - estebank:inner-fn-test, r=@pnkfelix
Add lint warning for inner function marked as `#[test]`

Fix #36629.
2018-07-03 18:00:16 +00:00
QuietMisdreavus
61dc03cd63 test for renaming re-exported macros 2018-07-03 10:40:11 -05:00
Michael Woerister
65ff4141a5 Allow the linker to choose the LTO-plugin (which is useful when using LLD) 2018-07-03 16:33:11 +02:00
toidiu
3f616cb8c1 implement fix for cross crate inferrence and fix test 2018-07-03 10:13:50 -04:00
bors
860d169474 Auto merge of #52014 - pietroalbini:rollup, r=pietroalbini
Rollup of 13 pull requests

Successful merges:

 - #51548 (Initialize LLVM's AMDGPU target machine, if available.)
 - #51809 (Add read_exact_at and write_all_at methods to FileExt on unix)
 - #51914 (add outlives annotations to `BTreeMap`)
 - #51958 (Show known meta items in unknown meta items error)
 - #51973 (Make Stdio handle UnwindSafe)
 - #51977 (bootstrap: tests should use rustc from config.toml)
 - #51978 (Do not suggest changes to str literal if it isn't one)
 - #51979 (Get rid of `TyImplTraitExistential`)
 - #51980 (Emit column info in debuginfo for non msvc like targets)
 - #51982 (incr.comp.: Take names of children into account when computing the ICH of a module's HIR.)
 - #51997 (add entry for cargo-metadata feature to RELEASES)
 - #52004 (toolstate: Fixed detection of changed submodule, and other fixes.)
 - #52006 ( Change --keep-stage to apply more often)

Failed merges:

r? @ghost
2018-07-03 12:26:14 +00:00
Oliver Schneider
1eeb5dcb67 Deduplicate error reports for statics 2018-07-03 12:03:47 +02:00
Pietro Albini
492518fcd5
Rollup merge of #52006 - Mark-Simulacrum:keep-stage-fix, r=alexcrichton
Change --keep-stage to apply more often

Previously, the --keep-stage argument would only function for compilers
that were depended on by future stages. For example, if trying to build
a stage 1 compiler you could --keep-stage 0 to avoid re-building the
stage 0 compiler. However, this is often not what users want in
practice.

The new implementation essentially skips builds all higher stages of the
compiler, so an argument of 1 to keep-stage will skip rebuilds of the
libraries, just linking them into the sysroot. This is unlikely to work
well in cases where metadata or similar changes have been made, but is
likely fine otherwise.

This change is somewhat untested, but since it shouldn't have any effect
except with --keep-stage, I don't see that as a large problem.

r? @alexcrichton
cc @nikomatsakis - I believe you wanted this functionality
2018-07-03 11:31:13 +02:00
Pietro Albini
6af4397e19
Rollup merge of #52004 - kennytm:toolstate-fixes, r=Mark-Simulacrum
toolstate: Fixed detection of changed submodule, and other fixes.

1. Make sure that if a submodule is updated but failed to test-pass, we'll block the merge.
2. Make sure failure on external docs (nomicon/RBE/etc) are properly checked.
3. If the commit message starts with "Update RLS" (or clippy etc), automatically run the "tools" job on the PR, so that we could know if the update failed before merging.
2018-07-03 11:31:12 +02:00
Pietro Albini
5feb26cc55
Rollup merge of #51997 - euclio:release-notes, r=Aaronepower
add entry for cargo-metadata feature to RELEASES
2018-07-03 11:31:11 +02:00
Pietro Albini
b69058daa6
Rollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakis
incr.comp.: Take names of children into account when computing the ICH of a module's HIR.

Fixes #40876. Red-green tracking does not make this a problem anymore. We should verify this via a perf-run though.

r? @nikomatsakis
2018-07-03 11:31:10 +02:00
Pietro Albini
45cd78a4cd
Rollup merge of #51980 - est31:columns, r=alexcrichton
Emit column info in debuginfo for non msvc like targets

Fixes #42921 everywhere except MSVC. This mimics clang behaviour.
2018-07-03 11:31:09 +02:00
Pietro Albini
f91b02b769
Rollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis
Get rid of `TyImplTraitExistential`

cc @eddyb

r? @nikomatsakis
2018-07-03 11:31:07 +02:00
Pietro Albini
5195132a35
Rollup merge of #51978 - estebank:issue-48364, r=oli-obk
Do not suggest changes to str literal if it isn't one

Fix #48364.
2018-07-03 11:31:06 +02:00
Pietro Albini
47eee2497a
Rollup merge of #51977 - mnd:fix-bootstrap-test-with-local-stage0, r=simulacrum
bootstrap: tests should use rustc from config.toml

Tests should always use "rustc" and "cargo" from config.toml instead of assuming that stage0 binaries was downloaded to build directory.

Without this change `./x.py test src/bootstrap` will always try to use `build/ARCH/stage0/bin/rustc` file as compiler, but when we use local compiler to bootstrap this file does not exist.
2018-07-03 11:31:04 +02:00
Pietro Albini
0ceeb1be31
Rollup merge of #51973 - estk:master, r=abonander
Make Stdio handle UnwindSafe

Closes  #51863

This is my first compiler PR. Thanks Niko for the mentor help!

r? @nikomatsakis
2018-07-03 11:31:03 +02:00
Pietro Albini
bd0fe736be
Rollup merge of #51958 - euclio:attr-refactor, r=petrochenkov
Show known meta items in unknown meta items error

This PR adds a label to E0541. It also factors built-in attribute parsing into a submodule of `attr` for ease of future refactoring.

Fixes #51469.
2018-07-03 11:31:01 +02:00
Pietro Albini
451560e96c
Rollup merge of #51914 - nikomatsakis:nll-fix-issue-issue-btreemap-annotations, r=gankro
add outlives annotations to `BTreeMap`

NLL requires these annotations, I believe because of <https://github.com/rust-lang/rust/issues/29149>.

Fixes #48224

r? @Gankro
cc @lqd
2018-07-03 11:31:00 +02:00