Commit Graph

105360 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
f02f338ee0
Rollup merge of #68072 - JohnTitor:fix-macro-ice, r=petrochenkov
Fix ICE #68058

Fixes #68058

r? @petrochenkov
2020-01-11 12:36:12 +01:00
Mazdak Farrokhzad
34231d6c0b
Rollup merge of #68070 - GuillaumeGomez:clean-up-e0185, r=Dylan-DPC
clean up E0185 explanation

r? @Dylan-DPC
2020-01-11 12:36:10 +01:00
Mazdak Farrokhzad
31d7ffa1e0
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
2020-01-11 12:36:09 +01:00
Mazdak Farrokhzad
29a1cf2876
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
2020-01-11 12:36:07 +01:00
Mazdak Farrokhzad
7b741fb68e
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
2020-01-11 12:36:06 +01:00
Mazdak Farrokhzad
cd47af1881
Rollup merge of #67756 - Zoxc:collector-tweaks, r=Mark-Simulacrum
Collector tweaks

r? @Mark-Simulacrum
2020-01-11 12:36:04 +01:00
Vadim Petrochenkov
8e35c4f74c feature_gate: Remove GateStrength 2020-01-11 11:55:09 +03:00
Mazdak Farrokhzad
883932c6ba Ban ...X pats, harden tests, and improve diagnostics.
Also fix a bug with the span passed in `mk_range`.
2020-01-11 08:58:58 +01:00
Mazdak Farrokhzad
51078ceb44 fix ui-fulldeps & tests fallout 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
8be2a04c7e pacify the parallel compiler 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
b59235975e lints: move a comment 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
f58db20362 move rustc::lint::{context, passes} to rustc_lint.
Also do some cleanup of the interface.
2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
8c12c424e2 {rustc::lint -> rustc_lint}::internal 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
03dfa642d9 lints: promote levels.rs to lint.rs & extract passes.rs 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
16bf2783b5 inline maybe_lint_level_root 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
eee84fe396 move struct_lint_level to levels.rs 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
f577b44712 move LintSource to levels 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
03bdfe9db3 move logic to LintLevelsBuilder 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
6f1a79cabe GlobalCtxt: Erase LintStore type. 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
c151782d76 reduce diversity in linting methods 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
b93addba7a move in_derive_expansion as Span method 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
3a2af3242c canonicalize some lint imports 2020-01-11 07:42:15 +01:00
bors
543b7d97d0 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.
2020-01-11 06:15:59 +00:00
ecstatic-morse
fc30825c8b
Expand comment
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-01-10 19:29:16 -08:00
Lzu Tao
c2c2d3b32b Update test after renaming Result::as_deref 2020-01-11 03:26:09 +00:00
Lzu Tao
a5f42397be Rename Result::as_deref_ok to as_deref 2020-01-11 03:08:40 +00:00
Lzu Tao
7ba25acd7a Revert "Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=alexcrichton"
This reverts commit 4ed415b547, reversing
changes made to 3cce950743.
2020-01-11 03:04:39 +00:00
bors
88d1109600 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
2020-01-11 03:03:42 +00:00
Mazdak Farrokhzad
04a340f61f
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.
2020-01-11 04:02:31 +01:00
Mazdak Farrokhzad
c960c3e057
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")),
    }
}
```
2020-01-11 04:02:30 +01:00
Mazdak Farrokhzad
cacda2d7a0
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.
2020-01-11 04:02:28 +01:00
Mazdak Farrokhzad
ba14f9429a
Rollup merge of #68079 - varkor:E0013-clarify, r=Centril
Clarify suggestion for E0013

Fixes https://github.com/rust-lang/rust/issues/68038.
2020-01-11 04:02:27 +01:00
Mazdak Farrokhzad
ef3e360c4b
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.
2020-01-11 04:02:25 +01:00
Mazdak Farrokhzad
8c0c5c7e65
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
2020-01-11 04:02:24 +01:00
Mazdak Farrokhzad
9634e1f7d9
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`.
2020-01-11 04:02:22 +01:00
Mazdak Farrokhzad
76edc5c4eb
Rollup merge of #67666 - lzutao:ptr-null-cmp, r=dtolnay
make use of pointer::is_null

r? @Mark-Simulacrum
2020-01-11 04:02:21 +01:00
Dylan MacKenzie
1d418a1191 Test that stable const fn requires allow_internal_unstable 2020-01-10 18:51:42 -08:00
Dylan MacKenzie
09b5c854de 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.
2020-01-10 18:51:12 -08:00
Mazdak Farrokhzad
682f500c8f fix fallout in ui-fulldeps 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
d0d1c60f1e pacify tidy by nixing added docs :( 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
b4809d0818 appease rustfmt 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
7d6548a14a rustc_passes: remove unused rustc_parse dep 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
ae213db0f5 {syntax -> rustc_ast_passes}::show_span 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
6cbcb83022 {syntax -> rustc_ast_passes}::feature_gate 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
ed69fbbc44 ast_validation -> new crate rustc_ast_passes 2020-01-11 03:27:39 +01:00
Mazdak Farrokhzad
f361b71a7d nix syntax::early_buffered_lints 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
2b44a6c8f4 move {rustc -> rustc_session}::lint::builtin 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
45f27643db prepare moving HardwiredLints to rustc_session 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
7dbccf5b55 buffered lint infra -> rustc_session 2020-01-11 03:21:34 +01:00
Mazdak Farrokhzad
82eeb8573a prepare for moving BuiltinLintDiagnostics to rustc_session 2020-01-11 03:19:50 +01:00