Commit Graph

95224 Commits

Author SHA1 Message Date
Oliver Scherer
91a15e2857 Pacify tidy 2019-06-24 16:34:50 +02:00
Oliver Scherer
1140a916f6 Add regression test 2019-06-24 15:34:29 +02:00
Oliver Scherer
6b26fdad0a Don't ICE on mutable zst slices 2019-06-24 15:31:52 +02:00
Oliver Scherer
354163d478 Simplify vtable interning 2019-06-24 15:31:25 +02:00
bors
166c49d7a1 Auto merge of #62012 - wesleywiser:const_prop_use_ecx, r=oli-obk
Use ecx for const-prop local storage

r? @oli-obk
2019-06-24 07:48:29 +00:00
bors
3cc3486733 Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkov
Remove `ast::Guard`

With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here.

However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...).

r? @petrochenkov
2019-06-24 05:00:10 +00:00
bors
85ed21e83c Auto merge of #62070 - ia0:rustfmt, r=petrochenkov
Run rustfmt on some libsyntax files

As part of #62008, run rustfmt on:
- src/libsyntax/ext/tt/macro_rules.rs
- src/libsyntax/ext/tt/quoted.rs

There is no semantic change. To fix potential merge conflicts, simply choose the other side then run rustfmt and fix any tidy check (like line length).
2019-06-23 22:50:56 +00:00
bors
de7c4e4231 Auto merge of #62037 - Mark-Simulacrum:tidy-fast, r=eddyb
Speed up tidy

master:
  Time (mean ± σ):      3.478 s ±  0.033 s    [User: 3.298 s, System: 0.178 s]
  Range (min … max):    3.425 s …  3.525 s    10 runs

This PR:
  Time (mean ± σ):      1.098 s ±  0.006 s    [User: 783.7 ms, System: 310.2 ms]
  Range (min … max):    1.092 s …  1.113 s    10 runs

Alleviates https://github.com/rust-lang/rust/issues/59884. For the most part each commit stands on its own. Timings are on warm filesystem cache.

r? @eddyb
2019-06-23 20:05:01 +00:00
bors
2cd5ed495c Auto merge of #61778 - petrochenkov:pass, r=Mark-Simulacrum
compiletest: Introduce `// {check,build,run}-pass` pass modes

Pass UI tests now have three modes
```
// check-pass
// build-pass
// run-pass
```
mirroring equivalent well-known `cargo` commands.

`// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases).
`// build-pass` will compile and link the test without running it.
`// run-pass` will compile, link and run the test.
Tests without a "pass" annotation are still considered "fail" tests.

Most UI tests would probably want to switch to `check-pass`.
Tests validating codegen would probably want to run the generated code as well and use `run-pass`.
`build-pass` should probably be rare (linking tests?).

https://github.com/rust-lang/rust/pull/61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way.
Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test.
Perhaps some secondary CI can verify this invariant, but that's not super urgent.

`// compile-pass` still works and is equivalent to `build-pass`.
Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command.
It can be removed some time in the future in a separate PR.

cc https://github.com/rust-lang/rust/issues/61712
2019-06-23 17:16:22 +00:00
Mark Rousskov
777951c926 Exit early from feature search if no features in file 2019-06-23 09:10:26 -04:00
Mark Rousskov
6c5c78d00c Collect features only once 2019-06-23 09:10:26 -04:00
Mark Rousskov
ebbc662f07 Use Path/PathBuf directly instead of through path:: 2019-06-23 09:10:26 -04:00
Mark Rousskov
7dd7c0ff0a Skip querying each ignore directive if none in file 2019-06-23 09:10:26 -04:00
Mark Rousskov
d619e44a55 Utilize entry.metadata over fs::symlink_metadata 2019-06-23 09:10:26 -04:00
Mark Rousskov
38f0b90e45 Move file-reading into walker loop 2019-06-23 09:10:26 -04:00
Mark Rousskov
c113a3769d Pass contents and DirEntry to walkers 2019-06-23 09:10:26 -04:00
Mark Rousskov
5c33c3e308 Stop calling format! to check feature gate 2019-06-23 09:10:26 -04:00
Mark Rousskov
e17b02d9b9 Use walkdir crate
It's more efficient than the fs::read_dir API
2019-06-23 09:10:24 -04:00
Mark Rousskov
5f1da8e533 Cache Regex's 2019-06-23 09:10:08 -04:00
Mark Rousskov
2b6371dbfb Make tidy quieter by default 2019-06-23 09:09:44 -04:00
bors
5d677b2efd Auto merge of #60861 - Centril:let-chains-ast-intro, r=petrochenkov
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.
Next step after https://github.com/rust-lang/rust/pull/59288.

cc @Manishearth re. Clippy.

r? @oli-obk
2019-06-23 12:28:12 +00:00
Julien Cretin
0aeab41e5a Run rustfmt 2019-06-23 11:44:52 +02:00
Mazdak Farrokhzad
4d53714183 Remove redundant syntax::ast::Guard. 2019-06-23 11:32:16 +02:00
bors
a96ba96915 Auto merge of #62069 - Centril:rollup-m8n4uw7, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #62047 (Trigger `unused_attribute` lint on `#[cfg_attr($pred,)]`)
 - #62049 (Fix one missing `dyn`.)
 - #62051 (Lint empty `#[derive()]` as unused attribute.)
 - #62057 (Deny explicit_outlives_requirements in the compiler)
 - #62068 (Fix meta-variable binding errors in macros)

Failed merges:

r? @ghost
2019-06-23 00:10:17 +00:00
Mazdak Farrokhzad
74380b3336
Rollup merge of #62068 - ia0:fix_meta_var, r=petrochenkov
Fix meta-variable binding errors in macros

The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
  left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
  kleene operator as its binder in the left-hand side. Either it does not repeat
  enough, or it uses a different operator somewhere.

This change should have no semantic impact.

Found by https://github.com/rust-lang/rust/pull/62008
2019-06-23 01:59:20 +02:00
Mazdak Farrokhzad
07c82e183b
Rollup merge of #62057 - matthewjasper:deny-unnecessary-outlives, r=Mark-Simulacrum
Deny explicit_outlives_requirements in the compiler
2019-06-23 01:59:19 +02:00
Mazdak Farrokhzad
675ac94f8b
Rollup merge of #62051 - Centril:unused-derive-, r=petrochenkov
Lint empty `#[derive()]` as unused attribute.

Closes https://github.com/rust-lang/rust/issues/54651.

cc https://github.com/rust-lang/rust/issues/55112

r? @petrochenkov
2019-06-23 01:59:17 +02:00
Mazdak Farrokhzad
0f2f993879
Rollup merge of #62049 - crlf0710:patch-2, r=jonas-schievink
Fix one missing `dyn`.

It's in the documentation of `Unsize`.
2019-06-23 01:59:16 +02:00
Mazdak Farrokhzad
869680736d
Rollup merge of #62047 - Centril:cfg-attr-empty-lint, r=estebank
Trigger `unused_attribute` lint on `#[cfg_attr($pred,)]`

Lint on `#[cfg_attr($pred,)]` as decided in https://github.com/rust-lang/rust/issues/54881#issuecomment-441442173.

Closes https://github.com/rust-lang/rust/issues/54881.

r? @estebank
2019-06-23 01:59:15 +02:00
Mazdak Farrokhzad
c75f7ecaee let_chains: note re. back-compat wrt. expr beginning. 2019-06-23 01:41:09 +02:00
Mazdak Farrokhzad
7abb2350df let_chains: Revert 'fn with' in ast_validation. 2019-06-23 01:39:13 +02:00
Julien Cretin
b8106b59d2 Fix meta-variable binding errors in macros
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
  left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
  kleene operator as its binder in the left-hand side. Either it does not repeat
  enough, or it uses a different operator somewhere.

This change should have no semantic impact.
2019-06-23 01:30:41 +02:00
Mazdak Farrokhzad
90b9e96cc3 let_chains: More accurately describe ast::ExprKind::Let.
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
bc72ce66a1 let_chains: Add test cases to pprust-expr-roundtrip. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
851066f57e let_chains: Fix bugs in pretty printing. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
7465eb44f0 let_chains: Refactor parse_{if,while}_expr a bit. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
5ae5086cc5 let_chains: --bless tests due to recovery in lowering. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
2017be4ef6 let_chains: Remove ast_validation logic in favor of lowering with recovery. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
10234d286a let_chains: Adjust tests for pre-expansion gating. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
eb4f54a58d let_chains: Move feature gating to pre-expansion. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
d551880267 let_chains: Inline visit_expr_with_let_maybe_allowed. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
92587e41d9 let_chains: readd kw::let to ident_can_begin_expr. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
61fc727fe0 let_chains: Fuse PatternSource::Let & ::LetExpr. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
a505d9d20a let_chains: scrutinee -> condition 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
07f37c88fb let_chains: Account for const generics in validation tests. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
a80aa34951 let_chains: Change AST validation strategy slightly. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
1ff947f596 let_chains: scrutinee -> head expression. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
3b7f0cb7e0 let_chains: Fix outdated doc-comment re. 'parse_if_expr'. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
8b72e4c815 let_chains: Improve documentation for ast::ExprKind::Let(..). 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
86250a666e let_chains: Comment out Let in ident_can_begin_expr. 2019-06-23 01:29:29 +02:00