Commit Graph

105360 Commits

Author SHA1 Message Date
Dylan MacKenzie
7b4dca282a Document all methods 2020-01-19 19:09:13 -08:00
Dylan MacKenzie
2ce7b61995 Explain motivation for GenKill trait 2020-01-19 18:33:19 -08:00
Dylan MacKenzie
be730e16de Use trailing underscore for helper methods 2020-01-15 18:41:17 -08:00
Dylan MacKenzie
1006ad036a Fix test 2020-01-14 18:44:00 -08:00
Dylan MacKenzie
b70898d5ee Improve docs for GenKill and GenKillSet 2020-01-14 16:13:21 -08:00
Dylan MacKenzie
2727f10b21 Improve docs for new framework 2020-01-14 16:13:21 -08:00
Dylan MacKenzie
47dce1be81 Add test for ResultsCursor
This is a unit test that ensures the `seek` functions work correctly.
2020-01-14 16:13:21 -08:00
Dylan MacKenzie
355cfcdf43 Use unified dataflow framework in check_consts 2020-01-14 14:37:16 -08:00
Dylan MacKenzie
7d5885727d Remove old "generic" framework 2020-01-14 14:37:16 -08:00
Dylan MacKenzie
07c51f605a Implement new dataflow framework and cursor 2020-01-14 14:37:16 -08:00
Dylan MacKenzie
2fb4c4472e Improve graphviz visualization for new framework 2020-01-14 13:23:07 -08:00
bors
30ca215b4e Auto merge of #68183 - JohnTitor:clippy-up, r=JohnTitor
Update Clippy

Fixes #68107

r? @ghost
2020-01-13 20:56:44 +00:00
bors
31dd4f4acb Auto merge of #68088 - oli-obk:fix_miri, r=RalfJung
Don't try to force_ptr pointers to zsts

r? @RalfJung

cc @wesleywiser

This is required to fix miri after https://github.com/rust-lang/rust/pull/67501 broke it. The reason only miri sees this is that it uses validation on values during interpretation and not just on the final value of constants, which never contain such values.
2020-01-13 17:39:01 +00:00
Oliver Scherer
19b9b26986 Early abort validation of arrays of zsts because there is no data to be checked 2020-01-13 16:12:10 +01:00
Yuki Okushi
19f8c5824f Update Clippy 2020-01-13 23:45:20 +09:00
bors
bf84eb538f 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
2020-01-13 12:49:12 +00:00
bors
af958046e5 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
2020-01-13 08:20:49 +00:00
Yuki Okushi
87bdc8eb73
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: 3ebcfa1451/src/libstd/sys/unix/time.rs (L274)
3ebcfa1451/src/libstd/sys/unix/time.rs (L348-L352)

r? @steveklabnik
2020-01-13 16:44:24 +09:00
Yuki Okushi
574ef55ea7
Rollup merge of #68157 - GuillaumeGomez:clean-up-e0186, r=Dylan-DPC
Clean up E0186 explanation

r? @Dylan-DPC
2020-01-13 16:44:23 +09:00
Yuki Okushi
0c25ab051c
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
2020-01-13 16:44:21 +09:00
Yuki Okushi
ce8f320793
Rollup merge of #68145 - JohnTitor:pub-check-lint-name-result, r=Centril
Expose `context::CheckLintNameResult`

Clippy needs it

r? @Centril
2020-01-13 16:44:20 +09:00
Yuki Okushi
ca806cfe45
Rollup merge of #68135 - calebcartwright:rustc-parse-visibilities, r=Centril
restore some rustc_parse visibilities for rustfmt

In c189565edc 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
2020-01-13 16:44:18 +09:00
Yuki Okushi
7d3fa29633
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.
2020-01-13 16:44:17 +09:00
Yuki Okushi
bc031e30fa
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)
2020-01-13 16:44:15 +09:00
Yuki Okushi
ac8acd856e
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
2020-01-13 16:44:13 +09:00
bors
e82febc78e 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
2020-01-13 04:01:00 +00:00
Ruud van Asseldonk
827ee7a70a 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.
2020-01-12 21:24:31 +01:00
Guillaume Gomez
34186ef642 Clean up E0186 explanation 2020-01-12 17:50:14 +01:00
Guillaume Gomez
5b7d64e947 Fix error codes explanation' code examples 2020-01-12 17:22:42 +01:00
Yuki Okushi
27b99d4050 Fix crate paths in comments 2020-01-13 01:07:43 +09:00
bors
3ebcfa1451 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.
2020-01-12 14:52:48 +00:00
bors
59c1db0339 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
2020-01-12 09:44:55 +00:00
Matthew Jasper
b358929251 Split rustc_mir::{build, hair, lints} into their own crate 2020-01-12 09:39:26 +00:00
Yuki Okushi
a404cfabc7 Expose context::CheckLintNameResult
Clippy needs it
2020-01-12 15:25:41 +09:00
bors
0b6c116a84 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
2020-01-12 02:28:48 +00:00
Mazdak Farrokhzad
82c19b4388
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.
2020-01-12 03:28:02 +01:00
Mazdak Farrokhzad
bbd210e6c5
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
2020-01-12 03:28:00 +01:00
Mazdak Farrokhzad
cc51d0350e
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`.
2020-01-12 03:27:59 +01:00
Mazdak Farrokhzad
1b208b12f8
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.
2020-01-12 03:27:57 +01:00
Mazdak Farrokhzad
1d9c69fb89
Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk
Correctly check for opaque types in `assoc_ty_def`

Closes #67856
2020-01-12 03:27:56 +01:00
Mazdak Farrokhzad
019790c72a
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.
2020-01-12 03:27:54 +01:00
Andre Bogus
0e1cd59547 Galloping search for binary_search_util 2020-01-12 01:38:07 +01:00
bors
f363745872 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
2020-01-11 21:01:02 +00:00
Caleb Cartwright
ed039e8f84 restore some rustc_parse visibilities 2020-01-11 13:19:57 -06:00
Lukas Lueg
c5a9a14c9f Constify alloc::Layout
Tracking issue #67521, Layout::new in #66254
2020-01-11 16:59:15 +01:00
bors
1389494ac1 Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk
Promote references to constants instead of statics

r? @oli-obk
2020-01-11 14:46:17 +00:00
Oliver Scherer
e51eccd2ef Make codegen tests wordsize independent 2020-01-11 14:40:07 +01:00
bors
bfd04876b9 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
2020-01-11 11:36:39 +00:00
Mazdak Farrokhzad
4eee796679
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
2020-01-11 12:36:15 +01:00
Mazdak Farrokhzad
50d76d6471
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
2020-01-11 12:36:14 +01:00