]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoclean up E0204 explanation
Guillaume Gomez [Sun, 19 Jan 2020 14:35:55 +0000 (15:35 +0100)]
clean up E0204 explanation

4 years agoclean up E0201 explanation
Guillaume Gomez [Sun, 19 Jan 2020 14:35:44 +0000 (15:35 +0100)]
clean up E0201 explanation

4 years agoAuto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrum
bors [Mon, 13 Jan 2020 12:49:12 +0000 (12:49 +0000)]
Auto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrum

Error codes checkup and rustdoc test fix

This PR does a few things:

 * fix how rustdoc checks that an error code has been thrown (it only checked for "E0XXX" so if it appeared in the output because the file has it in its name or wherever, it passed the test, which was incorrect)
 * fix the failing code examples that weren't throwing the expected error code

4 years agoAuto merge of #68174 - JohnTitor:rollup-ix4amrj, r=JohnTitor
bors [Mon, 13 Jan 2020 08:20:49 +0000 (08:20 +0000)]
Auto merge of #68174 - JohnTitor:rollup-ix4amrj, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #67313 (Document more use cases of dataflow)
 - #67959 (rustdoc: improve stability mark arrows)
 - #68097 (Specify units for test timeout environment variables)
 - #68135 (restore some rustc_parse visibilities for rustfmt)
 - #68145 (Expose `context::CheckLintNameResult`)
 - #68156 (Fix crate paths in comments)
 - #68157 (Clean up E0186 explanation)
 - #68161 (Fix system call docs for time::Instant)

Failed merges:

r? @ghost

4 years agoRollup merge of #68161 - ruuda:fix-instant-docs, r=rkruppe
Yuki Okushi [Mon, 13 Jan 2020 07:44:24 +0000 (16:44 +0900)]
Rollup merge of #68161 - ruuda:fix-instant-docs, r=rkruppe

Fix system call docs for time::Instant

The link for UNIX was pointing to the Cloud ABI docs. It should have been pointing to the `clock_gettime` docs instead. A similar table is repeated in the docs for `SystemTime`, but there the UNIX entry was already correct.

`clock_gettime(CLOCK_MONOTONIC)` is the current implementation: https://github.com/rust-lang/rust/blob/3ebcfa1451cfedc13a07e6353d8ade9742dfdc2a/src/libstd/sys/unix/time.rs#L274
https://github.com/rust-lang/rust/blob/3ebcfa1451cfedc13a07e6353d8ade9742dfdc2a/src/libstd/sys/unix/time.rs#L348-L352

r? @steveklabnik

4 years agoRollup merge of #68157 - GuillaumeGomez:clean-up-e0186, r=Dylan-DPC
Yuki Okushi [Mon, 13 Jan 2020 07:44:23 +0000 (16:44 +0900)]
Rollup merge of #68157 - GuillaumeGomez:clean-up-e0186, r=Dylan-DPC

Clean up E0186 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68156 - JohnTitor:fix-path-in-doc, r=Dylan-DPC
Yuki Okushi [Mon, 13 Jan 2020 07:44:21 +0000 (16:44 +0900)]
Rollup merge of #68156 - JohnTitor:fix-path-in-doc, r=Dylan-DPC

Fix crate paths in comments

Tiny follow-up of #67806 and others

r? @Centril

4 years agoRollup merge of #68145 - JohnTitor:pub-check-lint-name-result, r=Centril
Yuki Okushi [Mon, 13 Jan 2020 07:44:20 +0000 (16:44 +0900)]
Rollup merge of #68145 - JohnTitor:pub-check-lint-name-result, r=Centril

Expose `context::CheckLintNameResult`

Clippy needs it

r? @Centril

4 years agoRollup merge of #68135 - calebcartwright:rustc-parse-visibilities, r=Centril
Yuki Okushi [Mon, 13 Jan 2020 07:44:18 +0000 (16:44 +0900)]
Rollup merge of #68135 - calebcartwright:rustc-parse-visibilities, r=Centril

restore some rustc_parse visibilities for rustfmt

In https://github.com/rust-lang/rust/pull/65495/commits/c189565edc5c9fc516170885b3a3061b936205fb some visibilities were reduced on the parse mod (which now resides in the rustc_parse crate) as part of some refactoring and splitting up of libsyntax. However, rustfmt needs access to a few of those items that are no longer visible.

This restores the visibility on those items rustfmt depends on.

https://github.com/rust-lang/rustfmt/issues/3903#issuecomment-563596269
https://github.com/rust-lang/rustfmt/issues/4009

cc @topecongiro

4 years agoRollup merge of #68097 - MikailBag:master, r=shepmaster
Yuki Okushi [Mon, 13 Jan 2020 07:44:17 +0000 (16:44 +0900)]
Rollup merge of #68097 - MikailBag:master, r=shepmaster

Specify units for test timeout environment variables

I think it is not obvious (I got it from reading libtest sources), so it is worth mentioning in docs.

4 years agoRollup merge of #67959 - liigo:patch-13, r=GuillaumeGomez
Yuki Okushi [Mon, 13 Jan 2020 07:44:15 +0000 (16:44 +0900)]
Rollup merge of #67959 - liigo:patch-13, r=GuillaumeGomez

rustdoc: improve stability mark arrows

### current

![old-stability-arrow](https://user-images.githubusercontent.com/346530/71863520-134d8b00-3138-11ea-86f9-a98068b3cff9.png)

### new

![new-stability-arrow](https://user-images.githubusercontent.com/346530/71863539-1b0d2f80-3138-11ea-843e-d79b9e5d9eec.png)

### new dark

![dark-stability-arrow](https://user-images.githubusercontent.com/346530/71863563-26f8f180-3138-11ea-9514-050e2c779f90.png)

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 agoFix system call docs for time::Instant
Ruud van Asseldonk [Sun, 12 Jan 2020 20:24:31 +0000 (21:24 +0100)]
Fix system call docs for time::Instant

The link for UNIX was pointing to the Cloud ABI docs. It should have
been pointing to the clock_gettime docs instead. The table is repeated
in the docs for SystemTime, but there the UNIX entry was already correct.

4 years agoClean up E0186 explanation
Guillaume Gomez [Sun, 12 Jan 2020 16:50:14 +0000 (17:50 +0100)]
Clean up E0186 explanation

4 years agoFix error codes explanation' code examples
Guillaume Gomez [Sat, 4 Jan 2020 00:41:25 +0000 (01:41 +0100)]
Fix error codes explanation' code examples

4 years agoFix crate paths in comments
Yuki Okushi [Sun, 12 Jan 2020 15:51:15 +0000 (00:51 +0900)]
Fix crate paths in comments

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 agoExpose `context::CheckLintNameResult`
Yuki Okushi [Sun, 12 Jan 2020 06:25:41 +0000 (15:25 +0900)]
Expose `context::CheckLintNameResult`

Clippy needs it

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 agorestore some rustc_parse visibilities
Caleb Cartwright [Sat, 11 Jan 2020 19:19:57 +0000 (13:19 -0600)]
restore some rustc_parse visibilities

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