Commit Graph

8098 Commits

Author SHA1 Message Date
bors
5095101528 Auto merge of #67752 - Dylan-DPC:rollup-7f9v4nx, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #67430 (doc: minus (U+2212) instead of dash (U+002D) for negative infinity)
 - #67697 (Move the region_scope_tree query to librustc_passes.)
 - #67719 (Add self to .mailmap)
 - #67723 (Add error code explanation for E0477)
 - #67735 (Support `-Z ui-testing=yes/no`)

Failed merges:

r? @ghost
2019-12-31 12:58:10 +00:00
Dylan DPC
529a42a1a6
Rollup merge of #67735 - petrochenkov:uibool, r=Mark-Simulacrum
Support `-Z ui-testing=yes/no`

`ui-testing` is now a boolean option (`-Z ui-testing=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z ui-testing=yes -Z ui-testing=no` == `-Z ui-testing=no`), so it can be set in a hierarchical way, e.g. UI testing infra may enable it by default with specific tests being able to opt-out.

This way we can remove the special opt-out support from `compiletest`.

Inspired by https://github.com/rust-lang/rust/pull/67709.
2019-12-31 18:14:07 +05:30
Dylan DPC
cf24b6bcbf
Rollup merge of #67723 - ldm0:E0477, r=Dylan-DPC
Add error code explanation for E0477

Part of #61137
2019-12-31 18:14:06 +05:30
bors
71bb0ff33e Auto merge of #67597 - estebank:placeholder-type, r=oli-obk
Suggest type param when encountering `_` in item signatures

Fix #27435.
2019-12-31 09:50:49 +00:00
Vadim Petrochenkov
208c1bff0a Support -Z ui-testing=yes/no 2019-12-30 20:01:34 +03:00
bors
0fb4380136 Auto merge of #67667 - wesleywiser:speed_up_trivially_valid_constants, r=oli-obk
Resolve long compile times when evaluating always valid constants

This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.

Fixes #67539

r? @oli-obk
cc @RalfJung @spastorino
2019-12-30 11:31:04 +00:00
Donough Liu
751fe7c43d Add error code explanation for E0477 2019-12-30 14:41:46 +08:00
bors
d297b19663 Auto merge of #67721 - JohnTitor:rollup-o8zm4r9, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #64273 (Stabilize attribute macros on inline modules)
 - #67287 (typeck: note other end-point when checking range pats)
 - #67564 (docs: Iterator adapters have unspecified results after a panic)
 - #67622 (Some keyword documentation.)
 - #67657 (Clean up const-hack PRs now that const if / match exist.)
 - #67677 (resolve: Minor cleanup of duplicate macro reexports)
 - #67687 (Do not ICE on lifetime error involving closures)
 - #67698 (Move reachable_set and diagnostic_items to librustc_passes.)
 - #67701 (tidy: Enforce formatting rather than just check it if `--bless` is specified)
 - #67715 (Typo fix)

Failed merges:

r? @ghost
2019-12-30 05:12:48 +00:00
Yuki Okushi
3928aceb49
Rollup merge of #67687 - estebank:issue-67634, r=matthewjasper
Do not ICE on lifetime error involving closures

Fix #67634.
2019-12-30 14:07:53 +09:00
Yuki Okushi
f70847a863
Rollup merge of #67677 - petrochenkov:dupexp, r=Centril
resolve: Minor cleanup of duplicate macro reexports

Enabled by https://github.com/rust-lang/rust/pull/65785 which changed `duplicate_macro_exports` from a lint to a hard error.
2019-12-30 14:07:52 +09:00
Yuki Okushi
2c46dd16a5
Rollup merge of #67287 - Centril:mismatch-range-improve-diag, r=estebank
typeck: note other end-point when checking range pats

Fixes #57389, alternative to #67214 that should be less invasive to type checking logic.

r? @estebank
2019-12-30 14:07:46 +09:00
Yuki Okushi
f0309f5a72
Rollup merge of #64273 - petrochenkov:stabattrmod, r=Centril
Stabilize attribute macros on inline modules

While still gating non-inline modules in proc macro input.

Split from https://github.com/rust-lang/rust/pull/63931
cc https://github.com/rust-lang/rust/issues/54727
2019-12-30 14:07:44 +09:00
Esteban Küber
cfa0b07c8d clean up logic 2019-12-29 19:16:53 -08:00
Esteban Küber
fb52883690 Account for existing type params when suggesting replacing _ for a new one 2019-12-29 19:16:15 -08:00
Esteban Küber
6c8b2dcb19 Account for all item kinds when collecting and gateing _ in item defs 2019-12-29 19:16:15 -08:00
Esteban Küber
8cb193a5cb Suggest type param when encountering _ in fn defs
When encountering `_` type placeholder in fn arguments and return type,
suggest using generic type parameters.
Expand what counts as an inferable return type to slice, array and
tuples of `_`.
2019-12-29 19:11:27 -08:00
bors
214548b8af Auto merge of #67631 - oli-obk:polymorphic_promotion, r=wesleywiser
Work around a resolve bug in const prop

r? @wesleywiser @anp

This isn't exposed right now, but further changes to rustc may start causing bugs without this.
2019-12-30 02:05:24 +00:00
Mazdak Farrokhzad
c4b6de2d6a note other end-point when typeck range pats 2019-12-30 02:48:35 +01:00
Wesley Wiser
5ca3a1bed1 Resolve long compile times when evaluating always valid constants
This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.

Fixes #67539
2019-12-29 16:45:58 -05:00
bors
da3629b05f Auto merge of #67112 - Centril:expr-polish, r=estebank
Refactor expression parsing thoroughly

Based on https://github.com/rust-lang/rust/pull/66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
2019-12-29 19:30:53 +00:00
bors
00fc203b65 Auto merge of #67334 - estebank:ignore-triple, r=nikomatsakis
Teach `compiletest` to ignore platform triples

The UI tests are written assuming `--remap-path-prefix` is *not used* (`remap-debuginfo` in `config.toml`). The consequence is that the error messages may include paths and snippets into the standard library. When `remap-debuginfo` is enabled, these messages change in format and structure because `rustc` will not show paths and snippets into the standard library.

This normally isn't a problem for the "main" platforms (linux/macos/windows), because the CI infrastructure is set up so that the tests run without `remap-debuginfo`, but the `dist` artifacts are built separately with `remap-debuginfo` enabled. However, some of the lower-tier platforms perform both tests and distribution in a single step with `remap-debuginfo` enabled. This also affects developers and distributors who use `remap-debuginfo`.

To sidestep this problem, we add a way to ignore tests in specific platform triples, and update the overly broad `ignore-x86` rule in affected tests.

Address #46948, #54546, #53081.
2019-12-28 23:02:09 +00:00
Esteban Küber
5e1b366fb6 Do not ICE on lifetime error involving closures 2019-12-28 13:51:29 -08:00
Esteban Küber
90bf0d2e33 Ignore i586-unknown-linux-gnu and i586-unknown-musl in tests 2019-12-28 12:26:48 -08:00
Vadim Petrochenkov
a0d8b794d6 resolve: Minor cleanup of duplicate macro reexports 2019-12-28 17:37:22 +03:00
Vadim Petrochenkov
e3155abd2e Stabilize attribute macros on inline modules 2019-12-28 11:42:26 +03:00
bors
8b4d22cb25 Auto merge of #67598 - jumbatm:issue67557_simd_shuffle, r=oli-obk
Fix ICE / miscompilation when inlining simd shuffle intrinsic in MIR.

Closes #67557.

r? @oli-obk
2019-12-28 06:02:45 +00:00
Oliver Scherer
9eb45e38dc
Rollup merge of #67654 - rossmacarthur:fix-51770-add-regression-test, r=Centril
Add regression test for old NLL ICE

This fails on nightly-2018-06-24.

Resolves #51770
2019-12-28 00:36:16 +01:00
Oliver Scherer
b88ce0ed4b
Rollup merge of #67621 - matthewjasper:correct-static-type, r=oli-obk
Use the correct type for static qualifs

Closes #67609
2019-12-28 00:36:08 +01:00
Sean McArthur
f35517ee86 core: add IntoFuture trait and support for await 2019-12-27 11:56:11 -08:00
Wesley Wiser
25a8b5d58e Fix Instance::resolve() incorrectly returning specialized instances
We only want to return specializations when `Reveal::All` is passed, not
when `Reveal::UserFacing` is. Resolving this fixes several issues with
the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization
passes.

Fixes #66901
2019-12-27 13:04:32 -05:00
Ross MacArthur
749295cfbf
Add regression test for old NLL ICE 2019-12-27 13:36:41 +02:00
Oliver Scherer
f65a91eb47 Make ui test bitwidth independent 2019-12-26 22:50:18 +01:00
Oliver Scherer
72ebce0e1b Remove unintended noisy log statement 2019-12-26 22:50:17 +01:00
Oliver Scherer
6b651b1a88 Add regression test for ZST statics being allowed to "read" from themselves 2019-12-26 22:50:17 +01:00
Oliver Scherer
a0bd1a695d Prevent an ICE on invalid transmutes 2019-12-26 22:50:16 +01:00
Oliver Scherer
1e40681f50 Don't ICE on the use of integer addresses for ZST constants in pattern matching 2019-12-26 22:46:22 +01:00
bors
3e0a1c0910 Auto merge of #67592 - matthewjasper:cleanup-match, r=Centril
Prepare for lowering or-patterns

This is probably best reviewed commit-by-commit.

* Rustfmt `rustc_mir::build::{self, matches}`
* Remove `-Znll-dont-emit-read-for-match`
* Split `match_expr` into smaller functions
* Feature gate or-patterns in const contexts

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

r? @Centril
2019-12-26 16:44:52 +00:00
bors
3ac40b69c7 Auto merge of #67327 - oli-obk:cleanup, r=RalfJung
Split up `const_eval.rs`

Fixes #67316

r? @RalfJung
2019-12-26 13:15:05 +00:00
Oliver Scherer
7d5f36a1e5 A cycle error on a diverging function is now a const stack overflow again 2019-12-26 12:11:12 +01:00
bors
acb6690e1d Auto merge of #66670 - crlf0710:normalize_ident, r=Dylan-DPC
Normalize ident

Perform unicode normalization on identifiers. Resolving the first bullet point in #55467.
2019-12-26 09:55:00 +00:00
Charles Lew
541d879f71 Add a test and bless existing test case. 2019-12-26 13:13:01 +08:00
bors
c0b16b4e6a Auto merge of #67268 - estebank:assoc-types, r=oli-obk
Tweak errors for missing associated types and type parameters

* On `dyn Trait` missing associated types, provide a structured suggestion for them
* On missing type parameters, provide structured suggestion for them
* Point at trait definition when missing required type parameter
* Tweak output of E0658
* Tweak wording of E0719
* Account for `Trait1 + Trait2` case

Fix #66380, fix #60595. CC #63711.
2019-12-26 03:42:59 +00:00
bors
b13d65ab92 Auto merge of #67580 - RalfJung:miri-unleash-tests, r=oli-obk
test the unleashed Miri

In particular, test what happens when we try to drop something. Cc https://github.com/rust-lang/const-eval/issues/17

r? @oli-obk
2019-12-26 00:27:13 +00:00
bors
bbf13723bc Auto merge of #66919 - dtolnay:description, r=KodrAus
Deprecate Error::description for real

`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it.

This PR:

- adds `#[rustc_deprecated(since = "1.41.0")]` to `Error::description`;
- moves `description` (and `cause`, which is also deprecated) below the `source` and `backtrace` methods in the Error trait;
- reduces documentation of `description` and `cause` to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call `description`;
- removes the description function of all *currently unstable* Error impls in the standard library;
- marks `#[allow(deprecated)]` the description function of all *stable* Error impls in the standard library;
- replaces miscellaneous uses of `description` in example code and the compiler.

---

![description](https://user-images.githubusercontent.com/1940490/69910369-3bbaca80-13bf-11ea-94f7-2fe27a7ea333.png)
2019-12-25 21:10:49 +00:00
Matthew Jasper
5d19d4d894 Use the correct type for static qualifs 2019-12-25 21:09:51 +00:00
Esteban Küber
621d7e959b Fix rebase and sort assoc type list for deterministic output 2019-12-25 11:12:56 -08:00
bors
ed33453a37 Auto merge of #67524 - LukasKalbertodt:improve-into-iter-lint, r=matthewjasper
Generalize `array_into_iter` lint to also lint for boxed arrays

`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.

---

CC #66145
r? @matthewjasper  (as you reviewed the first PR)
2019-12-25 10:20:48 +00:00
Ralf Jung
40b8b7c338 use error-pattern 2019-12-25 11:19:05 +01:00
Matthew Jasper
f1758a043f Feature gate or patterns in const contexts 2019-12-25 09:13:15 +00:00
David Tolnay
4646a88b7a
Deprecate Error::description for real
`description` has been documented as soft-deprecated since 1.27.0 (17
months ago). There is no longer any reason to call it or implement it.

This commit:

- adds #[rustc_deprecated(since = "1.41.0")] to Error::description;

- moves description (and cause, which is also deprecated) below the
  source and backtrace methods in the Error trait;

- reduces documentation of description and cause to take up much less
  vertical real estate in rustdocs, while preserving the example that
  shows how to render errors without needing to call description;

- removes the description function of all *currently unstable* Error
  impls in the standard library;

- marks #[allow(deprecated)] the description function of all *stable*
  Error impls in the standard library;

- replaces miscellaneous uses of description in example code and the
  compiler.
2019-12-24 22:39:49 -08:00