]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #70359 - kornelski:mustsplit, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:36 +0000 (21:32 +0100)]
Rollup merge of #70359 - kornelski:mustsplit, r=Dylan-DPC

must_use on split_off

A couple more for #70194

4 years agoRollup merge of #70355 - GuillaumeGomez:cleanup-e0454, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:34 +0000 (21:32 +0100)]
Rollup merge of #70355 - GuillaumeGomez:cleanup-e0454, r=Dylan-DPC

Clean up E0454

r? @Dylan-DPC

4 years agoRollup merge of #70350 - workingjubilee:patch-1, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:32 +0000 (21:32 +0100)]
Rollup merge of #70350 - workingjubilee:patch-1, r=Dylan-DPC

Request "-Z unstable-options" for unstable options

Explicitly requests the "-Z unstable-options" flag if someone attempts to use
a cargo option gated by it. This enhances discoverability, particularly in the
instance where the user is on the nightly compiler but isn't using the flag.

This relates to, but does not end with or resolve, issue #65770.

4 years agoRollup merge of #70342 - withoutboats:io-slice-send-sync, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:31 +0000 (21:32 +0100)]
Rollup merge of #70342 - withoutboats:io-slice-send-sync, r=Mark-Simulacrum

IoSlice/IoSliceMut should be Send and Sync

Closes #70308

4 years agoRollup merge of #70241 - RalfJung:global-mem, r=oli-obk
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:29 +0000 (21:32 +0100)]
Rollup merge of #70241 - RalfJung:global-mem, r=oli-obk

Miri: move ModifiedStatic to ConstEval errors

Also generally adjust terminology from "static" to "global" where appropriate (to avoid confusion with specifically `static` items).

4 years agoRollup merge of #70234 - anp:tracked-std-traits, r=Amanieu
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:28 +0000 (21:32 +0100)]
Rollup merge of #70234 - anp:tracked-std-traits, r=Amanieu

#[track_caller] on core::ops::{Index, IndexMut}.

Applies the attribute to `core::ops::Index(Mut)` and enough std internals to cover the [functions listed in "tier 1" in the original RFC](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md#survey-of-panicking-standard-functions).

Split out from #69251 to allow separate assessment of perf impact.

To my knowledge, this is the last piece of implementing RFC 2091.

Tracking issue: https://github.com/rust-lang/rust/issues/47809

4 years agoRollup merge of #70023 - GuillaumeGomez:cleanup-e0436, r=Centril
Mazdak Farrokhzad [Tue, 24 Mar 2020 20:32:26 +0000 (21:32 +0100)]
Rollup merge of #70023 - GuillaumeGomez:cleanup-e0436, r=Centril

clean up E0436 explanation

r? @Dylan-DPC

4 years agomust_use on split_off
Kornel [Tue, 24 Mar 2020 13:33:35 +0000 (13:33 +0000)]
must_use on split_off

#70194

4 years agoAuto merge of #70190 - pietroalbini:gha, r=Mark-Simulacrum
bors [Tue, 24 Mar 2020 15:49:27 +0000 (15:49 +0000)]
Auto merge of #70190 - pietroalbini:gha, r=Mark-Simulacrum

Add GitHub Actions configuration

This PR adds the GitHub Actions configuration to the rust-lang/rust repository. The configuration will be run in parallel with Azure Pipelines until the evaluation finishes: the infrastructure team will then decide whether to switch.

Since GitHub Actions doesn't currently have any way to include pieces of configuration, this also adds the `src/tools/expand-yaml-anchors` tool, which serves as a sort of templating system. Otherwise the configuration is a mostly straight port from the Azure Pipelines configuration (thanks to all the PRs opened in the past).

There are still a few small things I need to fix before we can land this, but it's mostly complete and ready for an initial review.

r? @Mark-Simulacrum

4 years agospaces between braces really ruin readability
Without Boats [Tue, 24 Mar 2020 14:39:29 +0000 (15:39 +0100)]
spaces between braces really ruin readability

4 years agoci: add notice on top of the azure pipelines configuration
Pietro Albini [Mon, 23 Mar 2020 14:01:58 +0000 (15:01 +0100)]
ci: add notice on top of the azure pipelines configuration

This will inform contributors tweaking the Azure Pipelines configuration
that they also need to tweak the GitHub Actions setup.

4 years agobootstrap: remove default and only_host from expand-yaml-anchors
Pietro Albini [Fri, 20 Mar 2020 17:37:34 +0000 (18:37 +0100)]
bootstrap: remove default and only_host from expand-yaml-anchors

4 years agoci: run the "bors build finished" jobs only during try and auto runs
Pietro Albini [Fri, 20 Mar 2020 17:28:47 +0000 (18:28 +0100)]
ci: run the "bors build finished" jobs only during try and auto runs

4 years agoci: move the whole workspace directory on gha/linux
Pietro Albini [Fri, 20 Mar 2020 17:06:21 +0000 (18:06 +0100)]
ci: move the whole workspace directory on gha/linux

Moving just the `obj` directory created problems with mountpoints and
Docker containers, so this tries to symlink the parent directory.

4 years agoci: run gha workflows for try, auto and master on the fork
Pietro Albini [Fri, 20 Mar 2020 15:46:45 +0000 (16:46 +0100)]
ci: run gha workflows for try, auto and master on the fork

4 years agoci: fix out of disk space errors on linux GHA
Pietro Albini [Fri, 20 Mar 2020 16:02:10 +0000 (17:02 +0100)]
ci: fix out of disk space errors on linux GHA

The /mnt mount point has 53GB of free disk space at the time of writing
this commit, so this moves the build there to avoid running out of disk
space during builds.

4 years agoci: don't move the build to C: on GitHub Actions
Pietro Albini [Mon, 16 Dec 2019 11:38:43 +0000 (12:38 +0100)]
ci: don't move the build to C: on GitHub Actions

On Azure Pipeliones, the C: filesystem is huge with a lot of free space,
while D: is small. By default builds happened in D:, so we added a
script to symlink the big directories to C:, granting us more space.

    Filesystem  Size  Used Avail Use%
    C:          256G  143G  114G  56%
    D:           14G  2.0G   13G  15%

On GitHub Actions instead C: is almost full, and we have a lot of free
space on D:, where the build happens.

    Filesystem  Size  Used Avail Use%
    C:          128G  114G   15G  89%
    D:          56G   4.8G   52G   9%

This commit stops creating the symlink on GitHub Actions, fixing the out
of disk space errors we were seeing on some Windows builders.

4 years agoci: add github actions configuration
Pietro Albini [Tue, 26 Nov 2019 11:06:30 +0000 (12:06 +0100)]
ci: add github actions configuration

4 years agoci: rename script windows-symlink-build-dir to symlink-build-dir
Pietro Albini [Fri, 20 Mar 2020 15:49:39 +0000 (16:49 +0100)]
ci: rename script windows-symlink-build-dir to symlink-build-dir

There will be a need to symlink the Linux build directory in the future
as well, so let's make the script name generic.

4 years agoci: fix azure pipeline specific code in install-awscli
Pietro Albini [Tue, 7 Jan 2020 10:08:58 +0000 (11:08 +0100)]
ci: fix azure pipeline specific code in install-awscli

4 years agoactually we can reject all reads from mutable allocs in const-prop
Ralf Jung [Tue, 24 Mar 2020 13:31:55 +0000 (14:31 +0100)]
actually we can reject all reads from mutable allocs in const-prop

4 years agoClean up E0454
Guillaume Gomez [Tue, 24 Mar 2020 12:58:00 +0000 (13:58 +0100)]
Clean up E0454

4 years agoAuto merge of #70163 - nikic:llvm-10-preparation, r=cuviper
bors [Tue, 24 Mar 2020 12:42:54 +0000 (12:42 +0000)]
Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper

Prepare for LLVM 10 upgrade

This is #67759 minus the submodule update.

 * Fix two compatibility issues in the rustllvm wrapper.
 * Update data layout strings in tests.
 * Fix LLVM version comparison (this become a problem because the major version has two digits now).

r? @cuviper

4 years agoAuto merge of #69894 - vtbassmatt:master, r=nellshamrell
bors [Tue, 24 Mar 2020 09:38:41 +0000 (09:38 +0000)]
Auto merge of #69894 - vtbassmatt:master, r=nellshamrell

establish immutable source for RUST_CONFIGURE_ARGS

fixes https://github.com/rust-lang/rust/issues/68671

4 years agofix const_prop ICE
Ralf Jung [Sun, 22 Mar 2020 08:23:19 +0000 (09:23 +0100)]
fix const_prop ICE

4 years agobless you
Ralf Jung [Sat, 21 Mar 2020 22:20:43 +0000 (23:20 +0100)]
bless you

4 years agoget back the more precise error message
Ralf Jung [Sat, 21 Mar 2020 19:44:39 +0000 (20:44 +0100)]
get back the more precise error message

4 years agobless; add test for mutating a static
Ralf Jung [Sat, 21 Mar 2020 18:47:52 +0000 (19:47 +0100)]
bless; add test for mutating a static

4 years agomove ModifiedStatic error to ConstEval errors, and generally adjust terminology from...
Ralf Jung [Sat, 21 Mar 2020 18:19:10 +0000 (19:19 +0100)]
move ModifiedStatic error to ConstEval errors, and generally adjust terminology from "static" to "global" where appropriate

4 years agoAuto merge of #70351 - Centril:rollup-tveoq3w, r=Centril
bors [Tue, 24 Mar 2020 06:14:41 +0000 (06:14 +0000)]
Auto merge of #70351 - Centril:rollup-tveoq3w, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #68884 (Make the `type_of` return a generic type for generators)
 - #69788 (Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book)
 - #70074 (Expand: nix all fatal errors)
 - #70077 (Store idents for `DefPathData` into crate metadata)
 - #70213 (traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).)
 - #70259 (Use Reveal::All in MIR optimizations)
 - #70284 (correctly handle const params in type_of)
 - #70289 (Refactor `codegen`)

Failed merges:

r? @ghost

4 years agoRollup merge of #70289 - nnethercote:refactor-codegen, r=eddyb
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:42 +0000 (07:13 +0100)]
Rollup merge of #70289 - nnethercote:refactor-codegen, r=eddyb

Refactor `codegen`

`codegen` in `src/librustc_codegen_llvm/back/write.rs` is long and has complex control flow. These commits refactor it and make it easier to understand.

4 years agoRollup merge of #70284 - lcnr:issue70273-what-the-heck-git, r=eddyb
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:40 +0000 (07:13 +0100)]
Rollup merge of #70284 - lcnr:issue70273-what-the-heck-git, r=eddyb

correctly handle const params in type_of

extends #70223, retry of #70276

fixes #70273

r? @eddyb cc @varkor

4 years agoRollup merge of #70259 - wesleywiser:use_reveal_all, r=eddyb
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:38 +0000 (07:13 +0100)]
Rollup merge of #70259 - wesleywiser:use_reveal_all, r=eddyb

Use Reveal::All in MIR optimizations

Resolves some code review feedback in #67662.

Fixes #68855

r? @eddyb

4 years agoRollup merge of #70213 - eddyb:stalled-on-ty-or-const, r=nikomatsakis
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:37 +0000 (07:13 +0100)]
Rollup merge of #70213 - eddyb:stalled-on-ty-or-const, r=nikomatsakis

traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).

This PR addresses the representation side of #70180, but only *actually collects* `ty::Infer`s via `Ty::walk` into `stalled_on` (collecting `ty::ConstKind::Infer`s requires #70164).

However, it should be enough to handle #70107's needs (WF obligations are stalled only on the outermost type/const being an inference variable, no `walk`-ing is involved).

This is my second attempt, see #70181 for the previous one, which unacceptably regressed perf.

r? @nikomatsakis cc @nnethercote

4 years agoRollup merge of #70077 - Aaron1011:feature/new-def-path-ident, r=petrochenkov
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:35 +0000 (07:13 +0100)]
Rollup merge of #70077 - Aaron1011:feature/new-def-path-ident, r=petrochenkov

Store idents for `DefPathData` into crate metadata

Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.

We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.

This improves the output of several tests, which previously had messages
suppressed due to dummy spans.

This is a prerequisite for #68686, since throwing away a `Span` means
that we lose hygiene information.

4 years agoRollup merge of #70074 - Centril:unpanictry, r=petrochenkov
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:33 +0000 (07:13 +0100)]
Rollup merge of #70074 - Centril:unpanictry, r=petrochenkov

Expand: nix all fatal errors

Basically, we go after all `.span_fatal` / `FatalError.raise()` and similar things and remove them one by one until there are no fatal errors left.

r? @petrochenkov

4 years agoRollup merge of #69788 - ArekPiekarz:unstable_book_optin_builtin_traits, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:31 +0000 (07:13 +0100)]
Rollup merge of #69788 - ArekPiekarz:unstable_book_optin_builtin_traits, r=Dylan-DPC

Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book

A simple fix in docs - the sequence of words in basic example of negative trait implementation was reversed.

4 years agoRollup merge of #68884 - Zoxc:gen-type, r=nikomatsakis
Mazdak Farrokhzad [Tue, 24 Mar 2020 06:13:28 +0000 (07:13 +0100)]
Rollup merge of #68884 - Zoxc:gen-type, r=nikomatsakis

Make the `type_of` return a generic type for generators

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

r? @nikomatsakis

4 years agoRequest "-Z unstable-options" for unstable options
Jubilee [Tue, 24 Mar 2020 05:54:06 +0000 (22:54 -0700)]
Request "-Z unstable-options" for unstable options

Explicitly requests the "-Z unstable-options" flag if someone attempts to use
a cargo option gated by it. This enhances discoverability, particularly in the
instance where the user is on the nightly compiler but isn't using the flag.

4 years agopacify missing sysroot spans issue
Mazdak Farrokhzad [Mon, 23 Mar 2020 00:31:03 +0000 (01:31 +0100)]
pacify missing sysroot spans issue

4 years agofix rebase fallout due to #69497.
Mazdak Farrokhzad [Sat, 21 Mar 2020 21:12:24 +0000 (22:12 +0100)]
fix rebase fallout due to #69497.

4 years agofix rebase fallout
Mazdak Farrokhzad [Fri, 20 Mar 2020 16:01:53 +0000 (17:01 +0100)]
fix rebase fallout

4 years agoexpand: address review comments
Mazdak Farrokhzad [Wed, 18 Mar 2020 12:34:11 +0000 (13:34 +0100)]
expand: address review comments

4 years agoexpand: add recovery for parse_nt
Mazdak Farrokhzad [Tue, 17 Mar 2020 13:13:32 +0000 (14:13 +0100)]
expand: add recovery for parse_nt

4 years agodefatalize expand_test_or_bench
Mazdak Farrokhzad [Tue, 17 Mar 2020 12:27:56 +0000 (13:27 +0100)]
defatalize expand_test_or_bench

4 years agodefatalize get_test_runner
Mazdak Farrokhzad [Tue, 17 Mar 2020 12:19:06 +0000 (13:19 +0100)]
defatalize get_test_runner

4 years agoexpand: nix unused method
Mazdak Farrokhzad [Tue, 17 Mar 2020 12:06:01 +0000 (13:06 +0100)]
expand: nix unused method

4 years agodefatalize `compile_declarative_macro`
Mazdak Farrokhzad [Tue, 17 Mar 2020 11:54:57 +0000 (12:54 +0100)]
defatalize `compile_declarative_macro`

4 years agombe::transcribe: defatalize errors.
Mazdak Farrokhzad [Tue, 17 Mar 2020 11:12:57 +0000 (12:12 +0100)]
mbe::transcribe: defatalize errors.

4 years agoremove ExtCxt::struct_span_warn
Mazdak Farrokhzad [Tue, 17 Mar 2020 10:35:21 +0000 (11:35 +0100)]
remove ExtCxt::struct_span_warn

4 years agodefatalize ProcMacroDerive::expand
Mazdak Farrokhzad [Tue, 17 Mar 2020 10:30:53 +0000 (11:30 +0100)]
defatalize ProcMacroDerive::expand

Also remove ExtCtxt::struct_span_fatal.

4 years agodefatalize AttrProcMacro::expand
Mazdak Farrokhzad [Tue, 17 Mar 2020 09:56:00 +0000 (10:56 +0100)]
defatalize AttrProcMacro::expand

4 years agodefatalize BangProcMacro::expand
Mazdak Farrokhzad [Tue, 17 Mar 2020 09:09:18 +0000 (10:09 +0100)]
defatalize BangProcMacro::expand

4 years agogeneric_extension: defatalize Error case
Mazdak Farrokhzad [Tue, 17 Mar 2020 08:37:59 +0000 (09:37 +0100)]
generic_extension: defatalize Error case

4 years agonix remaining rustc_expand::panictry! uses.
Mazdak Farrokhzad [Tue, 17 Mar 2020 07:59:56 +0000 (08:59 +0100)]
nix remaining rustc_expand::panictry! uses.

4 years agonix panictry! in ParserAnyMacro::make
Mazdak Farrokhzad [Tue, 17 Mar 2020 07:55:28 +0000 (08:55 +0100)]
nix panictry! in ParserAnyMacro::make

4 years agorustc_expand::base: nix panictry! uses
Mazdak Farrokhzad [Tue, 17 Mar 2020 07:29:34 +0000 (08:29 +0100)]
rustc_expand::base: nix panictry! uses

4 years agoAuto merge of #70343 - Centril:rollup-94egfvs, r=Centril
bors [Tue, 24 Mar 2020 00:53:25 +0000 (00:53 +0000)]
Auto merge of #70343 - Centril:rollup-94egfvs, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #67761 (Move the dep_graph construction to a dedicated crate.)
 - #69740 (Replace some desc logic in librustc_lint with article_and_desc)
 - #69981 (Evaluate repeat expression lengths as late as possible)
 - #70087 (Remove const eval loop detector)
 - #70242 (Improve E0308 error message wording)
 - #70264 (Fix invalid suggestion on `&mut` iterators yielding `&` references)
 - #70267 (get rid of ConstPropUnsupported; use ZST marker structs instead)
 - #70277 (Remove `ReClosureBound`)
 - #70283 (Add regression test for #70155.)
 - #70294 (Account for bad placeholder types in where clauses)
 - #70309 (Clean up E0452 explanation)

Failed merges:

r? @ghost

4 years agoRollup merge of #70309 - GuillaumeGomez:cleanup-e0452, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:54 +0000 (00:49 +0100)]
Rollup merge of #70309 - GuillaumeGomez:cleanup-e0452, r=Dylan-DPC

Clean up E0452 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70294 - estebank:bad-placeholder-in-where, r=Centril
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:52 +0000 (00:49 +0100)]
Rollup merge of #70294 - estebank:bad-placeholder-in-where, r=Centril

Account for bad placeholder types in where clauses

Fix #70291. Follow up to #69148.

4 years agoRollup merge of #70283 - CDirkx:regression-test-70155, r=oli-obk
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:50 +0000 (00:49 +0100)]
Rollup merge of #70283 - CDirkx:regression-test-70155, r=oli-obk

Add regression test for #70155.

With #70166 merged, `RangeInclusive` now derives `PartialEq` and `Eq`, implementing structural equality and as a side effect the range is now usable with const generics, closing #70155.

As per [#70166 (comment)](https://github.com/rust-lang/rust/pull/70166#issuecomment-601872201) a test is added to avoid a change to the private fields or the equality implementation of the range from subtly reverting #70155.

4 years agoRollup merge of #70277 - matthewjasper:remove-closurebound, r=nikomatsakis
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:48 +0000 (00:49 +0100)]
Rollup merge of #70277 - matthewjasper:remove-closurebound, r=nikomatsakis

Remove `ReClosureBound`

We now substitute external names for regions in the query response.

r? @nikomatsakis

4 years agoRollup merge of #70267 - RalfJung:const-prop-unsup, r=oli-obk,wesleywiser
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:46 +0000 (00:49 +0100)]
Rollup merge of #70267 - RalfJung:const-prop-unsup, r=oli-obk,wesleywiser

get rid of ConstPropUnsupported; use ZST marker structs instead

This gets rid of yet another machine-specific error variant.

r? @oli-obk

4 years agoRollup merge of #70264 - tirr-c:issue-69789-mut-suggestion, r=estebank
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:45 +0000 (00:49 +0100)]
Rollup merge of #70264 - tirr-c:issue-69789-mut-suggestion, r=estebank

Fix invalid suggestion on `&mut` iterators yielding `&` references

Fixes #69789.

rustc suggested an invalid code when `&` reference from `&mut` iterator is mutated. The compiler knew we're mutating a value behind `&` reference, but as the assignment RHS is from desugaring, it could only see the iterator expression from source and inserted `mut` there.

r? @estebank

4 years agoRollup merge of #70242 - DeeDeeG:improve-e0308, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:43 +0000 (00:49 +0100)]
Rollup merge of #70242 - DeeDeeG:improve-e0308, r=Dylan-DPC

Improve E0308 error message wording

Hi folks,

I made [a post on Reddit](https://old.reddit.com/r/rust/comments/fmi11x/consider_linting_rusts_documentationerror_text/) about how (IMO) the docs/error messages can be a bit intimidating, one thing led to another, and I was encouraged to submit a Pull Request if I felt I could re-phrase the error message that I used as an example.

So that's this Pull Request. Open to any feedback or style changes, and I understand this is subjective.

(On another note: I am happy to see [this message was recently improved](https://github.com/rust-lang/rust/pull/69139) in `master`, so it's already better than it is in stable Rust 1.42.0.)

Ideally the last sentence could be split into at least two: [sentence explaining the inferred type.] [Sentence explaining explicit type.] [Sentence that summarizes that "this is bad," and why.]

But I'm not sure how to do so; I'm wary of writing something that turns out to be technically incorrect.

4 years agoRollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, r=RalfJung
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:41 +0000 (00:49 +0100)]
Rollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, r=RalfJung

Remove const eval loop detector

Now that there is a configurable instruction limit for CTFE (see #67260), we can replace the loop detector with something much simpler. See #66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable).

This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for `const_eval_limit` to work around this.

Resolves #54384 cc #49980
r? @oli-obk cc @RalfJung

4 years agoRollup merge of #69981 - oli-obk:const_blocks, r=eddyb
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:39 +0000 (00:49 +0100)]
Rollup merge of #69981 - oli-obk:const_blocks, r=eddyb

Evaluate repeat expression lengths as late as possible

Fixes #68567

r? @varkor

4 years agoRollup merge of #69740 - mark-i-m:describe-it-3, r=eddyb
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:37 +0000 (00:49 +0100)]
Rollup merge of #69740 - mark-i-m:describe-it-3, r=eddyb

Replace some desc logic in librustc_lint with article_and_desc

r? @eddyb @Centril @matthewjasper

Followup to https://github.com/rust-lang/rust/pull/69674

Blocked on #69498

4 years agoRollup merge of #67761 - cjgillot:split_graph, r=Zoxc
Mazdak Farrokhzad [Mon, 23 Mar 2020 23:49:36 +0000 (00:49 +0100)]
Rollup merge of #67761 - cjgillot:split_graph, r=Zoxc

Move the dep_graph construction to a dedicated crate.

The interface for librustc consists in two traits: `DepKind` and `DepContext`.

The `DepKind` is the main interface. It allows to probe properties of the dependency.
As before, `DepNode` is the pair of a `DepKind` object and a hash fingerprint.

The `DepContext` takes the place of the `TyCtxt`, and handles communication with the query engine.

The use of the `ImplicitCtxt` through `ty::tls` is done through the `DepKind` trait.
This may not be the best choice, but it seemed like the simplest.

4 years agocorrect rustc version
Without Boats [Mon, 23 Mar 2020 23:34:48 +0000 (00:34 +0100)]
correct rustc version

4 years agoIoSlice/IoSliceMut should be Send and Sync
Without Boats [Mon, 23 Mar 2020 23:33:25 +0000 (00:33 +0100)]
IoSlice/IoSliceMut should be Send and Sync

4 years agoRun rustfmt
Oliver Scherer [Mon, 23 Mar 2020 23:16:05 +0000 (00:16 +0100)]
Run rustfmt

4 years agoMove import.
Camille GILLOT [Mon, 23 Mar 2020 06:28:53 +0000 (07:28 +0100)]
Move import.

4 years agoFully qualify the path to DepKind.
Camille GILLOT [Sun, 22 Mar 2020 23:16:00 +0000 (00:16 +0100)]
Fully qualify the path to DepKind.

This is needed since `middle::cstore` defines another type named
`DepKind`, and we should not rely on shadowing to get the right one.

4 years agoAddress review.
Camille GILLOT [Sun, 22 Mar 2020 19:47:30 +0000 (20:47 +0100)]
Address review.

4 years agoPut extract_def_id back on DepNode.
Camille GILLOT [Sat, 21 Mar 2020 08:28:37 +0000 (09:28 +0100)]
Put extract_def_id back on DepNode.

4 years agoRemove assert_ignored and with_ignore_deps.
Camille GILLOT [Fri, 20 Mar 2020 23:27:09 +0000 (00:27 +0100)]
Remove assert_ignored and with_ignore_deps.

4 years agoMerge ensure_node_can_be_forced into force_from_dep_node.
Camille GILLOT [Fri, 20 Mar 2020 23:21:57 +0000 (00:21 +0100)]
Merge ensure_node_can_be_forced into force_from_dep_node.

4 years agoFallout in other crates.
Camille GILLOT [Wed, 18 Mar 2020 09:32:58 +0000 (10:32 +0100)]
Fallout in other crates.

4 years agoMake librustc_query_system compile.
Camille GILLOT [Wed, 18 Mar 2020 09:25:22 +0000 (10:25 +0100)]
Make librustc_query_system compile.

4 years agoMove dep_graph to new crate librustc_query_system.
Camille GILLOT [Tue, 31 Dec 2019 09:51:58 +0000 (10:51 +0100)]
Move dep_graph to new crate librustc_query_system.

4 years agoAuto merge of #70322 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Mon, 23 Mar 2020 22:02:13 +0000 (22:02 +0000)]
Auto merge of #70322 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from d8e6e4cf to 1ff81c1b

Changes:
````
rustup https://github.com/rust-lang/rust/pull/69968/
Fix documentation generation for configurable lints
Fix single binding in closure
Improvement: Don't show function body in needless_lifetimes
````
Fixes #70310
r? @Dylan-DPC

4 years agoSplit out some impls from rustc::mir into a separate submodule
Oliver Scherer [Mon, 23 Mar 2020 21:39:59 +0000 (22:39 +0100)]
Split out some impls from rustc::mir into a separate submodule

4 years agoRemove leftover mentions of `from_anon_const`
Oliver Scherer [Mon, 23 Mar 2020 21:24:31 +0000 (22:24 +0100)]
Remove leftover mentions of `from_anon_const`

4 years agoAccount for bad placeholder types in where clauses
Esteban Küber [Mon, 23 Mar 2020 01:50:30 +0000 (18:50 -0700)]
Account for bad placeholder types in where clauses

4 years agoAuto merge of #70330 - Centril:rollup-ts0clvx, r=Centril
bors [Mon, 23 Mar 2020 18:48:02 +0000 (18:48 +0000)]
Auto merge of #70330 - Centril:rollup-ts0clvx, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #68700 (Add Wake trait for safe construction of Wakers.)
 - #69494 (Stabilize --crate-version option in rustdoc)
 - #70080 (rustc_mir: remove extra space when pretty-printing MIR.)
 - #70195 (Add test for issue #53275)
 - #70199 (Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.)
 - #70299 (add err_machine_stop macro)
 - #70300 (Reword unused variable warning)
 - #70315 (Rename remaining occurences of Void to Opaque.)
 - #70318 (Split long derive lists into two derive attributes.)

Failed merges:

r? @ghost

4 years agoLimit `from_anon_const` to `AnonConst`s.
Oliver Scherer [Mon, 23 Mar 2020 18:35:19 +0000 (19:35 +0100)]
Limit `from_anon_const` to `AnonConst`s.

4 years agoUpdate tests
John Kåre Alsaker [Thu, 6 Feb 2020 09:33:05 +0000 (10:33 +0100)]
Update tests

4 years agoMerge tests.
CDirkx [Mon, 23 Mar 2020 18:27:13 +0000 (19:27 +0100)]
Merge tests.

Merge tests to a single test file.

4 years agoAddress review comments
Oliver Scherer [Mon, 23 Mar 2020 18:19:07 +0000 (19:19 +0100)]
Address review comments

4 years agoAdd const generics test for all range types.
CDirkx [Mon, 23 Mar 2020 18:16:12 +0000 (19:16 +0100)]
Add const generics test for all range types.

In addition to the regression test of `RangeInclusive` for #70155, now all range types are checked for usability within const generics:

- `RangeFrom`
- `RangeFull`
- `RangeToInclusive`
- `RangeTo`
- `Range`

The test are moved from `test\ui\const-generics\issues\issue-70155` to `test\ui\const-generics\std\range` in anticipation of future similar tests for std types.

4 years agoRollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:57 +0000 (19:04 +0100)]
Rollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPC

Split long derive lists into two derive attributes.

4 years agoRollup merge of #70315 - anyska:void-rename, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:55 +0000 (19:04 +0100)]
Rollup merge of #70315 - anyska:void-rename, r=Mark-Simulacrum

Rename remaining occurences of Void to Opaque.

Two mentions of the type were missed when the type was renamed.

4 years agoRollup merge of #70300 - aleksator:66636_reword_unused_variable_warning, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:54 +0000 (19:04 +0100)]
Rollup merge of #70300 - aleksator:66636_reword_unused_variable_warning, r=Dylan-DPC

Reword unused variable warning

Fixes #66636

4 years agoRollup merge of #70299 - RalfJung:err_machine_stop, r=oli-obk
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:52 +0000 (19:04 +0100)]
Rollup merge of #70299 - RalfJung:err_machine_stop, r=oli-obk

add err_machine_stop macro

We have that for all other error kinds, but here I somehow forgot it.

r? @oli-obk

4 years agoRollup merge of #70199 - pnkfelix:issue-68808-dont-turn-dummy-spans-into-invalid...
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:51 +0000 (19:04 +0100)]
Rollup merge of #70199 - pnkfelix:issue-68808-dont-turn-dummy-spans-into-invalid-lines, r=estebank

Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.

This required revising some of the client code to stop relying on the returned set of lines being non-empty.

Fix #68808

4 years agoRollup merge of #70195 - rylev:test-for-53275, r=Centril
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:49 +0000 (19:04 +0100)]
Rollup merge of #70195 - rylev:test-for-53275, r=Centril

Add test for issue #53275

Fixes #53275

4 years agoRollup merge of #70080 - anyska:mir-double-space, r=oli-obk
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:47 +0000 (19:04 +0100)]
Rollup merge of #70080 - anyska:mir-double-space, r=oli-obk

rustc_mir: remove extra space when pretty-printing MIR.

4 years agoRollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, r=ehuss,aleksator...
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:45 +0000 (19:04 +0100)]
Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, r=ehuss,aleksator,ollie27

Stabilize --crate-version option in rustdoc

I don't see any reason to not stabilize it anymore, so let's go!

cc @kinnison @ehuss

r? @ollie27

4 years agoRollup merge of #68700 - withoutboats:wake-trait, r=withoutboats
Mazdak Farrokhzad [Mon, 23 Mar 2020 18:04:43 +0000 (19:04 +0100)]
Rollup merge of #68700 - withoutboats:wake-trait, r=withoutboats

Add Wake trait for safe construction of Wakers.

Currently, constructing a waker requires calling the unsafe `Waker::from_raw` API. This API requires the user to manually construct a vtable for the waker themself - which is both cumbersome and very error prone. This API would provide an ergonomic, straightforward and guaranteed memory-safe way of constructing a waker.

It has been our longstanding intention that the `Waker` type essentially function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two considerations prevented the original API from being shipped as simply an `Arc<dyn Wake>`:

- We want to support futures on embedded systems, which may not have an allocator, and in optimized executors for which this API may not be best-suited. Therefore, we have always explicitly supported the maximally-flexible (but also memory-unsafe) `RawWaker` API, and `Waker` has always lived in libcore.
- Because `Waker` lives in libcore and `Arc` lives in liballoc, it has not been feasible to provide a constructor for `Waker` from `Arc<dyn Wake>`.

Therefore, the Wake trait was left out of the initial version of the task waker API.

However, as Rust 1.41, it is possible under the more flexible orphan rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc. Therefore, we can now define this constructor even though `Waker` lives in libcore.

This PR adds these APIs:

- A `Wake` trait, which contains two methods
    - A required method `wake`, which is called by `Waker::wake`
    - A provided method `wake_by_ref`, which is called by `Waker::wake_by_ref` and which implementors can override if they can optimize this use case.
- An implementation of `From<Arc<W>> for Waker where W: Wake + Send + Sync + 'static`
- A similar implementation of `From<Arc<W>> for RawWaker`.