Commit Graph

102946 Commits

Author SHA1 Message Date
Guillaume Gomez
60d9c2c239 Improve E0023 long error explanation 2019-11-22 19:14:09 +01:00
Guillaume Gomez
ea62c2e5b3 Improve E0015 long error explanation 2019-11-22 19:14:09 +01:00
Ralf Jung
9ff91ab2d3 fix reoccuring typo: dereferencable -> dereferenceable 2019-11-22 18:11:28 +01:00
Pietro Albini
90a37bce44
DO NOT MERGE: enable windows try builder 2019-11-22 15:37:36 +01:00
Pietro Albini
ee12992da9
ci: guess some environment variables based on builder name and os
Some environment variables (like DEPLOY or DEPLOY_ALT for dist builders,
or IMAGE on Linux builders) are set on a lot of builders, and whether
they should be present or not can be detected automatically based on the
builder name and the platform.

This commit simplifies the CI configuration by automatically setting
those environment variables.
2019-11-22 15:36:37 +01:00
Pietro Albini
262ce313d0
ci: add support for GitHub Actions in the CI scripts 2019-11-22 15:36:37 +01:00
bors
083b5a0a1b Auto merge of #66460 - cjgillot:hashstable_generic, r=Zoxc
Add a proc-macro to derive HashStable in librustc dependencies

A second proc-macro is added to derive HashStable for crates librustc depends on.
This proc-macro HashStable_Generic (to bikeshed) allows to decouple code and some librustc's boilerplate.

Not everything is migrated, because `Span` and `TokenKind` require to be placed inside librustc.
Types using them stay there too.

Split out of #66279
r? @Zoxc
2019-11-22 13:54:41 +00:00
Aaron Hill
45a9d279e4
Bump Miri for rustup fixes 2019-11-22 08:20:46 -05:00
Michael Woerister
68785d9614 PGO: Add regression test for indirect call promotion. 2019-11-22 13:52:55 +01:00
Michael Woerister
0675d65093 PGO: Add test case for branch weights and function call counts recording. 2019-11-22 12:16:09 +01:00
bors
eaac45a9a9 Auto merge of #66565 - Mark-Simulacrum:syntax-cfg-mod, r=petrochenkov
Move process_configure_mod to rustc_parse

This removes the hack in favor of perhaps a less principled, but less painful, approach.

This also supports my work to decouple `Session` from librustc, as `ParseSess` currently has `Attribute` as "part" of it but after this PR will no longer do so.
2019-11-22 10:33:29 +00:00
Guanqun Lu
da5539cf7c follow the convention in this file to use third-person singular verbs 2019-11-22 15:37:11 +08:00
bors
564f2d30ed Auto merge of #66537 - nnethercote:delay-is_local_ever_initialized, r=spastorino
Delay an `is_local_ever_initialized` call.

This commit moves the call after a `return` that almost always runs. It
speeds up the `unicode_normalization` benchmark by about 2%.

r? @spastorino
2019-11-22 07:21:48 +00:00
Robert Bamler
5028fd8ab9 Document pitfall with impl PartialEq<B> for A
Fixes #66476 by turning the violating example into an explicit
counterexample.
2019-11-21 23:16:44 -08:00
bors
bd816fd76f Auto merge of #66524 - ecstatic-morse:compiletest-multiple-revisions, r=Centril
Support multiple revisions in `compiletest`

The `//[X]~` syntax filters errors for tests that are run across multiple cfgs with  `// revisions:`. This commit extends that syntax to accept `//[X,Y]~`, which will match multiple cfgs to the same error annotation. This is functionally the same as writing two comments, `//[X]~` and `//[Y]~`, but can fit on a single line.

While refactoring `compiletest` to support this, I also uncovered a small bug that was causing an incremental test to always pass, despite no errors being emitted.

r? @Centril
2019-11-22 04:06:52 +00:00
Esteban Küber
34f03c01f6 Point at type in let assignment on type errors 2019-11-21 19:24:31 -08:00
Dylan MacKenzie
b09bb1569b Allow Downcast projections in qualify_min_const_fn 2019-11-21 16:55:13 -08:00
Dylan MacKenzie
25122d09eb Const-check the discriminant of a SwitchInt 2019-11-21 16:55:13 -08:00
Dylan MacKenzie
5c377f37e4 Reorganize, bless and add tests for const control flow
This creates a new test directory, `ui/consts/control-flow` to hold
tests related to control flow in a const context. It also blesses all
existing tests with the new error messages, and adds new tests for the
`const_if_match` feature.
2019-11-21 16:55:13 -08:00
bors
abd69551bf Auto merge of #66282 - Centril:simplify-try, r=oli-obk
[mir-opt] asking `?`s in a more optimized fashion

This PR works towards https://github.com/rust-lang/rust/issues/66234 by providing two optimization passes meant to run in sequence:

- `SimplifyArmIdentity` which transforms something like:
  ```rust
  _LOCAL_TMP = ((_LOCAL_1 as Variant ).FIELD: TY );
  ((_LOCAL_0 as Variant).FIELD: TY) = move _LOCAL_TMP;
  discriminant(_LOCAL_0) = VAR_IDX;
  ```

  into:

  ```rust
  _LOCAL_0 = move _LOCAL_1
  ```

- `SimplifyBranchSame` which transforms `SwitchInt`s to identical basic blocks into a `goto` to the first reachable target.

Together, these are meant to simplify the following into just `res`:
```rust
match res {
    Ok(x) => Ok(x),
    Err(x) => Err(x),
}
```

It should be noted however that the desugaring of `?` includes a function call and so the first pass in this PR relies on inlining to substitute that function call for identity on `x`. Inlining requires `mir-opt-level=2` so this might not have any effect in perf-bot but let's find out.

r? @oli-obk -- This is WIP, but I'd appreciate feedback. :)
2019-11-22 00:16:40 +00:00
Dylan MacKenzie
26d93f35f6 Add entry for const_if_match in unstable book 2019-11-21 15:23:51 -08:00
Dylan MacKenzie
ccb6e9884e Suggest const_if_match on nightly 2019-11-21 14:20:00 -08:00
Dylan MacKenzie
f4b9dc7d59 Make name work for MatchSource 2019-11-21 14:20:00 -08:00
Dylan MacKenzie
929ff68376 Hold a TyCtxt in the HIR const-checker 2019-11-21 14:20:00 -08:00
Dylan MacKenzie
a98d20a260 Allow Downcast projections if const_if_match enabled
These are generated when matching on enum variants to extract the value
within. We should have no problem evaluating these, but care should be
taken that we aren't accidentally allowing some other operation.
2019-11-21 14:20:00 -08:00
Dylan MacKenzie
e969fb2176 Don't transform short-circuiting logic if const_if_match enabled 2019-11-21 14:20:00 -08:00
Dylan MacKenzie
365d123689 Add feature gate for const if and match 2019-11-21 14:19:59 -08:00
Dylan MacKenzie
c537f22900 Give name to full regex capture 2019-11-21 14:13:42 -08:00
Dylan MacKenzie
ae2293837e Change some tests to use the shorter comment style 2019-11-21 14:09:18 -08:00
Dylan MacKenzie
701f6e51b2 Fix broken incremental test
This test does not actually emit any warnings, since
`#![allow(warnings)]` was specified. `compiletest` was erroneously
ignoring `//~` tests and looking only for `//[X]~` ones. As a result of
the changes in the previous commit, we now look for `//~` comments in
incremental tests and expect them to appear in *all* revisions.
2019-11-21 14:08:33 -08:00
Dylan MacKenzie
54d51bc483 Allow multiple cfgs per comment in "revisions:" tests
The `//[X]~` syntax filters errors for tests that are run across
multiple cfgs with  `// revisions:`. This commit extends that syntax to
accept `//[X,Y]~`, which will match multiple cfgs to the same error
annotation. This is functionally the same as writing two comments,
`//[X]~` and `//[Y]~`, but can fit on a single line.
2019-11-21 14:08:33 -08:00
Matthew Jasper
bccc59a8e6 Address review comments 2019-11-21 21:20:47 +00:00
bors
f11759d38c Auto merge of #66610 - alexreg:trait-upcasting-cosmetic, r=Centril
Aggregation of drive-by cosmetic changes for trait-upcasting PR

Cherry-picked from #60900.

As requested by @Centril (and @nikomatsakis, I believe).

r? @Centril
2019-11-21 21:01:14 +00:00
Matthew Jasper
025630d189 Bless remaining test output 2019-11-21 20:55:17 +00:00
Matthew Jasper
9abc34ed9d Track pointers to statics in MIR 2019-11-21 20:55:17 +00:00
Matthew Jasper
c6d97dfd83 Fix rebase 2019-11-21 20:55:17 +00:00
Santiago Pastorino
47a3294a1c Readjust constant evaluation for operands 2019-11-21 20:54:55 +00:00
Santiago Pastorino
36006955e7 Simplify pattern 2019-11-21 20:54:55 +00:00
Santiago Pastorino
ae9677c82f Readjust const qualification to detect statics again 2019-11-21 20:54:55 +00:00
Oliver Scherer
a1d04cc1d8 Remove statics from HAIR by lowering them to a pointer constant 2019-11-21 20:54:33 +00:00
Mazdak Farrokhzad
2f00e86cb5 Introduce MIR optimizations for simplifying x? on Results.
This optimization depends on inlining for the identity
conversions introduced by the lowering of the `?`.
To take advantage of `SimplifyArmIdentity`, `-Z mir-opt-level=2`
is required because that triggers the inlining MIR optimization.
2019-11-21 20:05:16 +01:00
Alexander Regueiro
1b2de17647 Applied suggestions from code review. 2019-11-21 18:50:40 +00:00
Alexander Regueiro
51cb60cd3f Aggregation of drive-by cosmetic changes. 2019-11-21 18:50:38 +00:00
bors
53712f8637 Auto merge of #66389 - estebank:type-err-labels, r=petrochenkov
Specific labels when referring to "expected" and "found" types
2019-11-21 17:53:19 +00:00
QuietMisdreavus
0d7a7b5547 move cfg(doc) docs into a separate page 2019-11-21 15:38:30 +01:00
Guillaume Gomez
a056bf9714 Rename the cfg attribute from rustdoc to doc 2019-11-21 15:38:30 +01:00
Guillaume Gomez
086c8d3db7 Stabilize cfg rustdoc 2019-11-21 15:37:36 +01:00
bors
35ef33a89d Auto merge of #66607 - Centril:rollup-yb7cl73, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #65355 (Stabilize `!` in Rust 1.41.0)
 - #65730 (Suggest to add lifetime constraint at explicit ouput of functions)
 - #66468 (Cleanup Miri SIMD intrinsics)
 - #66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`)
 - #66602 (Revert "Update Source Code Pro and include italics")

Failed merges:

r? @ghost
2019-11-21 14:30:02 +00:00
Mazdak Farrokhzad
5ab2bccbcd
Rollup merge of #66602 - GuillaumeGomez:revert-font, r=GuillaumeGomez
Revert "Update Source Code Pro and include italics"

This reverts commit ea9519bf16.
2019-11-21 15:29:08 +01:00
Mazdak Farrokhzad
d7bb37d663
Rollup merge of #66515 - Centril:cheaper-inline-asm, r=oli-obk
Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`

r? @oli-obk
2019-11-21 15:29:07 +01:00