]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #65779 - kevgrasso:E0308highlight, r=estebank
bors [Sun, 3 Nov 2019 08:01:29 +0000 (08:01 +0000)]
Auto merge of #65779 - kevgrasso:E0308highlight, r=estebank

Highlight only relevant parts of type path in type errors

Resolves #57413.

Unfortunately the current Rust UI testing setup can't test that the correct colors are being used in a given output, so here's a screenshot of a small test program I wrote:
![image](https://user-images.githubusercontent.com/480789/67530063-f272af00-f68b-11e9-9f96-a211fc7666d4.png)

4 years agoAuto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic
bors [Sat, 2 Nov 2019 22:26:54 +0000 (22:26 +0000)]
Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic

Make <*const/mut T>::offset_from `const fn`

This reenables offset_of cc @mjbshaw  after https://github.com/rust-lang/rust/pull/63075 broke it

4 years agoadjust for missing spans on x86 test runner
Ralf Jung [Sat, 2 Nov 2019 22:13:00 +0000 (23:13 +0100)]
adjust for missing spans on x86 test runner

4 years agoAuto merge of #65429 - Timmmm:withoptions, r=Mark-Simulacrum
bors [Sat, 2 Nov 2019 18:22:32 +0000 (18:22 +0000)]
Auto merge of #65429 - Timmmm:withoptions, r=Mark-Simulacrum

Add File::with_options

This provides a more fluent API to create files with options, and also avoids the need to import OpenOptions.

This implements @aldanor's [suggestion](https://github.com/rust-lang/rfcs/pull/2615#issuecomment-448591304) which was popular.

4 years agoAuto merge of #66004 - eddyb:revert-early-gate, r=petrochenkov
bors [Sat, 2 Nov 2019 10:48:59 +0000 (10:48 +0000)]
Auto merge of #66004 - eddyb:revert-early-gate, r=petrochenkov

Partially revert the early feature-gatings added in #65742.

The intent here is to address #65860 ASAP (in time for beta, ideally), while leaving as much of #65742 around as possible, to make it easier to re-enable later.

Therefore, I've only kept the parts of the revert that re-add the old (i.e. non-early) feature-gating checks that were removed in #65742, and the test reverts.

I've disabled the new early feature-gating checks from #65742 entirely for now, but it would be easy to put them behind a `-Z` flag, or turn them into warnings, which would allow us to keep tests for both the early and late versions of the checks - assuming that's desirable.

cc @nikomatsakis @Mark-Simulacrum @Centril

4 years agoAuto merge of #66021 - tmandry:rollup-y13l6n9, r=tmandry
bors [Fri, 1 Nov 2019 18:23:04 +0000 (18:23 +0000)]
Auto merge of #66021 - tmandry:rollup-y13l6n9, r=tmandry

Rollup of 16 pull requests

Successful merges:

 - #65112 (Add lint and tests for unnecessary parens around types)
 - #65470 (Don't hide ICEs from previous incremental compiles)
 - #65471 (Add long error explanation for E0578)
 - #65857 (rustdoc: Resolve module-level doc references more locally)
 - #65902 (Make ItemContext available for better diagnositcs)
 - #65914 (Use structured suggestion for unnecessary bounds in type aliases)
 - #65946 (Make `promote_consts` emit the errors when required promotion fails)
 - #65960 (doc: reword iter module example and mention other methods)
 - #65963 (update submodules to rust-lang)
 - #65972 (Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets)
 - #65977 (Fix incorrect diagnostics for expected type in E0271 with an associated type)
 - #65995 (Add error code E0743 for "C-variadic has been used on a non-foreign function")
 - #65997 (Fix outdated rustdoc of Once::init_locking function)
 - #66002 (Stabilize float_to_from_bytes feature)
 - #66005 (vxWorks: remove code related unix socket)
 - #66018 (Revert PR 64324: dylibs export generics again (for now))

Failed merges:

r? @ghost

4 years agoRollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichton
Tyler Mandry [Fri, 1 Nov 2019 18:20:29 +0000 (11:20 -0700)]
Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichton

Revert PR 64324: dylibs export generics again (for now)

As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols.

The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319.

In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872.

Fix #64872

Reopen #64319

4 years agoRollup merge of #66005 - Wind-River:master_base, r=alexcrichton
Tyler Mandry [Fri, 1 Nov 2019 18:20:28 +0000 (11:20 -0700)]
Rollup merge of #66005 - Wind-River:master_base, r=alexcrichton

vxWorks: remove code related unix socket

r? @alexcrichton

4 years agoRollup merge of #66002 - lzutao:stablilize-float_to_from_bytes, r=SimonSapin
Tyler Mandry [Fri, 1 Nov 2019 18:20:26 +0000 (11:20 -0700)]
Rollup merge of #66002 - lzutao:stablilize-float_to_from_bytes, r=SimonSapin

Stabilize float_to_from_bytes feature

FCP completed in https://github.com/rust-lang/rust/issues/60446#issuecomment-548440175
Closes #60446

4 years agoRollup merge of #65997 - spastorino:fix-init_locking-rustdoc, r=Mark-Simulacrum
Tyler Mandry [Fri, 1 Nov 2019 18:20:25 +0000 (11:20 -0700)]
Rollup merge of #65997 - spastorino:fix-init_locking-rustdoc, r=Mark-Simulacrum

Fix outdated rustdoc of Once::init_locking function

r? @Mark-Simulacrum

related to https://github.com/rust-lang/rust/pull/65979

4 years agoRollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebank
Tyler Mandry [Fri, 1 Nov 2019 18:20:24 +0000 (11:20 -0700)]
Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebank

Add error code E0743 for "C-variadic has been used on a non-foreign function"

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

4 years agoRollup merge of #65977 - ohadravid:fix-incorrect-diagnostics-with-an-associated-type...
Tyler Mandry [Fri, 1 Nov 2019 18:20:22 +0000 (11:20 -0700)]
Rollup merge of #65977 - ohadravid:fix-incorrect-diagnostics-with-an-associated-type, r=estebank

Fix incorrect diagnostics for expected type in E0271 with an associated type

With code like the following code:

```rust
#[derive(Debug)]
struct Data {}

fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
    for item in iterator {
        println!("{:?}", item)
    }
}

fn main() {
    let v = vec![Data {}];

    do_stuff(v.into_iter());
}
```

the diagnostic (in nightly & stable) wrongly complains about the expected type:

```
error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data`
  --> src/main.rs:15:5
   |
5  | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
   |    --------                             --------------- required by this bound in `do_stuff`
...
15 |     do_stuff(v.into_iter());
   |     ^^^^^^^^ expected struct `Data`, found &Data
   |
   = note: expected type `Data`
              found type `&Data`
```

This PR fixes this issue by flipping the expected/actual values where appropriate, so it looks like this:

```
error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data`
  --> main.rs:15:5
   |
5  | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) {
   |    --------                             --------------- required by this bound in `do_stuff`
...
15 |     do_stuff(v.into_iter());
   |     ^^^^^^^^ expected &Data, found struct `Data`
   |
   = note: expected type `&Data`
              found type `Data`
```

This improves the output of a lot of existing tests (check out `associated-types-binding-to-type-defined-in-supertrait`!).

The only change which I wasn't too sure about is in the test `associated-types-overridden-binding-2`, but I think it's an improvement and the underlying problem is with handling of `trait_alias`.

Fix #57226, fix #64760, fix #58092.

4 years agoRollup merge of #65972 - braiins:vkr-arm-panicking, r=alexcrichton
Tyler Mandry [Fri, 1 Nov 2019 18:20:21 +0000 (11:20 -0700)]
Rollup merge of #65972 - braiins:vkr-arm-panicking, r=alexcrichton

Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets

If `__LITTLE_ENDIAN__` is missing, libunwind assumes big endian
and reads unwinding instructions wrong on ARM EHABI.

Fix #65765

Technical background in referenced bug.

I didn't run any automated tests, just built a simple panicking program using the fixed toolchain and panicking started to work. Tried with `catch_unwind()` and that seems to work now too. libunwind's log seems ok now, I can paste it if needed.

4 years agoRollup merge of #65963 - steveklabnik:update-submodules, r=Centril
Tyler Mandry [Fri, 1 Nov 2019 18:20:20 +0000 (11:20 -0700)]
Rollup merge of #65963 - steveklabnik:update-submodules, r=Centril

update submodules to rust-lang

These are the repositories I've moved from rust-lang-nursery to
rust-lang, so we should update the submodules too.

I have not tested that this builds at all, so please make sure CI is green!

4 years agoRollup merge of #65960 - lzutao:doc-iter-example, r=Centril
Tyler Mandry [Fri, 1 Nov 2019 18:20:18 +0000 (11:20 -0700)]
Rollup merge of #65960 - lzutao:doc-iter-example, r=Centril

doc: reword iter module example and mention other methods

4 years agoRollup merge of #65946 - ecstatic-morse:refactor-promotion2, r=eddyb
Tyler Mandry [Fri, 1 Nov 2019 18:20:17 +0000 (11:20 -0700)]
Rollup merge of #65946 - ecstatic-morse:refactor-promotion2, r=eddyb

Make `promote_consts` emit the errors when required promotion fails

A very minimal version of #65942.

This will cause a generic "argument X is required to be a constant" message for `simd_shuffle` LLVM intrinsics instead of the [custom one](https://github.com/rust-lang/rust/blob/caa1f8d7b3b021c86a70ff62d23a07d97acff4c4/src/librustc_mir/transform/qualify_consts.rs#L1616). It may be possible to remove this special-casing altogether after rust-lang/stdarch#825.

r? @eddyb

4 years agoRollup merge of #65914 - estebank:type-alias-bounds-sugg, r=davidtwco
Tyler Mandry [Fri, 1 Nov 2019 18:20:15 +0000 (11:20 -0700)]
Rollup merge of #65914 - estebank:type-alias-bounds-sugg, r=davidtwco

Use structured suggestion for unnecessary bounds in type aliases

4 years agoRollup merge of #65902 - gilescope:issue62570, r=estebank
Tyler Mandry [Fri, 1 Nov 2019 18:20:14 +0000 (11:20 -0700)]
Rollup merge of #65902 - gilescope:issue62570, r=estebank

Make ItemContext available for better diagnositcs

Fix #62570

4 years agoRollup merge of #65857 - kinnison:kinnison/issue-55364, r=Manisheart,GuillaumeGomez
Tyler Mandry [Fri, 1 Nov 2019 18:20:12 +0000 (11:20 -0700)]
Rollup merge of #65857 - kinnison:kinnison/issue-55364, r=Manisheart,GuillaumeGomez

rustdoc: Resolve module-level doc references more locally

Module level docs should resolve intra-doc links as locally as
possible.  As such, this commit alters the heuristic for finding
intra-doc links such that we attempt to resolve names mentioned
in *inner* documentation comments within the (sub-)module rather
that from the context of its parent.

I'm hoping that this fixes #55364 though right now I'm not sure it's the right fix.

r? @GuillaumeGomez

4 years agoRollup merge of #65471 - GuillaumeGomez:long-err-explanation-E0578, r=Dylan-DPC
Tyler Mandry [Fri, 1 Nov 2019 18:20:11 +0000 (11:20 -0700)]
Rollup merge of #65471 - GuillaumeGomez:long-err-explanation-E0578, r=Dylan-DPC

Add long error explanation for E0578

Part of #61137

r? @kinnison

4 years agoRollup merge of #65470 - traxys:fix_65401, r=michaelwoerister
Tyler Mandry [Fri, 1 Nov 2019 18:20:09 +0000 (11:20 -0700)]
Rollup merge of #65470 - traxys:fix_65401, r=michaelwoerister

Don't hide ICEs from previous incremental compiles

I think this fixes #65401, the compiler does not fail to ICE after the first compilation, tested on the last snippet of [this comment](https://github.com/rust-lang/rust/issues/63154#issuecomment-541592381).
I am not very sure of the fix as I don't understand much of the structure of the compiler.

4 years agoRollup merge of #65112 - jack-t:type-parens-lint, r=varkor
Tyler Mandry [Fri, 1 Nov 2019 18:20:07 +0000 (11:20 -0700)]
Rollup merge of #65112 - jack-t:type-parens-lint, r=varkor

Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.

4 years agoui test formulation of regression test for issue 64872.
Felix S. Klock II [Wed, 30 Oct 2019 15:32:40 +0000 (16:32 +0100)]
ui test formulation of regression test for issue 64872.

(Many thanks to alex for 1. making this even smaller than what I had
originally minimized, and 2. pointing out that there is precedent for
having ui tests with crate dependency chains of length > 2, thus
allowing me to avoid encoding this as a run-make test.)

4 years agotargeted revert of PR rust-lang/rust#64324 (just undo change to dylib generics export).
Felix S. Klock II [Fri, 1 Nov 2019 12:46:05 +0000 (13:46 +0100)]
targeted revert of PR rust-lang/rust#64324 (just undo change to dylib generics export).

Includes the anticipated fallout to run-make-fulldeps test suite from
this change. (We need to reopen issue 64319 as part of landing this.)

4 years agoAuto merge of #65718 - eddyb:codegen-var-debuginfo, r=nikomatsakis
bors [Fri, 1 Nov 2019 11:34:51 +0000 (11:34 +0000)]
Auto merge of #65718 - eddyb:codegen-var-debuginfo, r=nikomatsakis

rustc_codegen_ssa: introduce MIR VarDebugInfo, but only for codegen.

These are all the codegen changes necessary for #56231.

The refactors were performed locally to codegen, and in several steps, to ease reviewing and avoid introducing changes in behavior (as I'm not sure our debuginfo tests cover enough).

r? @michaelwoerister cc @nagisa @rkruppe @oli-obk

4 years agoAuto merge of #65698 - msizanoen1:dual-proc-macro-hash, r=petrochenkov
bors [Fri, 1 Nov 2019 06:35:40 +0000 (06:35 +0000)]
Auto merge of #65698 - msizanoen1:dual-proc-macro-hash, r=petrochenkov

Dual proc macro hash

This PR changes current `-Z dual-proc-macro` mechanism from resolving only by name to including the hash of the host crate inside the transistive dependency information to prevent name conflicts.
Fix partially #62558

4 years agoAuto merge of #65459 - ecstatic-morse:graphviz-subgraph, r=estebank
bors [Fri, 1 Nov 2019 03:15:31 +0000 (03:15 +0000)]
Auto merge of #65459 - ecstatic-morse:graphviz-subgraph, r=estebank

Fix `-Zunpretty=mir-cfg` to render multiple items

`-Zunpretty=mir-cfg` outputs DOT to stdout for all items being compiled. However, it puts all of these items in separate `digraph`s, which means the result of redirecting that output to a file is not valid. Most dot renderers (I have tried `dot` and `xdot`) cannot render the output.

This PR checks to see if `write_mir_graphviz` will  process multiple items, and writes them each as a `subgraph` in a single, top-level `digraph`. As a result, DOT can be viewed without manually editing the output file. The output is unchanged when printing a single item (e.g.`-Zunpretty=mir-cfg=item_name`).

Here's the output of `xdot` for a rust file containing three items:
![three-items](https://user-images.githubusercontent.com/29463364/66889712-4bf62200-ef98-11e9-83b5-60faa2a300dd.png)

The borders are a result of the nonstandard–but well-supported–[`cluster` prefix](https://graphviz.gitlab.io/_pages/doc/info/lang.html) (search for "Subgraphs and Clusters"). They will not appear if your renderer does not support this extension, but the graph will still render properly.

4 years agorustc_codegen_ssa: introduce MIR VarDebugInfo, but only for codegen.
Eduard-Mihai Burtescu [Wed, 23 Oct 2019 10:12:11 +0000 (13:12 +0300)]
rustc_codegen_ssa: introduce MIR VarDebugInfo, but only for codegen.

4 years agorustc_codegen_ssa: hide address ops from the declare_local interface.
Eduard-Mihai Burtescu [Thu, 12 Sep 2019 09:29:46 +0000 (12:29 +0300)]
rustc_codegen_ssa: hide address ops from the declare_local interface.

4 years agorustc_codegen_ssa: move debuginfo scopes into FunctionDebugContext.
Eduard-Mihai Burtescu [Wed, 11 Sep 2019 14:52:39 +0000 (17:52 +0300)]
rustc_codegen_ssa: move debuginfo scopes into FunctionDebugContext.

4 years agorustc_codegen_ssa: change set_var_name back to taking a &str.
Eduard-Mihai Burtescu [Tue, 22 Oct 2019 09:36:00 +0000 (12:36 +0300)]
rustc_codegen_ssa: change set_var_name back to taking a &str.

4 years agorustc_codegen_ssa: move all set_var_name calls to mir::debuginfo.
Eduard-Mihai Burtescu [Fri, 13 Sep 2019 17:04:54 +0000 (20:04 +0300)]
rustc_codegen_ssa: move all set_var_name calls to mir::debuginfo.

4 years agorustc_codegen_ssa: move local variable debuginfo to mir::debuginfo.
Eduard-Mihai Burtescu [Fri, 13 Sep 2019 07:28:14 +0000 (10:28 +0300)]
rustc_codegen_ssa: move local variable debuginfo to mir::debuginfo.

4 years agorustc_codegen_ssa: move debuginfo-related things to a new mir::debuginfo module.
Eduard-Mihai Burtescu [Wed, 4 Sep 2019 16:44:58 +0000 (19:44 +0300)]
rustc_codegen_ssa: move debuginfo-related things to a new mir::debuginfo module.

4 years agosyntax: disable the new early feature-gatings added in #65742.
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 17:34:06 +0000 (19:34 +0200)]
syntax: disable the new early feature-gatings added in #65742.

4 years agoRevert "pre-expansion gate trait_alias."
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:50:31 +0000 (18:50 +0200)]
Revert "pre-expansion gate trait_alias."

This reverts commit 2d182b82ce5ecfe8090ba3d4e78f1cd72c072ef1.

4 years agoRevert "pre-expansion gate associated_type_bounds"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:49:22 +0000 (18:49 +0200)]
Revert "pre-expansion gate associated_type_bounds"

This reverts commit c17a1fd7d0ef0f1f546445d0c8bdb11be55e4be7.

4 years agoRevert "pre-expansion gate crate_visibility_modifier"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:48:11 +0000 (18:48 +0200)]
Revert "pre-expansion gate crate_visibility_modifier"

This reverts commit 04c661ba021730bc13d33c6d55cb9aad05026f36.

4 years agoRevert "pre-expansion gate const_generics"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:46:29 +0000 (18:46 +0200)]
Revert "pre-expansion gate const_generics"

This reverts commit 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.

4 years agoRevert "pre-expansion gate decl_macro"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:35:41 +0000 (18:35 +0200)]
Revert "pre-expansion gate decl_macro"

This reverts commit 1f470ceac2202ecffe8a15acc1139edb9ad4a03b.

4 years agoRevert "pre-expansion gate box_patterns"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:32:40 +0000 (18:32 +0200)]
Revert "pre-expansion gate box_patterns"

This reverts commit 2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.

4 years agoRevert "pre-expansion gate exclusive_range_pattern"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:30:25 +0000 (18:30 +0200)]
Revert "pre-expansion gate exclusive_range_pattern"

This reverts commit 665a876e307933c6480a6c55a3e38e88937aff2c.

4 years agoRevert "pre-expansion gate try_blocks"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:28:36 +0000 (18:28 +0200)]
Revert "pre-expansion gate try_blocks"

This reverts commit 1935ba658c576f14397c2c7a26a6642cf08f26a6.

4 years agoRevert "pre-expansion gate label_break_value"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:25:40 +0000 (18:25 +0200)]
Revert "pre-expansion gate label_break_value"

This reverts commit 137ded8ab1edf5112c45e0b6854272ae2e9d3a6d.

4 years agoRevert "pre-expansion gate box_syntax"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:20:02 +0000 (18:20 +0200)]
Revert "pre-expansion gate box_syntax"

This reverts commit e4ed8865786a787a7b0c045f7674569b6be0e9bc.

4 years agoRevert "pre-expansion gate type_ascription"
Eduard-Mihai Burtescu [Thu, 31 Oct 2019 16:12:25 +0000 (18:12 +0200)]
Revert "pre-expansion gate type_ascription"

This reverts commit 15a6c09b6e8a977f2c6f5a73de01a20d00b37930.

4 years agoStabilize float_to_from_bytes feature
Lzu Tao [Thu, 31 Oct 2019 16:13:28 +0000 (16:13 +0000)]
Stabilize float_to_from_bytes feature

4 years agoMerge pull request #42 from Wind-River/master_003
n-salim [Thu, 31 Oct 2019 16:10:42 +0000 (09:10 -0700)]
Merge pull request #42 from Wind-River/master_003

vxWorks: remove all code related to UNIX socket as it is not supporte…

4 years agoAuto merge of #65091 - sekineh:into-iter-sorted, r=KodrAus
bors [Thu, 31 Oct 2019 15:15:53 +0000 (15:15 +0000)]
Auto merge of #65091 - sekineh:into-iter-sorted, r=KodrAus

Implement ordered/sorted iterators on BinaryHeap as per #59278

I've implemented the ordered version of iterator on BinaryHeap as per #59278.

# Added methods:

* `.into_iter_sorted()`
  * like `.into_iter()`; but returns elements in heap order
* `.drain_sorted()`
  * like `.drain()`; but returns elements in heap order
  * It's a bit _lazy_; elements are removed on drop. (Edit: it’s similar to vec::Drain)

For `DrainSorted` struct, I implemented `Drop` trait following @scottmcm 's [suggestion](https://github.com/rust-lang/rust/issues/59278#issuecomment-537306925)

# ~TODO~ DONE
* ~I think I need to add more tests other than doctest.~

# **Notes:**
* we renamed `_ordered` to `_sorted`, because the latter is more common in rust libs. (as suggested by @KodrAus )

4 years agoupdate ui tests
Guillaume Gomez [Wed, 16 Oct 2019 11:29:43 +0000 (13:29 +0200)]
update ui tests

4 years agoAdd long error explanation for E0578
Guillaume Gomez [Wed, 16 Oct 2019 11:29:30 +0000 (13:29 +0200)]
Add long error explanation for E0578

4 years agoFix outdated rustdoc of Once::init_locking function
Santiago Pastorino [Thu, 31 Oct 2019 13:06:14 +0000 (10:06 -0300)]
Fix outdated rustdoc of Once::init_locking function

4 years agoAuto merge of #63803 - GuillaumeGomez:stabilize-doctest, r=ollie27,QuietMisdreavus...
bors [Thu, 31 Oct 2019 11:51:42 +0000 (11:51 +0000)]
Auto merge of #63803 - GuillaumeGomez:stabilize-doctest, r=ollie27,QuietMisdreavus,Mark-Simulacrum

[rustdoc] stabilize cfg(doctest)

Fixes #62210.

Since we removed rustdoc from providing cfg(test) on test runs, it's been replaced by cfg(doctest). It'd be nice to have it in not too far in the future.

4 years agoUpdate ui tests
Guillaume Gomez [Thu, 31 Oct 2019 09:39:46 +0000 (10:39 +0100)]
Update ui tests

4 years agoCreate new error E0743
Guillaume Gomez [Thu, 31 Oct 2019 09:39:38 +0000 (10:39 +0100)]
Create new error E0743

4 years agoAuto merge of #65982 - RalfJung:miri, r=alexcrichton
bors [Thu, 31 Oct 2019 08:31:27 +0000 (08:31 +0000)]
Auto merge of #65982 - RalfJung:miri, r=alexcrichton

update miri

As a side-effect, this bumps env_logger from 0.7.0 to 0.7.1.

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

4 years agoFix incorrect diagnostics for expected type in E0271 with an associated type
Ohad Ravid [Wed, 30 Oct 2019 15:53:41 +0000 (16:53 +0100)]
Fix incorrect diagnostics for expected type in E0271 with an associated type

4 years agorustdoc: Resolve module-level doc references more locally
Daniel Silverstone [Thu, 31 Oct 2019 07:49:54 +0000 (07:49 +0000)]
rustdoc: Resolve module-level doc references more locally

Module level docs should resolve intra-doc links as locally as
possible.  As such, this commit alters the heuristic for finding
intra-doc links such that we attempt to resolve names mentioned
in *inner* documentation comments within the (sub-)module rather
that from the context of its parent.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
4 years agorebase and re-update lock file
Ralf Jung [Thu, 31 Oct 2019 06:50:54 +0000 (07:50 +0100)]
rebase and re-update lock file

4 years agoupdate miri
Ralf Jung [Wed, 30 Oct 2019 20:03:19 +0000 (21:03 +0100)]
update miri

4 years agoAdjust rustc-workspace-hack
msizanoen1 [Tue, 29 Oct 2019 05:17:18 +0000 (12:17 +0700)]
Adjust rustc-workspace-hack

4 years agoImplement dual proc macro hashing
msizanoen [Tue, 22 Oct 2019 08:47:07 +0000 (15:47 +0700)]
Implement dual proc macro hashing
This changes the mechanism of `-Z dual-proc-macro` to record the host
proc macro hash in the transistive dependency information and use it
during dependency resolution instead of resolving only by name.

4 years agoAuto merge of #65990 - Centril:rollup-v843h4a, r=Centril
bors [Thu, 31 Oct 2019 02:20:30 +0000 (02:20 +0000)]
Auto merge of #65990 - Centril:rollup-v843h4a, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #65274 (Upload toolstates.json to rust-lang-ci2)
 - #65434 (Add long error explanation for E0577)
 - #65850 (Update comments re type parameter hack in object safety)
 - #65955 (ci: revert msys2 ca-certificates hack)
 - #65959 (Fix an incorrect docstring for Immediate in librustc_mir/interpret.)
 - #65979 (Switch CrateMetadata's source_map_import_info from RwLock to Once)
 - #65981 (work around aggressive syntax feature gating)

Failed merges:

r? @ghost

4 years agoRollup merge of #65981 - RalfJung:check-your-gates, r=Centril
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:12 +0000 (02:54 +0100)]
Rollup merge of #65981 - RalfJung:check-your-gates, r=Centril

work around aggressive syntax feature gating

This works around https://github.com/rust-lang/rust/issues/65860; fixing `rustc +nightly lib.rs --test --edition 2018` for libcore and thus unblocking https://github.com/RalfJung/miri-test-libstd.

4 years agoRollup merge of #65979 - spastorino:crate-metadata-mutexes, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:11 +0000 (02:54 +0100)]
Rollup merge of #65979 - spastorino:crate-metadata-mutexes, r=Mark-Simulacrum

Switch CrateMetadata's source_map_import_info from RwLock to Once

4 years agoRollup merge of #65959 - vext01:immediate-docstring, r=davidtwco
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:10 +0000 (02:54 +0100)]
Rollup merge of #65959 - vext01:immediate-docstring, r=davidtwco

Fix an incorrect docstring for Immediate in librustc_mir/interpret.

I suspect `Immediate` was once called `Value`?

4 years agoRollup merge of #65955 - pietroalbini:master-revert-msys2-hack, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:08 +0000 (02:54 +0100)]
Rollup merge of #65955 - pietroalbini:master-revert-msys2-hack, r=Mark-Simulacrum

ci: revert msys2 ca-certificates hack

The hack was added because upstream msys2 broke the ca-certificates package, but since then it has been fixed. This reverts CI to use the upstream package.

Part of #65767

4 years agoRollup merge of #65850 - mikeyhew:patch-1, r=nikomatsakis
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:07 +0000 (02:54 +0100)]
Rollup merge of #65850 - mikeyhew:patch-1, r=nikomatsakis

Update comments re type parameter hack in object safety

To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue https://github.com/rust-lang/rust/issues/43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.

cc @Centril @nikomatsakis @bovinebuddha

4 years agoRollup merge of #65434 - GuillaumeGomez:long-err-explanation-E0577, r=Dylan-DPC
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:05 +0000 (02:54 +0100)]
Rollup merge of #65434 - GuillaumeGomez:long-err-explanation-E0577, r=Dylan-DPC

Add long error explanation for E0577

Part of #61137.

r? @kinnison

4 years agoRollup merge of #65274 - pietroalbini:ci-upload-toolstate, r=alexcrichton
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:04 +0000 (02:54 +0100)]
Rollup merge of #65274 - pietroalbini:ci-upload-toolstate, r=alexcrichton

Upload toolstates.json to rust-lang-ci2

This PR does two things:

* Following up with https://github.com/rust-lang/rust/pull/65202, it migrates deploying artifacts to CI in a script. Both uploading release artifacts and CPU stats were merged into the same script, designing it to be easily extended.
* Uploads the toolstate JSON to `rust-lang-ci2` along with the release artifacts, both for Linux and Windows. This is needed because @RalfJung wants to stop shipping MIRI when its tests are failing, and the toolstate repo doesn't have entries for each commit. Having the toolstate data (just for that specific commit) on `rust-lang-ci2` will simplify the code a lot.

r? @alexcrichton
cc @RalfJung

4 years agoAuto merge of #65957 - Xanewok:update-rls, r=Xanewok
bors [Wed, 30 Oct 2019 22:37:21 +0000 (22:37 +0000)]
Auto merge of #65957 - Xanewok:update-rls, r=Xanewok

submodules: Bump RLS to 58869107ec162a821a4bee53cdd3f51c84cda3ea

Most importantly it contains https://github.com/rust-lang/rls/commit/d267b49c2f7914f5b4bc94916dc56d64b37adf3a which fixes the RLS build whenever Clippy is built successfully in Rust CI.

Closes #65944

r? @ghost

4 years agoMake init_locking return a reference to the initialized data
Santiago Pastorino [Wed, 30 Oct 2019 21:08:53 +0000 (18:08 -0300)]
Make init_locking return a reference to the initialized data

4 years agowork around aggressive syntax feature gating
Ralf Jung [Wed, 30 Oct 2019 19:59:15 +0000 (20:59 +0100)]
work around aggressive syntax feature gating

4 years agoChange CrateMetadata's source_map_import_info from RwLock to Once
Santiago Pastorino [Wed, 30 Oct 2019 19:22:29 +0000 (16:22 -0300)]
Change CrateMetadata's source_map_import_info from RwLock to Once

This field is created lazily on first use and after that is read only.
That's exactly what Once is for.

4 years agoCorrectly indent get_predicates function
Santiago Pastorino [Wed, 30 Oct 2019 19:22:11 +0000 (16:22 -0300)]
Correctly indent get_predicates function

4 years agoci: move toolstates.json to /tmp/toolstate/ and docker mount it
Pietro Albini [Wed, 30 Oct 2019 18:41:22 +0000 (19:41 +0100)]
ci: move toolstates.json to /tmp/toolstate/ and docker mount it

Before this commit toolstates.json was stored in /tmp and it wasn't
mounted outside the build container. That caused uploading the file in
the upload-artifacts task to fail, as the file was missing on the host.

Mounting /tmp/toolstates.json alone is not the best approach: if the
file is missing when the container is started the Docker engine will
create a *directory* named /tmp/toolstates.json.

The Docker issue could be solved by pre-creating an empty file named
/tmp/toolstates.json, but doing that could cause problems if bootstrap
fails to generate the file and the toolstate scripts receive an empty
JSON.

The approach I took in this commit is to instead mount a /tmp/toolstate
directory inside Docker, and create the toolstates.json file in it. That
also required a small bootstrap change to ensure the directory is
created if it's missing.

4 years agoFix libunwind build: Define __LITTLE_ENDIAN__ for LE targets
Vojtech Kral [Wed, 30 Oct 2019 16:51:43 +0000 (17:51 +0100)]
Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets

If __LITTLE_ENDIAN__ is missing, libunwind assumes big endian
and reads unwinding instructions wrong on ARM EHABI.

Fix #65765

4 years agodoc: reword iter module example and mention other methods
Lzu Tao [Wed, 30 Oct 2019 15:52:28 +0000 (15:52 +0000)]
doc: reword iter module example and mention other methods

4 years agoRemove references to now unused `E0526`
Dylan MacKenzie [Wed, 30 Oct 2019 15:28:11 +0000 (08:28 -0700)]
Remove references to now unused `E0526`

It remains as a comment in `error_codes.rs` for consistency with
other unused errors.

4 years agosubmodules: Bump RLS to 58869107ec162a821a4bee53cdd3f51c84cda3ea
Igor Matuszewski [Wed, 30 Oct 2019 08:47:42 +0000 (09:47 +0100)]
submodules: Bump RLS to 58869107ec162a821a4bee53cdd3f51c84cda3ea

Most importantly it contains https://github.com/rust-lang/rls/commit/d267b49c2f7914f5b4bc94916dc56d64b37adf3a
which fixes the RLS build whenever Clippy is built successfully in Rust CI.

4 years agoUpdate ui tests
Guillaume Gomez [Tue, 15 Oct 2019 11:52:57 +0000 (13:52 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0577
Guillaume Gomez [Tue, 15 Oct 2019 11:52:49 +0000 (13:52 +0200)]
Add long error explanation for E0577

4 years agoupdate submodules to rust-lang
Steve Klabnik [Wed, 30 Oct 2019 13:37:05 +0000 (08:37 -0500)]
update submodules to rust-lang

These are the repositories I've moved from rust-lang-nursery to
rust-lang, so we should update the submodules too.

4 years agoAuto merge of #65941 - ehuss:update-cargo-books, r=alexcrichton
bors [Wed, 30 Oct 2019 13:34:57 +0000 (13:34 +0000)]
Auto merge of #65941 - ehuss:update-cargo-books, r=alexcrichton

Update cargo, books.

## cargo

8 commits in 3ba5f27170db10af7a92f2b682e049397197b8fa..5da4b4d47963868d9878480197581ccbbdaece74
2019-10-22 15:05:18 +0000 to 2019-10-28 21:53:41 +0000
- Add --filter-platform to `cargo metadata`. (rust-lang/cargo#7376)
- Fix `cargo fix` not showing colors. (rust-lang/cargo#7550)
- Rephrase --manifest-path section (rust-lang/cargo#7409)
- Add a note to discourage the use of -Zminimal-versions. (rust-lang/cargo#7549)
- Fix profile override warning in a workspace. (rust-lang/cargo#7536)
- Fix some tests failing on Windows nightly. (rust-lang/cargo#7534)
- Show better error message for Windows abnormal termination. (rust-lang/cargo#7535)
- Run `apt update` before `apt install` (rust-lang/cargo#7541)

## reference

8 commits in 5b9d2fcefadfc32fceafacfc0dd9441d9b57dd94..4b21b646669e0af49fae7cae301898dc4bfaa1f0
2019-10-03 22:39:10 +0200 to 2019-10-27 22:33:11 +0100
- Document `const_constructor` feature (rust-lang-nursery/reference#677)
- Add `non_exhaustive` to reference. (rust-lang-nursery/reference#609)
- Re-add rust-docs component for lintcheck (rust-lang-nursery/reference#702)
- group signed and unsigned integers in layout table (rust-lang-nursery/reference#700)
- Fix layout table rendering (rust-lang-nursery/reference#699)
- Add reference for attributes in function parameters (rust-lang-nursery/reference#657)
- Update now that proc macros can expand to macro_rules. (rust-lang-nursery/reference#694)
- Fix match in union example. (rust-lang-nursery/reference#684)

## book

8 commits in 9bb8b161963fcebc9d9ccd732ba26f42108016d5..28fa3d15b0bc67ea5e79eeff2198e4277fc61baf
2019-10-14 18:42:55 -0500 to 2019-10-29 07:16:09 -0500
- Update Ch19.1 on slice splitting (rust-lang/book#1999)
- fixed inconsistent terminology regarding enums (rust-lang/book#2022)
- Update ch15-03 code to match output. (rust-lang/book#2020)
- Fixes rust-lang/book#2039 (rust-lang/book#2040)
- Update ch15-03-drop.md (rust-lang/book#2049)
- unit type value is also a value (rust-lang/book#2061)
- Minor: remove an extraneous `.` (rust-lang/book#2059)
- Clarifications and consistent use of quotation marks (rust-lang/book#1992)

## rust-by-example

4 commits in 0b111eaae36cc4b4997684be853882a59e2c7ca7..f3197ddf2abab9abdbc029def8164f4a748b0d91
2019-10-14 18:34:25 -0300 to 2019-10-29 10:17:40 -0300
- Fix typos (rust-lang/rust-by-example#1285)
- Improve Cargo / Dependencies section (rust-lang/rust-by-example#1287)
- Improve Cargo / Build Scripts section (rust-lang/rust-by-example#1288)
- Make if_let exercise runnable (rust-lang/rust-by-example#1289)

4 years agoFix an incorrect docstring for Immediate in librustc_mir/interpret.
Edd Barrett [Wed, 30 Oct 2019 10:03:41 +0000 (10:03 +0000)]
Fix an incorrect docstring for Immediate in librustc_mir/interpret.

4 years agoci: revert msys2 ca-certificates hack
Pietro Albini [Wed, 30 Oct 2019 08:13:26 +0000 (09:13 +0100)]
ci: revert msys2 ca-certificates hack

The hack was added because upstream msys2 broke the ca-certificates
package, but since then it has been fixed. This reverts CI to use the
upstream package.

4 years agoMake ItemContext available for better diagnositcs.
Giles Cope [Mon, 28 Oct 2019 19:04:15 +0000 (19:04 +0000)]
Make ItemContext available for better diagnositcs.

4 years agoAuto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakis
bors [Wed, 30 Oct 2019 02:20:55 +0000 (02:20 +0000)]
Auto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakis

Custom lifetime error for `impl` item doesn't conform to `trait`

Partly addresses #42706, #41343, fix #40900.

4 years agovxWorks: remove all code related to UNIX socket as it is not supported by vxWorks
BaoshanPang [Tue, 29 Oct 2019 21:08:47 +0000 (14:08 -0700)]
vxWorks: remove all code related to UNIX socket as it is not supported by vxWorks

4 years agoStop emitting error in `qualify_consts` if promotion fails
Dylan MacKenzie [Tue, 29 Oct 2019 19:56:59 +0000 (12:56 -0700)]
Stop emitting error in `qualify_consts` if promotion fails

4 years agoEmit errors in `promote_consts` when required promotion fails
Dylan MacKenzie [Tue, 29 Oct 2019 19:50:43 +0000 (12:50 -0700)]
Emit errors in `promote_consts` when required promotion fails

4 years agoAdd method to `Candidate` that determines its promotability rules
Dylan MacKenzie [Tue, 29 Oct 2019 15:24:59 +0000 (08:24 -0700)]
Add method to `Candidate` that determines its promotability rules

4 years agoAuto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry
bors [Tue, 29 Oct 2019 19:12:01 +0000 (19:12 +0000)]
Auto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry

Rollup of 12 pull requests

Successful merges:

 - #65405 (Create new error E0742 and add long error explanation)
 - #65539 (resolve: Turn the "non-empty glob must import something" error into a lint)
 - #65724 (ci: refactor pr tools job skipping)
 - #65741 (Prevent help popup to disappear when clicking on it)
 - #65832 (Re-enable Emscripten's exception handling support)
 - #65843 (Enable dist for MIPS64 musl targets)
 - #65898 (add basic HermitCore support within libtest)
 - #65900 (proc_macro: clean up bridge::client::__run_expand{1,2} a bit.)
 - #65906 (Update mdbook to 0.3.3)
 - #65920 (Use rustc-workspace-hack for rustbook)
 - #65930 (doc: use new feature gate for c_void type)
 - #65936 (save-analysis: Account for async desugaring in async fn return types)

Failed merges:

 - #65434 (Add long error explanation for E0577)

r? @ghost

4 years agoRollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakis
Tyler Mandry [Tue, 29 Oct 2019 19:01:49 +0000 (12:01 -0700)]
Rollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakis

save-analysis: Account for async desugaring in async fn return types

Closes #65590

When visiting the return type of an async function we need to take into account its desugaring, since it introduces a new definition under which the return type is redefined.

r? @nikomatsakis

4 years agoRollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay
Tyler Mandry [Tue, 29 Oct 2019 19:01:47 +0000 (12:01 -0700)]
Rollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay

doc: use new feature gate for c_void type

Closes #63694, closes #55619

4 years agoRollup merge of #65920 - smaeul:patch/workspace-hack, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:46 +0000 (12:01 -0700)]
Rollup merge of #65920 - smaeul:patch/workspace-hack, r=alexcrichton

Use rustc-workspace-hack for rustbook

As rustbook now depends transitively on openssl, it needs access to the
rustc-workspace-hack/all-static feature to pick up openssl-sys/vendored.
This fixes the rust build with `all-static = true` on systems where
openssl is not installed (e.g. when cross-compiling).

4 years agoRollup merge of #65906 - integer32llc:update-mdbook, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:44 +0000 (12:01 -0700)]
Rollup merge of #65906 - integer32llc:update-mdbook, r=alexcrichton

Update mdbook to 0.3.3

There are some new features of mdbook that I'd like to use in TRPL.

4 years agoRollup merge of #65900 - eddyb:proc-macro-cleanup, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:43 +0000 (12:01 -0700)]
Rollup merge of #65900 - eddyb:proc-macro-cleanup, r=alexcrichton

proc_macro: clean up bridge::client::__run_expand{1,2} a bit.

See commit titles/diffs for more details.

The first commit is made possible by #53451 being fixed (almost a year ago).
The last commit should remove the need for `#[allow(improper_ctypes)]` in #65134.

4 years agoRollup merge of #65898 - hermitcore:rusty-hermit, r=kennytm
Tyler Mandry [Tue, 29 Oct 2019 19:01:41 +0000 (12:01 -0700)]
Rollup merge of #65898 - hermitcore:rusty-hermit, r=kennytm

add basic HermitCore support within libtest

This an extension to #65167. The current pull request extend libtest to support HermitCore as target OS.

4 years agoRollup merge of #65843 - xen0n:mips64-musl-targets-with-ci, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:40 +0000 (12:01 -0700)]
Rollup merge of #65843 - xen0n:mips64-musl-targets-with-ci, r=alexcrichton

Enable dist for MIPS64 musl targets

Continuing work in #63165, necessary libc changes are in place and published so here we go!