]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #67313 - oli-obk:document_all_the_t̶h̶i̶n̶g̶s̶dataflow, r=ecstatic...
Yuki Okushi [Mon, 13 Jan 2020 07:44:13 +0000 (16:44 +0900)]
Rollup merge of #67313 - oli-obk:document_all_the_t̶h̶i̶n̶g̶s̶dataflow, r=ecstatic-morse

Document more use cases of dataflow

r? @ecstatic-morse

4 years agoAuto merge of #67900 - nikic:prepare-llvm-10, r=nagisa
bors [Mon, 13 Jan 2020 04:01:00 +0000 (04:01 +0000)]
Auto merge of #67900 - nikic:prepare-llvm-10, r=nagisa

Prepare for LLVM 10 upgrade

Split off from #67759, this just adds the necessary compatibility bits and updates codegen tests, without performing the actual LLVM upgrade.

r? @alexcrichton

4 years agoAuto merge of #67831 - mati865:ci-images-upgrade, r=pietroalbini
bors [Sun, 12 Jan 2020 14:52:48 +0000 (14:52 +0000)]
Auto merge of #67831 - mati865:ci-images-upgrade, r=pietroalbini

ci: bump ubuntu 19.04 images to 19.10

Ubuntu 19.04 goes EOL this month.

4 years agoAuto merge of #67901 - matthewjasper:split-mir-build, r=nagisa
bors [Sun, 12 Jan 2020 09:44:55 +0000 (09:44 +0000)]
Auto merge of #67901 - matthewjasper:split-mir-build, r=nagisa

Split MIR building into its own crate

This moves `rustc_mir::{build, hair, lints}` to `rustc_mir_build`.
The new crate only has a `provide` function as it's public API.

Based on #67898

cc @Centril @rust-lang/compiler
r? @oli-obk

4 years agoSplit `rustc_mir::{build, hair, lints}` into their own crate
Matthew Jasper [Sun, 5 Jan 2020 15:46:44 +0000 (15:46 +0000)]
Split `rustc_mir::{build, hair, lints}` into their own crate

4 years agoAuto merge of #68142 - Centril:rollup-dl232e9, r=Centril
bors [Sun, 12 Jan 2020 02:28:48 +0000 (02:28 +0000)]
Auto merge of #68142 - Centril:rollup-dl232e9, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #67494 (Constify more of alloc::Layout)
 - #67867 (Correctly check for opaque types in `assoc_ty_def`)
 - #67948 (Galloping search for binary_search_util)
 - #68045 (Move more of `rustc::lint` into `rustc_lint`)
 - #68089 (Unstabilize `Vec::remove_item`)
 - #68108 (Add suggestions when encountering chained comparisons)

Failed merges:

r? @ghost

4 years agoRollup merge of #68108 - varkor:chained-comparison-suggestions, r=Centril
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:28:02 +0000 (03:28 +0100)]
Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=Centril

Add suggestions when encountering chained comparisons

Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now.

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

4 years agoRollup merge of #68089 - lzutao:revert-remote_item, r=sfackler
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:28:00 +0000 (03:28 +0100)]
Rollup merge of #68089 - lzutao:revert-remote_item, r=sfackler

Unstabilize `Vec::remove_item`

As concerned by @kornelski, @LukasKalbertodt, and @gnzlbg in #40062.
Reverts #67727

4 years agoRollup merge of #68045 - Centril:liberate-lints, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:59 +0000 (03:27 +0100)]
Rollup merge of #68045 - Centril:liberate-lints, r=Mark-Simulacrum

Move more of `rustc::lint` into `rustc_lint`

Based on https://github.com/rust-lang/rust/pull/67806.

Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes:

- We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`.

- `in_derive_expansion` is, and needs to, be moved as a method on `Span`.

- We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined.

- `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133).

- `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints.

- `rustc::lint::context` is moved to `rustc_lint::context`.

- The visitors in `rustc::lint` are moved to `rustc_lint::passes`.

4 years agoRollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:57 +0000 (03:27 +0100)]
Rollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum

Galloping search for binary_search_util

This is unlikely to improve perf much unless for synthetic benchmarks, but I figure it likely won't hurt either.

4 years agoRollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:56 +0000 (03:27 +0100)]
Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk

Correctly check for opaque types in `assoc_ty_def`

Closes #67856

4 years agoRollup merge of #67494 - lukaslueg:const_alloc, r=oli-obk
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:54 +0000 (03:27 +0100)]
Rollup merge of #67494 - lukaslueg:const_alloc, r=oli-obk

Constify more of alloc::Layout

Making more methods of `alloc::Layout` const would allow us to compute alignment/size information for arbitrary (sized) types at compile-time, including placing the information in associated constants. While `mem::size_of` and `mem::align_of` are already const and `Layout` is solely based on those, there is no guarantee in the implementation that a const derived from these functions will be exactly the same as what `Layout` uses and is subsequently used in a call to `alloc::alloc`. Constifying `Layout` makes this possible.

First contribution to core, excuse my ignorance.

4 years agoGalloping search for binary_search_util
Andre Bogus [Mon, 6 Jan 2020 18:51:01 +0000 (19:51 +0100)]
Galloping search for binary_search_util

4 years agoAuto merge of #67458 - pnkfelix:fix-66530-by-propagating-fatal-error-from-worker...
bors [Sat, 11 Jan 2020 21:01:02 +0000 (21:01 +0000)]
Auto merge of #67458 - pnkfelix:fix-66530-by-propagating-fatal-error-from-worker, r=matthewjasper

When a codegen worker has a FatalError, propagate it instead of ICE'ing.

Fix #66530

4 years agoConstify alloc::Layout
Lukas Lueg [Tue, 31 Dec 2019 23:25:20 +0000 (00:25 +0100)]
Constify alloc::Layout

Tracking issue #67521, Layout::new in #66254

4 years agoAuto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk
bors [Sat, 11 Jan 2020 14:46:17 +0000 (14:46 +0000)]
Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk

Promote references to constants instead of statics

r? @oli-obk

4 years agoMake codegen tests wordsize independent
Oliver Scherer [Sat, 11 Jan 2020 13:40:07 +0000 (14:40 +0100)]
Make codegen tests wordsize independent

4 years agoAuto merge of #68126 - Centril:rollup-cz5u7xx, r=Centril
bors [Sat, 11 Jan 2020 11:36:39 +0000 (11:36 +0000)]
Auto merge of #68126 - Centril:rollup-cz5u7xx, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #67756 (Collector tweaks)
 - #67889 (Compile some CGUs in parallel at the start of codegen)
 - #67930 (Rename Result::as_deref_ok to as_deref)
 - #68018 (feature_gate: Remove `GateStrength`)
 - #68070 (clean up E0185 explanation)
 - #68072 (Fix ICE #68058)
 - #68114 (Don't require `allow_internal_unstable` unless `staged_api` is enabled.)
 - #68120 (Ban `...X` pats, harden tests, and improve diagnostics)

Failed merges:

r? @ghost

4 years agoRollup merge of #68120 - Centril:ban-range-to-dotdotdot, r=oli-obk
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:15 +0000 (12:36 +0100)]
Rollup merge of #68120 - Centril:ban-range-to-dotdotdot, r=oli-obk

Ban `...X` pats, harden tests, and improve diagnostics

Follow up to https://github.com/rust-lang/rust/pull/67258#issuecomment-565656155 and https://github.com/rust-lang/rust/pull/67258#discussion_r357879932.

r? @cramertj @oli-obk

4 years agoRollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=Centril
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:14 +0000 (12:36 +0100)]
Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=Centril

Don't require `allow_internal_unstable` unless `staged_api` is enabled.

#63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely.

After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable.

r? @oli-obk (author of #63770)
cc @Centril

4 years agoRollup merge of #68072 - JohnTitor:fix-macro-ice, r=petrochenkov
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:12 +0000 (12:36 +0100)]
Rollup merge of #68072 - JohnTitor:fix-macro-ice, r=petrochenkov

Fix ICE #68058

Fixes #68058

r? @petrochenkov

4 years agoRollup merge of #68070 - GuillaumeGomez:clean-up-e0185, r=Dylan-DPC
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:10 +0000 (12:36 +0100)]
Rollup merge of #68070 - GuillaumeGomez:clean-up-e0185, r=Dylan-DPC

clean up E0185 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68018 - petrochenkov:nosoft, r=Centril
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:09 +0000 (12:36 +0100)]
Rollup merge of #68018 - petrochenkov:nosoft, r=Centril

feature_gate: Remove `GateStrength`

The "soft feature gating" from `feature_gate/check.rs` is unused, and even if it were used, hardcoded warning is not a good solution and [deny-by-default lint](https://github.com/rust-lang/rust/issues/64266) would be a better way to do this.

cc https://github.com/rust-lang/rust/pull/67806#discussion_r363091701
r? @Centril

4 years agoRollup merge of #67930 - lzutao:result-as_deref, r=dtolnay
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:07 +0000 (12:36 +0100)]
Rollup merge of #67930 - lzutao:result-as_deref, r=dtolnay

Rename Result::as_deref_ok to as_deref

Addresses https://github.com/rust-lang/rust/issues/50264#issuecomment-533952247
r? @dtolnay

4 years agoRollup merge of #67889 - Zoxc:parallel-cgus, r=michaelwoerister
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:06 +0000 (12:36 +0100)]
Rollup merge of #67889 - Zoxc:parallel-cgus, r=michaelwoerister

Compile some CGUs in parallel at the start of codegen

This brings the compilation time for `syntex_syntax` from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compiling `n` CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least for `syntex_syntax`.

Based on https://github.com/rust-lang/rust/pull/67777.

r? @michaelwoerister
cc @alexcrichton @Mark-Simulacrum

4 years agoRollup merge of #67756 - Zoxc:collector-tweaks, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:36:04 +0000 (12:36 +0100)]
Rollup merge of #67756 - Zoxc:collector-tweaks, r=Mark-Simulacrum

Collector tweaks

r? @Mark-Simulacrum

4 years agofeature_gate: Remove `GateStrength`
Vadim Petrochenkov [Wed, 8 Jan 2020 17:27:06 +0000 (20:27 +0300)]
feature_gate: Remove `GateStrength`

4 years agoBan `...X` pats, harden tests, and improve diagnostics.
Mazdak Farrokhzad [Sat, 11 Jan 2020 05:49:43 +0000 (06:49 +0100)]
Ban `...X` pats, harden tests, and improve diagnostics.

Also fix a bug with the span passed in `mk_range`.

4 years agofix ui-fulldeps & tests fallout
Mazdak Farrokhzad [Fri, 10 Jan 2020 05:53:07 +0000 (06:53 +0100)]
fix ui-fulldeps & tests fallout

4 years agopacify the parallel compiler
Mazdak Farrokhzad [Thu, 9 Jan 2020 08:40:55 +0000 (09:40 +0100)]
pacify the parallel compiler

4 years agolints: move a comment
Mazdak Farrokhzad [Thu, 9 Jan 2020 06:58:48 +0000 (07:58 +0100)]
lints: move a comment

4 years agomove rustc::lint::{context, passes} to rustc_lint.
Mazdak Farrokhzad [Thu, 9 Jan 2020 06:52:01 +0000 (07:52 +0100)]
move rustc::lint::{context, passes} to rustc_lint.

Also do some cleanup of the interface.

4 years ago{rustc::lint -> rustc_lint}::internal
Mazdak Farrokhzad [Thu, 9 Jan 2020 05:49:49 +0000 (06:49 +0100)]
{rustc::lint -> rustc_lint}::internal

4 years agolints: promote levels.rs to lint.rs & extract passes.rs
Mazdak Farrokhzad [Thu, 9 Jan 2020 05:42:42 +0000 (06:42 +0100)]
lints: promote levels.rs to lint.rs & extract passes.rs

4 years agoinline maybe_lint_level_root
Mazdak Farrokhzad [Thu, 9 Jan 2020 05:08:07 +0000 (06:08 +0100)]
inline maybe_lint_level_root

4 years agomove struct_lint_level to levels.rs
Mazdak Farrokhzad [Thu, 9 Jan 2020 04:57:07 +0000 (05:57 +0100)]
move struct_lint_level to levels.rs

4 years agomove LintSource to levels
Mazdak Farrokhzad [Thu, 9 Jan 2020 04:20:28 +0000 (05:20 +0100)]
move LintSource to levels

4 years agomove logic to LintLevelsBuilder
Mazdak Farrokhzad [Thu, 9 Jan 2020 03:06:33 +0000 (04:06 +0100)]
move logic to LintLevelsBuilder

4 years agoGlobalCtxt: Erase `LintStore` type.
Mazdak Farrokhzad [Thu, 9 Jan 2020 02:45:42 +0000 (03:45 +0100)]
GlobalCtxt: Erase `LintStore` type.

4 years agoreduce diversity in linting methods
Mazdak Farrokhzad [Thu, 9 Jan 2020 02:28:45 +0000 (03:28 +0100)]
reduce diversity in linting methods

4 years agomove in_derive_expansion as Span method
Mazdak Farrokhzad [Thu, 9 Jan 2020 02:03:48 +0000 (03:03 +0100)]
move in_derive_expansion as Span method

4 years agocanonicalize some lint imports
Mazdak Farrokhzad [Sun, 5 Jan 2020 09:58:44 +0000 (10:58 +0100)]
canonicalize some lint imports

4 years agoAuto merge of #65912 - estebank:variants-orig, r=petrochenkov
bors [Sat, 11 Jan 2020 06:15:59 +0000 (06:15 +0000)]
Auto merge of #65912 - estebank:variants-orig, r=petrochenkov

Point at the span for the definition of crate foreign ADTs

Follow up to #65421. Partially addresses #65386. Blocked on #53081.

4 years agoExpand comment
ecstatic-morse [Sat, 11 Jan 2020 03:29:16 +0000 (19:29 -0800)]
Expand comment

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoUpdate test after renaming Result::as_deref
Lzu Tao [Tue, 7 Jan 2020 06:57:08 +0000 (06:57 +0000)]
Update test after renaming Result::as_deref

4 years agoRename Result::as_deref_ok to as_deref
Lzu Tao [Mon, 6 Jan 2020 12:59:46 +0000 (12:59 +0000)]
Rename Result::as_deref_ok to as_deref

4 years agoRevert "Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=alexcrichton"
Lzu Tao [Fri, 10 Jan 2020 10:34:35 +0000 (10:34 +0000)]
Revert "Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=alexcrichton"

This reverts commit 4ed415b5478c74094c2859abfddb959588cd6bb1, reversing
changes made to 3cce950743e8aa74a4378dfdefbbc80223a00865.

4 years agoAuto merge of #68115 - Centril:rollup-e2fszdv, r=Centril
bors [Sat, 11 Jan 2020 03:03:42 +0000 (03:03 +0000)]
Auto merge of #68115 - Centril:rollup-e2fszdv, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #67666 (make use of pointer::is_null)
 - #67806 (Extract `rustc_ast_passes`, move gating, & refactor linting)
 - #68043 (Add some missing timers)
 - #68074 (Add `llvm-skip-rebuild` flag to `x.py`)
 - #68079 (Clarify suggestion for E0013)
 - #68084 (Do not ICE on unicode next point)
 - #68102 (Inline some conversion methods around OsStr)
 - #68106 (Fix issue with using `self` module via indirection)

Failed merges:

r? @ghost

4 years agoRollup merge of #68106 - varkor:self_self_use, r=estebank
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:31 +0000 (04:02 +0100)]
Rollup merge of #68106 - varkor:self_self_use, r=estebank

Fix issue with using `self` module via indirection

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

4 years agoRollup merge of #68102 - lzutao:inline, r=alexcrichton
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:30 +0000 (04:02 +0100)]
Rollup merge of #68102 - lzutao:inline, r=alexcrichton

Inline some conversion methods around OsStr

Diff on the assembly of this snippet before and after this PR: https://www.diffchecker.com/NeGMjaJ2
```rust
use std::env;
use std::io;
use std::path::{Path, PathBuf};

pub fn cargo_home_with_cwd(cwd: &Path) -> io::Result<PathBuf> {
    match env::var_os("CARGO_HOME").filter(|h| !h.is_empty()) {
        Some(home) => {
            let home = PathBuf::from(home);
            if home.is_absolute() {
                Ok(home)
            } else {
                Ok(cwd.join(&home))
            }
        }
        _ => env::home_dir()
            .map(|p| p.join(".cargo"))
            .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "could not find cargo home dir")),
    }
}
```

4 years agoRollup merge of #68084 - estebank:ice-68000, r=varkor
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:28 +0000 (04:02 +0100)]
Rollup merge of #68084 - estebank:ice-68000, r=varkor

Do not ICE on unicode next point

Use `shrink_to_hi` instead of `next_point` and fix `next_point`.

Fix #68000, fix #68091, fix #68092.

4 years agoRollup merge of #68079 - varkor:E0013-clarify, r=Centril
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:27 +0000 (04:02 +0100)]
Rollup merge of #68079 - varkor:E0013-clarify, r=Centril

Clarify suggestion for E0013

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

4 years agoRollup merge of #68074 - matthew-healy:skip-llvm-rebuild-option, r=Centril
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:25 +0000 (04:02 +0100)]
Rollup merge of #68074 - matthew-healy:skip-llvm-rebuild-option, r=Centril

Add `llvm-skip-rebuild` flag to `x.py`

This PR follows on from #67437 to complete the feature request from #65612.

Specifically it adds a new command-line flag, `--llvm-skip-rebuild`, which overrides both any value set in `config.toml` and the default value (`false`).

I'm not 100% confident that I've implemented the override in the "best" way, but I've checked it locally and it seems to work at least.

This option isn't currently mentioned in the Guide to Rustc Development. I'd be happy to write something on it if folk think that's worthwhile.

4 years agoRollup merge of #68043 - Zoxc:missing-timers, r=wesleywiser
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:24 +0000 (04:02 +0100)]
Rollup merge of #68043 - Zoxc:missing-timers, r=wesleywiser

Add some missing timers

Based on https://github.com/rust-lang/rust/pull/67988

r? @wesleywiser

4 years agoRollup merge of #67806 - Centril:splitsynmore, r=petrochenkov
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:22 +0000 (04:02 +0100)]
Rollup merge of #67806 - Centril:splitsynmore, r=petrochenkov

Extract `rustc_ast_passes`, move gating, & refactor linting

Based on https://github.com/rust-lang/rust/pull/67770.

This PR extracts a crate `rustc_ast_passes`:

- `ast_validation.rs`, which is contributed by `rustc_passes` (now only has HIR based passes) -- the goal here is to improve recompilation of the parser,
- `feature_gate.rs`, which is contributed by `syntax` and performs post-expansion-gating & final erroring for pre-expansion gating,
- `show_span`, which is contributed by `syntax`.

To facilitate this, we first have to also:

- Move `{leveled_}feature_err{_err}` from `syntax::feature_gate::check` into `rustc_session::parse`.
- Move `get_features` into `rustc_parse::config`, the only place it is used.
- Move some some lint datatypes and traits, e.g. `LintBuffer`, `BufferedEarlyLint`, `BuiltinLintDiagnostics`, `LintPass`, and `LintArray` into `rustc_session::lint`.
- Move all the hard-wired lint `static`s into `rustc_session::lint::builtin`.

4 years agoRollup merge of #67666 - lzutao:ptr-null-cmp, r=dtolnay
Mazdak Farrokhzad [Sat, 11 Jan 2020 03:02:21 +0000 (04:02 +0100)]
Rollup merge of #67666 - lzutao:ptr-null-cmp, r=dtolnay

make use of pointer::is_null

r? @Mark-Simulacrum

4 years agoTest that stable `const fn` requires `allow_internal_unstable`
Dylan MacKenzie [Sat, 11 Jan 2020 02:48:52 +0000 (18:48 -0800)]
Test that stable `const fn` requires `allow_internal_unstable`

4 years agoRemove unnecessary `const_fn` feature gates
Dylan MacKenzie [Sat, 11 Jan 2020 01:40:57 +0000 (17:40 -0800)]
Remove unnecessary `const_fn` feature gates

This flag opts out of the min-const-fn checks entirely, which is usually
not what we want. The few cases where the flag is still necessary have
been annotated.

4 years agofix fallout in ui-fulldeps
Mazdak Farrokhzad [Wed, 8 Jan 2020 21:54:08 +0000 (22:54 +0100)]
fix fallout in ui-fulldeps

4 years agopacify tidy by nixing added docs :(
Mazdak Farrokhzad [Sun, 5 Jan 2020 12:30:12 +0000 (13:30 +0100)]
pacify tidy by nixing added docs :(

4 years agoappease rustfmt
Mazdak Farrokhzad [Sun, 5 Jan 2020 12:05:49 +0000 (13:05 +0100)]
appease rustfmt

4 years agorustc_passes: remove unused rustc_parse dep
Mazdak Farrokhzad [Sun, 5 Jan 2020 11:02:45 +0000 (12:02 +0100)]
rustc_passes: remove unused rustc_parse dep

4 years ago{syntax -> rustc_ast_passes}::show_span
Mazdak Farrokhzad [Sun, 5 Jan 2020 10:21:26 +0000 (11:21 +0100)]
{syntax -> rustc_ast_passes}::show_span

4 years ago{syntax -> rustc_ast_passes}::feature_gate
Mazdak Farrokhzad [Sun, 5 Jan 2020 10:11:39 +0000 (11:11 +0100)]
{syntax -> rustc_ast_passes}::feature_gate

4 years agoast_validation -> new crate rustc_ast_passes
Mazdak Farrokhzad [Sun, 5 Jan 2020 09:58:44 +0000 (10:58 +0100)]
ast_validation -> new crate rustc_ast_passes

4 years agonix syntax::early_buffered_lints
Mazdak Farrokhzad [Sun, 5 Jan 2020 09:47:20 +0000 (10:47 +0100)]
nix syntax::early_buffered_lints

4 years agomove {rustc -> rustc_session}::lint::builtin
Mazdak Farrokhzad [Sun, 5 Jan 2020 09:35:40 +0000 (10:35 +0100)]
move {rustc -> rustc_session}::lint::builtin

4 years agoprepare moving HardwiredLints to rustc_session
Mazdak Farrokhzad [Sun, 5 Jan 2020 09:07:26 +0000 (10:07 +0100)]
prepare moving HardwiredLints to rustc_session

4 years agobuffered lint infra -> rustc_session
Mazdak Farrokhzad [Sun, 5 Jan 2020 08:40:16 +0000 (09:40 +0100)]
buffered lint infra -> rustc_session

4 years agoprepare for moving BuiltinLintDiagnostics to rustc_session
Mazdak Farrokhzad [Sun, 5 Jan 2020 07:54:10 +0000 (08:54 +0100)]
prepare for moving BuiltinLintDiagnostics to rustc_session

4 years agoRemove unused derives
Mazdak Farrokhzad [Sun, 5 Jan 2020 06:30:38 +0000 (07:30 +0100)]
Remove unused derives

4 years agocanonicalize rustc::session import
Mazdak Farrokhzad [Thu, 2 Jan 2020 11:54:43 +0000 (12:54 +0100)]
canonicalize rustc::session import

4 years agosimplify feature_err imports
Mazdak Farrokhzad [Thu, 2 Jan 2020 11:42:42 +0000 (12:42 +0100)]
simplify feature_err imports

4 years agoget_features -> rustc_parse::config
Mazdak Farrokhzad [Thu, 2 Jan 2020 11:33:56 +0000 (12:33 +0100)]
get_features -> rustc_parse::config

4 years agodocument feature_err et. al
Mazdak Farrokhzad [Thu, 2 Jan 2020 10:55:00 +0000 (11:55 +0100)]
document feature_err et. al

4 years agogating diagnostics -> rustc_session::parse
Mazdak Farrokhzad [Thu, 2 Jan 2020 10:41:57 +0000 (11:41 +0100)]
gating diagnostics -> rustc_session::parse

4 years agoAdd suggestions when encountering chained comparisons
varkor [Sat, 11 Jan 2020 00:19:09 +0000 (00:19 +0000)]
Add suggestions when encountering chained comparisons

4 years agoOnly require `allow_internal_unstable` for stable `const fn`
Dylan MacKenzie [Sat, 11 Jan 2020 00:12:26 +0000 (16:12 -0800)]
Only require `allow_internal_unstable` for stable `const fn`

4 years agoFix test not to depend on environment
Yuki Okushi [Sat, 11 Jan 2020 01:15:54 +0000 (10:15 +0900)]
Fix test not to depend on environment

4 years agoAdd a comment
John Kåre Alsaker [Fri, 10 Jan 2020 23:38:10 +0000 (00:38 +0100)]
Add a comment

4 years agoAvoid a duplicate hash map lookup
John Kåre Alsaker [Tue, 31 Dec 2019 13:28:36 +0000 (14:28 +0100)]
Avoid a duplicate hash map lookup

4 years agoFix a deadlock
John Kåre Alsaker [Tue, 31 Dec 2019 13:27:20 +0000 (14:27 +0100)]
Fix a deadlock

4 years agoRun codegen unit partitioning and assert_symbols_are_distinct in parallel
John Kåre Alsaker [Tue, 31 Dec 2019 13:01:38 +0000 (14:01 +0100)]
Run codegen unit partitioning and assert_symbols_are_distinct in parallel

4 years agoFix issue with using `self` module via indirection
varkor [Fri, 10 Jan 2020 22:29:57 +0000 (22:29 +0000)]
Fix issue with using `self` module via indirection

4 years agoAuto merge of #65241 - tmiasko:no-std-san, r=alexcrichton
bors [Fri, 10 Jan 2020 23:26:21 +0000 (23:26 +0000)]
Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichton

build-std compatible sanitizer support

### Motivation

When using `-Z sanitizer=*` feature it is essential that both user code and
standard library is instrumented. Otherwise the utility of sanitizer will be
limited, or its use will be impractical like in the case of memory sanitizer.

The recently introduced cargo feature build-std makes it possible to rebuild
standard library with arbitrary rustc flags. Unfortunately, those changes alone
do not make it easy to rebuild standard library with sanitizers, since runtimes
are dependencies of std that have to be build in specific environment,
generally not available outside rustbuild process. Additionally rebuilding them
requires presence of llvm-config and compiler-rt sources.

The goal of changes proposed here is to make it possible to avoid rebuilding
sanitizer runtimes when rebuilding the std, thus making it possible to
instrument standard library for use with sanitizer with simple, although
verbose command:

```
env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu
```

### Implementation

* Sanitizer runtimes are no long packed into crates. Instead, libraries build
  from compiler-rt are used as is, after renaming them into `librusc_rt.*`.
* rustc obtains runtimes from target libdir for default sysroot, so that
  they are not required in custom build sysroots created with build-std.
* The runtimes are only linked-in into executables to address issue #64629.
  (in previous design it was hard to avoid linking runtimes into static
  libraries produced by rustc as demonstrated by sanitizer-staticlib-link
  test, which still passes despite changes made in #64780).

cc @kennytm, @japaric, @firstyear, @choller

4 years agoAuto merge of #68101 - JohnTitor:rollup-mvmjukr, r=JohnTitor
bors [Fri, 10 Jan 2020 20:08:58 +0000 (20:08 +0000)]
Auto merge of #68101 - JohnTitor:rollup-mvmjukr, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #66045 (Add method Result::into_ok)
 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
 - #68014 (Unify output of "variant not found" errors)
 - #68019 (Build compiletest with in-tree libtest)
 - #68039 (remove explicit strip-hidden pass from compiler doc generation)
 - #68050 (Canonicalize rustc_error imports)
 - #68059 (Allow specifying LLVM args in target specifications)
 - #68075 (rustbuild: Cleanup book generation)

Failed merges:

 - #68089 (Unstabilize `Vec::remove_item`)

r? @ghost

4 years agoRollup merge of #68075 - ollie27:rustbuild_books, r=Mark-Simulacrum
Yuki Okushi [Fri, 10 Jan 2020 19:50:56 +0000 (04:50 +0900)]
Rollup merge of #68075 - ollie27:rustbuild_books, r=Mark-Simulacrum

rustbuild: Cleanup book generation

The Cargo book can be generated the same way as the other books.

4 years agoRollup merge of #68059 - jethrogb:jb/target-llvm-args, r=alexcrichton
Yuki Okushi [Fri, 10 Jan 2020 19:50:54 +0000 (04:50 +0900)]
Rollup merge of #68059 - jethrogb:jb/target-llvm-args, r=alexcrichton

Allow specifying LLVM args in target specifications

4 years agoRollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum
Yuki Okushi [Fri, 10 Jan 2020 19:50:53 +0000 (04:50 +0900)]
Rollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum

Canonicalize rustc_error imports

r? @Mark-Simulacrum

4 years agoRollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnay
Yuki Okushi [Fri, 10 Jan 2020 19:50:51 +0000 (04:50 +0900)]
Rollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnay

remove explicit strip-hidden pass from compiler doc generation

`strip-hidden` is now implied by `--document-private-items` with #67875, so there's no need to specify it anymore.

4 years agoRollup merge of #68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum
Yuki Okushi [Fri, 10 Jan 2020 19:50:49 +0000 (04:50 +0900)]
Rollup merge of #68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum

Build compiletest with in-tree libtest

This updates compiletest to build in `Mode::ToolStd`, using the locally-built crates for `std` and especially `test`. This way we're immune to unstable differences in the bootstrap compiler crates, whether that's a prior-release stage0 or a current release local rebuild. Fixes #59264.

As a minor cleanup, this also removes the unused `llvm_tools` flag.

4 years agoRollup merge of #68014 - estebank:unify-e0599, r=cramertj
Yuki Okushi [Fri, 10 Jan 2020 19:50:48 +0000 (04:50 +0900)]
Rollup merge of #68014 - estebank:unify-e0599, r=cramertj

Unify output of "variant not found" errors

Fix #49566.

4 years agoRollup merge of #67258 - Centril:open-ended-ranges, r=oli-obk
Yuki Okushi [Fri, 10 Jan 2020 19:50:46 +0000 (04:50 +0900)]
Rollup merge of #67258 - Centril:open-ended-ranges, r=oli-obk

Introduce `X..`, `..X`, and `..=X` range patterns

Tracking issue: https://github.com/rust-lang/rust/issues/67264
Feature gate: `#![feature(half_open_range_patterns)]`

---------------------------

In this PR, we introduce range-from (`X..`), range-to (`..X`), and range-to-inclusive (`..=X`) patterns.
These correspond to the `RangeFrom`, `RangeTo`, and `RangeToInclusive` expression forms introduced with the same syntaxes. The correspondence is both syntactic and semantic (in the sense that e.g. a `X..` pattern matching on a scrutinee `s` holds exactly when `(X..).contains(&s)` holds).

---------------------------

Noteworthy:

- The compiler complexity added with this PR is around 10 lines (discounting new tests, which account for the large PR size).

- `...X` is accepted syntactically with the same meaning as `..=X`. This is done primarily to simplify and unify the implementation & spec. If-and-when we decide to make `X...Y` a hard error on a new edition, we can do the same for `...X` patterns as well.

- `X...` and `X..=` is rejected syntactically just like it is for the expression equivalents. We should perhaps make these into semantic restrictions (cc @petrochenkov).

- In HAIR, these half-open ranges are represented by inserting the max/min values for the approprate types. That is, `X..` where `X: u8` would become `X..=u8::MAX` in HAIR (note the `..=` since `RangeFrom` includes the end).

- Exhaustive integer / char matching does not (yet) allow for e.g. exhaustive matching on `0usize..` or `..5usize | 5..` (same idea for `isize`). This would be a substantially more invasive change, and could be added in some other PR.

- The issues with slice pattern syntax has been resolved as we decided to use `..` to mean a "rest-pattern" and `[xs @ ..]` to bind the rest to a name in a slice pattern.

- Like with https://github.com/rust-lang/rust/pull/35712, which provided `X..Y` range patterns, this is not yet backed up by an RFC. I'm providing this experimental implementation now to have something concrete to discuss. I would be happy to provide an RFC for this PR as well as for #35712 to finalize and confirm the ideas with the larger community.

Closes https://github.com/rust-lang/rfcs/issues/947.

---------------------------

r? @varkor cc @matthewjasper @oli-obk

I would recommend reviewing this (in particular HAIR-lowering and pattern parsing changes) with whitespace changes ignored.

4 years agoRollup merge of #66045 - mzabaluev:unwrap-infallible, r=dtolnay
Yuki Okushi [Fri, 10 Jan 2020 19:50:45 +0000 (04:50 +0900)]
Rollup merge of #66045 - mzabaluev:unwrap-infallible, r=dtolnay

Add method Result::into_ok

Implementation of https://github.com/rust-lang/rfcs/pull/2799

Tracking issue #61695

4 years agoIgnore platforms that can't point to std
Esteban Küber [Tue, 7 Jan 2020 20:59:24 +0000 (12:59 -0800)]
Ignore platforms that can't point to std

4 years ago./x.py fmt
Esteban Küber [Tue, 7 Jan 2020 20:22:47 +0000 (12:22 -0800)]
./x.py fmt

4 years agoUse `def_span` to minimize definition span to first line when possible
Esteban Küber [Mon, 28 Oct 2019 21:48:49 +0000 (14:48 -0700)]
Use `def_span` to minimize definition span to first line when possible

4 years agoPoint at the span for the definition of crate foreign ADTs
Esteban Küber [Tue, 15 Oct 2019 00:20:50 +0000 (17:20 -0700)]
Point at the span for the definition of crate foreign ADTs

4 years agoinline `impl From<String> for Box<dyn Error + Send + Sync>`
Lzu Tao [Fri, 10 Jan 2020 19:27:02 +0000 (19:27 +0000)]
inline `impl From<String> for Box<dyn Error + Send + Sync>`

4 years agoAdd ICE regression tests
Esteban Küber [Fri, 10 Jan 2020 19:22:57 +0000 (11:22 -0800)]
Add ICE regression tests