]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoOmitted the walk in visit_expr()
Meade Kincke [Mon, 2 Jul 2018 17:09:47 +0000 (18:09 +0100)]
Omitted the walk in visit_expr()

6 years agoAuto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa
bors [Fri, 6 Jul 2018 20:05:23 +0000 (20:05 +0000)]
Auto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa

Haiku: several smaller fixes to build and run rust on Haiku

This PR combines three small patches that help Rust build and run on the Haiku platform. These patches do not intend to impact other platforms.

6 years agoAuto merge of #52018 - flip1995:rfc2103, r=oli-obk
bors [Fri, 6 Jul 2018 18:03:46 +0000 (18:03 +0000)]
Auto merge of #52018 - flip1995:rfc2103, r=oli-obk

Implementation of tool lints.

Tracking issue: #44690

6 years agoAuto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakis
bors [Fri, 6 Jul 2018 16:01:25 +0000 (16:01 +0000)]
Auto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakis

Fix: infer outlives requirements across crates

Fixes https://github.com/rust-lang/rust/issues/51858

6 years agoAuto merge of #51894 - mikhail-m1:8636, r=nikomatsakis
bors [Fri, 6 Jul 2018 12:54:45 +0000 (12:54 +0000)]
Auto merge of #51894 - mikhail-m1:8636, r=nikomatsakis

fix for issue #8636

r? @nikomatsakis

Fix #8636

also fixes #42291

6 years agoAuto merge of #51677 - nrc:update, r=kennytm
bors [Fri, 6 Jul 2018 10:55:02 +0000 (10:55 +0000)]
Auto merge of #51677 - nrc:update, r=kennytm

Update RLS and Rustfmt

r? @Mark-Simulacrum

6 years agotweak comment
Niko Matsakis [Fri, 6 Jul 2018 10:33:38 +0000 (06:33 -0400)]
tweak comment

6 years agoAuto merge of #51953 - japaric:atomic-load-store, r=alexcrichton
bors [Fri, 6 Jul 2018 08:59:22 +0000 (08:59 +0000)]
Auto merge of #51953 - japaric:atomic-load-store, r=alexcrichton

enable Atomic*.{load,store} for ARMv6-M / MSP430

closes #45085

as proposed in https://github.com/rust-lang/rust/issues/45085#issuecomment-384825434

this commit adds an `atomic_cas` target option and extends the `#[cfg(target_has_atomic)]`
attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS
natively, like MSP430 and ARMv6-M.

r? @alexcrichton

6 years agoUpdate RLS, Rustfmt, Cargo, and Clippy
Nick Cameron [Fri, 6 Jul 2018 00:34:00 +0000 (12:34 +1200)]
Update RLS, Rustfmt, Cargo, and Clippy

6 years agoAuto merge of #52088 - kennytm:rollup, r=kennytm
bors [Fri, 6 Jul 2018 06:48:12 +0000 (06:48 +0000)]
Auto merge of #52088 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #51619 (rust: add initial changes to support powerpc64le musl)
 - #51793 (Fix variant background color on hover in search results)
 - #52005 (Update LLVM to bring in a wasm codegen fix)
 - #52016 (Deduplicate error reports for statics)
 - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD))
 - #52030 (Any docs preposition change)
 - #52031 (Strenghten synchronization in `Arc::is_unique`)
 - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar)
 - #52055 (Include VS 2017 in error message.)
 - #52063 (Add a link to the rustc docs)
 - #52073 (Add a punch card to weird expressions test)
 - #52080 (Improve dependency deduplication diagnostics)
 - #52093 (rustc: Update tracking issue for wasm_import_module)
 - #52096 (Fix typo in cell.rs)

Failed merges:

6 years agoRollup merge of #52096 - d-e-s-o:fix-typo, r=sfackler
kennytm [Fri, 6 Jul 2018 05:02:40 +0000 (13:02 +0800)]
Rollup merge of #52096 - d-e-s-o:fix-typo, r=sfackler

Fix typo in cell.rs

6 years agoRollup merge of #52093 - alexcrichton:update-issue, r=kennytm
kennytm [Fri, 6 Jul 2018 05:02:06 +0000 (13:02 +0800)]
Rollup merge of #52093 - alexcrichton:update-issue, r=kennytm

rustc: Update tracking issue for wasm_import_module

It's now https://github.com/rust-lang/rust/issues/52090

6 years agoRollup merge of #52063 - mark-i-m:docs_link, r=kennytm
kennytm [Fri, 6 Jul 2018 00:51:07 +0000 (08:51 +0800)]
Rollup merge of #52063 - mark-i-m:docs_link, r=kennytm

Add a link to the rustc docs

6 years agoRollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrum
kennytm [Fri, 6 Jul 2018 00:50:29 +0000 (08:50 +0800)]
Rollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrum

Include VS 2017 in error message.

Update error prompt message to indicate that VS 2017 is supported (for a while now).

6 years agoRollup merge of #52080 - oli-obk:dep_dedup_diagnostics, r=kennytm
kennytm [Thu, 5 Jul 2018 23:07:24 +0000 (07:07 +0800)]
Rollup merge of #52080 - oli-obk:dep_dedup_diagnostics, r=kennytm

Improve dependency deduplication diagnostics

r? @kennytm

this is obviously hard to test :laughing:

cc #52072

6 years agoRollup merge of #52073 - xfix:patch-7, r=oli-obk
kennytm [Thu, 5 Jul 2018 23:07:23 +0000 (07:07 +0800)]
Rollup merge of #52073 - xfix:patch-7, r=oli-obk

Add a punch card to weird expressions test

6 years agorustc: Update tracking issue for wasm_import_module
Alex Crichton [Fri, 6 Jul 2018 01:16:17 +0000 (18:16 -0700)]
rustc: Update tracking issue for wasm_import_module

It's now https://github.com/rust-lang/rust/issues/52090

6 years agoFix typo in cell.rs
Daniel Mueller [Sun, 20 May 2018 03:40:11 +0000 (20:40 -0700)]
Fix typo in cell.rs

6 years agoupdate run-pass test
Jorge Aparicio [Fri, 6 Jul 2018 01:18:19 +0000 (20:18 -0500)]
update run-pass test

6 years agoRollup merge of #52033 - zachrwolfe:outdated_value_comment, r=oli-obk
kennytm [Thu, 5 Jul 2018 23:07:21 +0000 (07:07 +0800)]
Rollup merge of #52033 - zachrwolfe:outdated_value_comment, r=oli-obk

[Gardening] Update outdated comments: ByVal -> Scalar

ByVal enum cases in mir::interpret::value were renamed to Scalar a while ago but comments still refer to the old names.

6 years agoRollup merge of #52031 - RalfJung:arc, r=sfackler
kennytm [Thu, 5 Jul 2018 23:07:20 +0000 (07:07 +0800)]
Rollup merge of #52031 - RalfJung:arc, r=sfackler

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

Unfortunately I have no idea how to add a test for this.

Cc @jhjourdan

6 years agoRollup merge of #52030 - bowbahdoe:patch-1, r=alexcrichton
kennytm [Thu, 5 Jul 2018 23:07:18 +0000 (07:07 +0800)]
Rollup merge of #52030 - bowbahdoe:patch-1, r=alexcrichton

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.

6 years agoRollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=alexcrichton
kennytm [Thu, 5 Jul 2018 23:07:17 +0000 (07:07 +0800)]
Rollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=alexcrichton

[cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD)

This PR allows for not specifying an LTO-linker plugin but still let `rustc` invoke the linker with the correct plugin arguments. This is useful when using LLD which does not need the `-plugin` argument. Since LLD is the best linker for this scenario anyway, this change should improve ergonomics quite a bit.

r? @alexcrichton

6 years agoRollup merge of #52016 - oli-obk:dedup_static_errors, r=estebank
kennytm [Thu, 5 Jul 2018 23:07:16 +0000 (07:07 +0800)]
Rollup merge of #52016 - oli-obk:dedup_static_errors, r=estebank

Deduplicate error reports for statics

fixes #51970

6 years agoRollup merge of #52005 - alexcrichton:update-llvm-for-wasm, r=kennytm
kennytm [Thu, 5 Jul 2018 23:07:15 +0000 (07:07 +0800)]
Rollup merge of #52005 - alexcrichton:update-llvm-for-wasm, r=kennytm

Update LLVM to bring in a wasm codegen fix

Closes #51986

6 years agoAuto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, r=QuietMisdreavus
bors [Fri, 6 Jul 2018 00:36:34 +0000 (00:36 +0000)]
Auto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, r=QuietMisdreavus

Prevent some markdown transformation on short docblocks

Before:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 01" src="https://user-images.githubusercontent.com/3050060/42005762-7d533bbe-7a76-11e8-8361-027886803399.png">

After:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 02" src="https://user-images.githubusercontent.com/3050060/42005768-81bd59a0-7a76-11e8-819b-9b4be72579d6.png">

This is only performed on short doc blocks, not on plain ones. Not all transformations are prevented (you still have a few like urls, code blocks, etc...).

cc @nical

r? @QuietMisdreavus

6 years agoRollup merge of #51793 - GuillaumeGomez:search-result-hover, r=QuietMisdreavus
kennytm [Thu, 5 Jul 2018 23:07:11 +0000 (07:07 +0800)]
Rollup merge of #51793 - GuillaumeGomez:search-result-hover, r=QuietMisdreavus

Fix variant background color on hover in search results

Fixes #51792.

<img width="1440" alt="screen shot 2018-06-26 at 00 37 24" src="https://user-images.githubusercontent.com/3050060/41879313-60ecf3be-78d9-11e8-9986-21af529ab758.png">

r? @QuietMisdreavus

6 years agoRollup merge of #51619 - mksully22:ppc64le_rust, r=alexcrichton
kennytm [Thu, 5 Jul 2018 23:07:10 +0000 (07:07 +0800)]
Rollup merge of #51619 - mksully22:ppc64le_rust, r=alexcrichton

rust: add initial changes to support powerpc64le musl

Initial changes to support rustc building on ppc64le with musl. A PR was also submitted to libc component https://github.com/rust-lang/libc/pull/1023 to add changes to libc musl definitions.

A PR was submitted on Alpine https://github.com/alpinelinux/aports/pull/4549 with equivalent temporary patches for building on Alpine for now.

As a verification test a github project was put together to build ppc64le versions of rustc, rust-stdlib, and cargo on Alpine, https://github.com/mksully22/ppc64le_alpine_rust_1.26.2

6 years agoAuto merge of #51732 - GuillaumeGomez:cmd-line-lint-rustdoc, r=QuietMisdreavus
bors [Thu, 5 Jul 2018 22:28:53 +0000 (22:28 +0000)]
Auto merge of #51732 - GuillaumeGomez:cmd-line-lint-rustdoc, r=QuietMisdreavus

Add command line lint manipulation in rustdoc

Fixes #50082.

r? @QuietMisdreavus

6 years ago#[cfg(target_has_atomic_cas)] -> #[cfg(target_has_atomic = "cas")]
Jorge Aparicio [Thu, 5 Jul 2018 21:44:13 +0000 (16:44 -0500)]
#[cfg(target_has_atomic_cas)] -> #[cfg(target_has_atomic = "cas")]

6 years agoenable Atomic*.{load,store} for ARMv6-M / MSP430
Jorge Aparicio [Sat, 30 Jun 2018 19:56:08 +0000 (14:56 -0500)]
enable Atomic*.{load,store} for ARMv6-M / MSP430

closes #45085

this commit adds an `atomic_cas` target option and an unstable `#[cfg(target_has_atomic_cas)]`
attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS
natively, like MSP430 and ARMv6-M.

6 years agoAuto merge of #51917 - alexcrichton:update, r=Mark-Simulacrum
bors [Thu, 5 Jul 2018 20:25:00 +0000 (20:25 +0000)]
Auto merge of #51917 - alexcrichton:update, r=Mark-Simulacrum

Update crates in `Cargo.lock`

This is a "hopefully routine" update of our crates.io-based crates in
`Cargo.lock`, and let's see how it fares on CI...

6 years agoAdd command line lint manipulation in rustdoc
Guillaume Gomez [Sat, 23 Jun 2018 13:09:21 +0000 (15:09 +0200)]
Add command line lint manipulation in rustdoc

6 years agoAuto merge of #51599 - GuillaumeGomez:reduce-search-index, r=QuietMisdreavus
bors [Thu, 5 Jul 2018 18:21:25 +0000 (18:21 +0000)]
Auto merge of #51599 - GuillaumeGomez:reduce-search-index, r=QuietMisdreavus

reduce search-index size

Reduce size of `search-index.js` of around 16%:

Going from `2996785` bytes to `2545583`.

r? @QuietMisdreavus

6 years agoAddress review comments
Oliver Schneider [Thu, 5 Jul 2018 17:30:06 +0000 (19:30 +0200)]
Address review comments

6 years agoOnly display difference of features, not all features
Oliver Schneider [Thu, 5 Jul 2018 17:02:43 +0000 (19:02 +0200)]
Only display difference of features, not all features

6 years agoVertical list of tools to check
Oliver Schneider [Thu, 5 Jul 2018 16:48:56 +0000 (18:48 +0200)]
Vertical list of tools to check

6 years agoUpdate Cargo.lock dependencies
Alex Crichton [Mon, 2 Jul 2018 16:33:16 +0000 (09:33 -0700)]
Update Cargo.lock dependencies

Run `cargo update` and let's see how far we can get!

6 years agoAuto merge of #52012 - oli-obk:clippy, r=kennytm
bors [Thu, 5 Jul 2018 11:44:08 +0000 (11:44 +0000)]
Auto merge of #52012 - oli-obk:clippy, r=kennytm

Update the clippy submodule

6 years agoUpdate the clippy submodule
Oliver Schneider [Tue, 3 Jul 2018 08:53:32 +0000 (10:53 +0200)]
Update the clippy submodule

6 years agofix for issue #8636
Mikhail Modin [Wed, 4 Jul 2018 06:45:01 +0000 (07:45 +0100)]
fix for issue #8636

6 years agoAdd a punch card to weird expressions test
Konrad Borowski [Thu, 5 Jul 2018 10:07:33 +0000 (12:07 +0200)]
Add a punch card to weird expressions test

6 years agoAuto merge of #51967 - varkor:const-body-break-continue, r=estebank
bors [Thu, 5 Jul 2018 09:40:08 +0000 (09:40 +0000)]
Auto merge of #51967 - varkor:const-body-break-continue, r=estebank

Fix various issues with control-flow statements inside anonymous constants

Fixes #51761.
Fixes #51963 (and the host of other reported issues there).
(Might be easiest to review per commit, as they should be standalone.)

r? @estebank

6 years agoAuto merge of #51936 - japaric:rust-lld, r=alexcrichton
bors [Thu, 5 Jul 2018 06:44:16 +0000 (06:44 +0000)]
Auto merge of #51936 - japaric:rust-lld, r=alexcrichton

rename rustc's lld to rust-lld

to not shadow the system installed LLD when linking with LLD.

Before:

- `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD
- It's not possible to use a system installed LLD that's named `lld`

With this commit:

- `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD
- `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD

we don't offer guarantees about the availability of LLD in the rustc sysroot so we can rename the tool as long as we don't break the wasm32-unknown-unknown target which depends on it.

r? @alexcrichton we discussed this before

6 years agoin the second copy lld is already named rust-lld
Jorge Aparicio [Thu, 5 Jul 2018 04:10:10 +0000 (23:10 -0500)]
in the second copy lld is already named rust-lld

6 years agoAuto merge of #51938 - zackmdavis:and_the_case_of_the_leaking_desugar, r=estebank
bors [Thu, 5 Jul 2018 02:35:25 +0000 (02:35 +0000)]
Auto merge of #51938 - zackmdavis:and_the_case_of_the_leaking_desugar, r=estebank

in which we plug the crack where `?`-desugaring leaked into errors

Most of the time, it's not a problem that the types of the arm bodies in
a desugared-from-`?` match are different (that is, specifically: in `x?`
where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the
`Err` arm diverges to return a `Result<A, B>`), because they're being
assigned to different places. But in tail position, the types do need to
match, and our error message was explicitly referring to "match arms",
which is confusing when there's no `match` in the sweetly sugared
source.

It is not without some misgivings that we pollute the clarity-of-purpose
of `note_error_origin` with the suggestion to wrap with `Ok` (the other
branches are pointing out the odd-arm-out in the HIR that is the origin
of the error; the new branch that issues the `Ok` suggestion is serving
a different purpose), but it's the natural place to do it given that
we're already matching on `ObligationCauseCode::MatchExpressionArm {
arm_span, source }` there.

Resolves #51632.

6 years agoAuto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakis
bors [Thu, 5 Jul 2018 00:22:14 +0000 (00:22 +0000)]
Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakis

[NLL] Fix various unused mut errors

Closes #51801
Closes #50897
Closes #51830
Closes #51904
cc #51918 - keeping this one open in case there are any more issues

This PR contains multiple changes. List of changes with examples of what they fix:

* Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument
```rust
fn f(ref y: i32) {} // doesn't trigger lint
```
* Change mir generation so that by-move closure captures don't get first moved into a temporary.
```rust
let mut x = 0; // doesn't trigger lint
move || {
    x = 1;
};
```
* Treat generator upvars the same as closure upvars
```rust
let mut x = 0; // This mut is now necessary and is not linted against.
move || {
    x = 1;
    yield;
};
```

r? @nikomatsakis

6 years agoAdd a link to the rustc docs
mark [Wed, 4 Jul 2018 22:24:43 +0000 (17:24 -0500)]
Add a link to the rustc docs

6 years agoAuto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeGomez
bors [Wed, 4 Jul 2018 20:21:01 +0000 (20:21 +0000)]
Auto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeGomez

rustdoc codeblock hash escape

So that docstring text such as the following (in a code block) can be created ergonomically:

```rust
let s = "
    foo
    # bar
    baz
";
```

Such code in a docstring hide the <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> line.

Previously, using two consecutive hashes <code>&nbsp;&nbsp;&nbsp;&nbsp;## bar</code> would turn the line into _shown_ `# bar`, losing the leading whitespace. A line of code like <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> (such as in the example above) **could not be represented** in the docstring text.

This commit makes the two consecutive hashes not also trim the leading whitespace â€” the two hashes simply **escape** into a single hash and do not hide the line, leaving the rest of that line unaffected. The new docstring text to achieve the above code block is:

```rust
/// ```
/// let s = "
///     foo
///     ## bar
///     baz
/// ";
/// ```
```

6 years agoAuto merge of #51611 - QuietMisdreavus:slippery-macros, r=ollie27
bors [Wed, 4 Jul 2018 18:15:14 +0000 (18:15 +0000)]
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

6 years agorustdoc book on codeblock hash escaping
Lucas Morales [Wed, 4 Jul 2018 12:56:31 +0000 (08:56 -0400)]
rustdoc book on codeblock hash escaping

6 years agoAuto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapin
bors [Wed, 4 Jul 2018 16:21:42 +0000 (16:21 +0000)]
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

6 years agoShorten the line
CrLF0710 [Wed, 4 Jul 2018 15:36:51 +0000 (23:36 +0800)]
Shorten the line

Shorten the line to make tidy happy.

6 years agoInclude VS 2017 in error message.
CrLF0710 [Wed, 4 Jul 2018 14:49:35 +0000 (22:49 +0800)]
Include VS 2017 in error message.

Update error prompt message to indicate that VS 2017 is supported (for a while now).

6 years agoAuto merge of #51870 - nnethercote:reuse-DefsUsesVisitor, r=nikomatsakis
bors [Wed, 4 Jul 2018 14:12:14 +0000 (14:12 +0000)]
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

6 years agoImproving span of unknown lint tool error message
flip1995 [Wed, 4 Jul 2018 12:25:33 +0000 (14:25 +0200)]
Improving span of unknown lint tool error message

6 years agoAuto merge of #51935 - cramertj:unpin-references, r=withoutboats
bors [Wed, 4 Jul 2018 11:32:40 +0000 (11:32 +0000)]
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

6 years agoUnstable book documentation of tool lints
flip1995 [Tue, 3 Jul 2018 11:52:11 +0000 (13:52 +0200)]
Unstable book documentation of tool lints

6 years agoImplementation of tool lints
flip1995 [Tue, 3 Jul 2018 11:50:48 +0000 (13:50 +0200)]
Implementation of tool lints

6 years agoTests for tool_lints
flip1995 [Tue, 3 Jul 2018 10:23:20 +0000 (12:23 +0200)]
Tests for tool_lints

6 years agoAuto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm
bors [Wed, 4 Jul 2018 09:33:33 +0000 (09:33 +0000)]
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

6 years agoReuse the `DefsUsesVisitor` in `simulate_block()`.
Nicholas Nethercote [Thu, 28 Jun 2018 06:30:33 +0000 (16:30 +1000)]
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%.

6 years agoCompile stage0 tools with the raw bootstrap compiler
Alex Crichton [Fri, 29 Jun 2018 21:35:10 +0000 (14:35 -0700)]
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).

6 years agoAuto merge of #51926 - matthewjasper:Initialization-span, r=nikomatsakis
bors [Tue, 3 Jul 2018 23:54:25 +0000 (23:54 +0000)]
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

6 years agoAuto merge of #51900 - PramodBisht:51813_b, r=nikomatsakis
bors [Tue, 3 Jul 2018 21:48:37 +0000 (21:48 +0000)]
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

6 years agoUpdate outdated comment: ByVal -> Scalar.
Zach Wolfe [Tue, 3 Jul 2018 21:09:13 +0000 (16:09 -0500)]
Update outdated comment: ByVal -> Scalar.

6 years agoStrenghten synchronization in `Arc::is_unique`
Ralf Jung [Tue, 3 Jul 2018 20:10:30 +0000 (22:10 +0200)]
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

6 years agoAny docs preposition change
Ethan McCue [Tue, 3 Jul 2018 20:13:49 +0000 (13:13 -0700)]
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.

6 years agoFix various nll unused mut errors
Matthew Jasper [Tue, 3 Jul 2018 19:12:09 +0000 (20:12 +0100)]
Fix various nll unused mut errors

6 years agorust: add initial changes to support powerpc64le musl
Mike Sullivan [Mon, 18 Jun 2018 16:28:01 +0000 (16:28 +0000)]
rust: add initial changes to support powerpc64le musl
amend powerpc64le_unknown_linux_musl.rs to fix copyright date

6 years agoAuto merge of #51450 - estebank:inner-fn-test, r=@pnkfelix
bors [Tue, 3 Jul 2018 18:00:16 +0000 (18:00 +0000)]
Auto merge of #51450 - estebank:inner-fn-test, r=@pnkfelix

Add lint warning for inner function marked as `#[test]`

Fix #36629.

6 years agotest for renaming re-exported macros
QuietMisdreavus [Tue, 3 Jul 2018 15:40:11 +0000 (10:40 -0500)]
test for renaming re-exported macros

6 years agoAllow the linker to choose the LTO-plugin (which is useful when using LLD)
Michael Woerister [Tue, 3 Jul 2018 14:33:11 +0000 (16:33 +0200)]
Allow the linker to choose the LTO-plugin (which is useful when using LLD)

6 years agoimplement fix for cross crate inferrence and fix test
toidiu [Tue, 3 Jul 2018 04:09:01 +0000 (00:09 -0400)]
implement fix for cross crate inferrence and fix test

6 years agoAuto merge of #52014 - pietroalbini:rollup, r=pietroalbini
bors [Tue, 3 Jul 2018 12:26:14 +0000 (12:26 +0000)]
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

6 years agoDeduplicate error reports for statics
Oliver Schneider [Tue, 3 Jul 2018 10:03:47 +0000 (12:03 +0200)]
Deduplicate error reports for statics

6 years agoRollup merge of #52006 - Mark-Simulacrum:keep-stage-fix, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:31:13 +0000 (11:31 +0200)]
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

6 years agoRollup merge of #52004 - kennytm:toolstate-fixes, r=Mark-Simulacrum
Pietro Albini [Tue, 3 Jul 2018 09:31:12 +0000 (11:31 +0200)]
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.

6 years agoRollup merge of #51997 - euclio:release-notes, r=Aaronepower
Pietro Albini [Tue, 3 Jul 2018 09:31:11 +0000 (11:31 +0200)]
Rollup merge of #51997 - euclio:release-notes, r=Aaronepower

add entry for cargo-metadata feature to RELEASES

6 years agoRollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakis
Pietro Albini [Tue, 3 Jul 2018 09:31:10 +0000 (11:31 +0200)]
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

6 years agoRollup merge of #51980 - est31:columns, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:31:09 +0000 (11:31 +0200)]
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.

6 years agoRollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis
Pietro Albini [Tue, 3 Jul 2018 09:31:07 +0000 (11:31 +0200)]
Rollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis

Get rid of `TyImplTraitExistential`

cc @eddyb

r? @nikomatsakis

6 years agoRollup merge of #51978 - estebank:issue-48364, r=oli-obk
Pietro Albini [Tue, 3 Jul 2018 09:31:06 +0000 (11:31 +0200)]
Rollup merge of #51978 - estebank:issue-48364, r=oli-obk

Do not suggest changes to str literal if it isn't one

Fix #48364.

6 years agoRollup merge of #51977 - mnd:fix-bootstrap-test-with-local-stage0, r=simulacrum
Pietro Albini [Tue, 3 Jul 2018 09:31:04 +0000 (11:31 +0200)]
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.

6 years agoRollup merge of #51973 - estk:master, r=abonander
Pietro Albini [Tue, 3 Jul 2018 09:31:03 +0000 (11:31 +0200)]
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

6 years agoRollup merge of #51958 - euclio:attr-refactor, r=petrochenkov
Pietro Albini [Tue, 3 Jul 2018 09:31:01 +0000 (11:31 +0200)]
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.

6 years agoRollup merge of #51914 - nikomatsakis:nll-fix-issue-issue-btreemap-annotations, r...
Pietro Albini [Tue, 3 Jul 2018 09:31:00 +0000 (11:31 +0200)]
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

6 years agoRollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:30:59 +0000 (11:30 +0200)]
Rollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton

Add read_exact_at and write_all_at methods to FileExt on unix

This PR adds `FileExt::read_exact_at()` and `FileExt::write_all_at()`, which are to `read_at()` and `write_at()` as `read_exact()` and `write_all()` are to `read()` and `write()`. This allows the user to not have to deal with `ErrorKind::Interrupted` and calling the functions in a loop.

I was unsure as to how to mark these new methods so I marked them `unstable`, please let me know if I should have done it differently.

I asked in Discord and was told that as this change is small it does not require an RFC.

6 years agoRollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:30:57 +0000 (11:30 +0200)]
Rollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=alexcrichton

Initialize LLVM's AMDGPU target machine, if available.

Note this isn't useful, yet. More changes will be necessary to be able to
actually codegen for this machine. As such, it is not enabled by default.

This patch is on its own for the benefit of the reviewers.

6 years agoAvoid sorting the item_ids array the StableHash impl of hir::Mod.
Michael Woerister [Tue, 3 Jul 2018 09:16:38 +0000 (11:16 +0200)]
Avoid sorting the item_ids array the StableHash impl of hir::Mod.

6 years agoAuto merge of #51889 - spastorino:make-causal-tracking-lazy, r=nikomatsakis
bors [Tue, 3 Jul 2018 09:08:58 +0000 (09:08 +0000)]
Auto merge of #51889 - spastorino:make-causal-tracking-lazy, r=nikomatsakis

Make causal tracking lazy

Closes #51710

r? @nikomatsakis

6 years agoAuto merge of #51695 - est31:stdsimd_update, r=alexcrichton
bors [Tue, 3 Jul 2018 07:06:46 +0000 (07:06 +0000)]
Auto merge of #51695 - est31:stdsimd_update, r=alexcrichton

Update stdsimd

Closes #51691

6 years agoAuto merge of #51564 - SimonSapin:try-int, r=alexcrichton
bors [Tue, 3 Jul 2018 04:08:02 +0000 (04:08 +0000)]
Auto merge of #51564 - SimonSapin:try-int, r=alexcrichton

Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms

This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a "Remove TryFrom impls that might become conditionally-infallible with a portability lint".

This fixes #49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`).

They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](https://github.com/rust-lang/rfcs/pull/1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms.

This PR gives up on this possiblity for two reasons:

* Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later.

* For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.

6 years agotest to capture that cross crate outlives requirements are not inferred
toidiu [Tue, 3 Jul 2018 02:25:49 +0000 (22:25 -0400)]
test to capture that cross crate outlives requirements are not inferred

6 years agoAuto merge of #51428 - alexreg:uninitialized-statics-simplification, r=oli-obk
bors [Tue, 3 Jul 2018 02:01:49 +0000 (02:01 +0000)]
Auto merge of #51428 - alexreg:uninitialized-statics-simplification, r=oli-obk

Removed `uninitialized_statics` field from `Memory` struct in miri

based on #51110

r? @oli-obk

CC @eddyb

6 years agoAuto merge of #51991 - oli-obk:clippy, r=kennytm
bors [Mon, 2 Jul 2018 23:50:13 +0000 (23:50 +0000)]
Auto merge of #51991 - oli-obk:clippy, r=kennytm

Update the clippy submodule

nth time is the charm? `x.py test src/tools/clippy` passes locally

r? @kennytm

6 years agoChange --keep-stage to apply more
Mark Rousskov [Mon, 2 Jul 2018 22:04:58 +0000 (16:04 -0600)]
Change --keep-stage to apply more

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.

6 years agoRun "tools" job on PR when commit message starts with "Update RLS/miri/..."
kennytm [Mon, 2 Jul 2018 22:01:58 +0000 (06:01 +0800)]
Run "tools" job on PR when commit message starts with "Update RLS/miri/..."

6 years agoFixed detection of test-fail for doctests.
kennytm [Mon, 2 Jul 2018 21:53:18 +0000 (05:53 +0800)]
Fixed detection of test-fail for doctests.

6 years agoFix the tool's path in toolstate verification.
kennytm [Mon, 2 Jul 2018 20:49:42 +0000 (04:49 +0800)]
Fix the tool's path in toolstate verification.

This ensure we do block the tools when they are broken during an update.