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.
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
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
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.
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
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 `_`.
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.
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
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
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.
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
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
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.
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)
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)
`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.