Dylan DPC [Tue, 31 Dec 2019 12:44:07 +0000 (18:14 +0530)]
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.
Dylan DPC [Tue, 31 Dec 2019 12:44:01 +0000 (18:14 +0530)]
Rollup merge of #67430 - tspiteri:minus-inf, r=Dylan-DPC
doc: minus (U+2212) instead of dash (U+002D) for negative infinity
The documentation for [`f32::NEG_INFINITY`](https://doc.rust-lang.org/std/f32/constant.NEG_INFINITY.html) contains “-∞” with a dash instead of a minus sign, “−∞” with a proper minus sign looks better with the used Source Serif Pro font. Similarly for [`f64::NEG_INFINITY`](https://doc.rust-lang.org/std/f64/constant.NEG_INFINITY.html).
bors [Tue, 31 Dec 2019 03:27:36 +0000 (03:27 +0000)]
Auto merge of #67032 - cjgillot:hirene, r=Zoxc
Allocate HIR on an arena 4/4
This is the fourth and last PR in the series started by #66931, #66936 and #66942.
The last commits should compile on their own.
The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene
A few more cleanups may be necessary, please tell me.
bors [Mon, 30 Dec 2019 18:06:54 +0000 (18:06 +0000)]
Auto merge of #67707 - petrochenkov:crateren, r=Centril
Rename some crates and modules in the frontend
Migrate from `syntax_*` naming scheme to `rustc_*`.
See https://github.com/rust-lang/rust/pull/65324#issuecomment-551103396 and several comments below.
This is a followup to (and thus blocked on) #67241.
r? @matthewjasper
cc @eddyb
I while try to do one more to get rid of the weird usage of `RegionInferenceCtx` in `borrow_check::diagnostics::{region_errors, region_naming}`. I think those uses can possibly also be refactored to use `MirBorrowckCtxt`...
bors [Mon, 30 Dec 2019 11:31:04 +0000 (11:31 +0000)]
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.
bors [Mon, 30 Dec 2019 05:12:48 +0000 (05:12 +0000)]
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)
Yuki Okushi [Mon, 30 Dec 2019 05:07:56 +0000 (14:07 +0900)]
Rollup merge of #67701 - petrochenkov:tidybless, r=Mark-Simulacrum
tidy: Enforce formatting rather than just check it if `--bless` is specified
Ensuring the "tidy"-ness currently requires running `rustfmt` twice:
```sh
./x.py fmt && ./x.py test tidy
```
, once to actually format code and the second time as a part of tidy to check that the code is formatted.
Running `rustfmt` is slow, so we don't want to run it twice.
With this PR tidy enforces the formatting rather than just checks it if `--bless` was passed to it:
```sh
./x.py test tidy --bless
```
Yuki Okushi [Mon, 30 Dec 2019 05:07:50 +0000 (14:07 +0900)]
Rollup merge of #67657 - jumbatm:cleanup-const-hack, r=oli-obk
Clean up const-hack PRs now that const if / match exist.
Closes #67627.
Cleans up these merged PRs tagged with `const-hack`:
- #63810
- #63786
- #61635
- #58044
reverting their contents to have the match or if expressions they originally contained.
r? @oli-obk
There's one more PR in those tagged with `const-hack` that originally wasn't merged (#65107). Reading the thread, it looks like it was originally closed because the `const-hack` for the checked arithmetic non-negligibly hurt performance, and because there was no way to manipulate the returned Option at compile time anyway (with neither const if nor const match). Would you like me to add these changes to the changes from this PR here too, now that we have the necessary features?
Wesley Wiser [Fri, 27 Dec 2019 19:33:22 +0000 (14:33 -0500)]
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.
Dylan DPC [Sun, 29 Dec 2019 07:39:56 +0000 (13:09 +0530)]
Rollup merge of #67482 - ldm0:master, r=petrochenkov
Fix outdated comment
Logics in `libsyntax/ext/expand.rs:MacroExpander::expand()` have been moved to `libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()`
This pull request fixs the dangling file path.
bors [Sat, 28 Dec 2019 23:02:09 +0000 (23:02 +0000)]
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.
During MIR interpretation it may happen that a place containing
uninitialized bytes is copied. This would read the current
representation of these bytes and write it to the destination even
though they must, by definition, not matter to the execution.
This elides that representation change when no bytes are defined in such
a copy, saving some cpu cycles. In such a case, the memory of the target
allocation is not touched at all which also means that sometimes no
physical page backing the memory allocation of the representation needs
to be provided by the OS at all, reducing memory pressure on the system.
Oliver Scherer [Fri, 27 Dec 2019 23:36:14 +0000 (00:36 +0100)]
Rollup merge of #67635 - Mark-Simulacrum:path-doc-unsafe, r=dtolnay
Document safety of Path casting
I would personally feel more comfortable making the relevant (internal anyway) types repr(transparent) and then documenting that we can make these casts because of that, but I believe this is a more minimal PR, so posting it first.
Oliver Scherer [Fri, 27 Dec 2019 23:36:09 +0000 (00:36 +0100)]
Rollup merge of #67629 - kraai:remove-redundant-link-texts, r=steveklabnik
Remove redundant link texts
Most of these links are followed by a parenthesized expression. I think that the redundant link texts were added to prevent interpretation as an inline link. This is unnecessary since the closing square bracket and opening parenthesis are separated by whitespace.
Oliver Scherer [Fri, 27 Dec 2019 23:36:04 +0000 (00:36 +0100)]
Rollup merge of #67602 - xfix:use-issue-none-instead-of-0-in-intrinsics, r=Centril
Use issue = "none" instead of "0" in intrinsics
`issue = "0"` was incorrectly used in https://github.com/rust-lang/rust/commit/9ee16e14c51668309f446636e8960b7fbbac066d, the project is moving away from issue 0
Oliver Scherer [Fri, 27 Dec 2019 23:36:01 +0000 (00:36 +0100)]
Rollup merge of #67588 - Kixunil:nonnull-slice-iter, r=rkruppe
Use NonNull in slice::Iter and slice::IterMut.
`ptr` of `slice::Iter` and `slice::IterMut` can never be null, but this
fact wasn't exploited for layout optimizations. By changing `ptr` from
`*<mutability> T` to `NonNull<T>`, the compiler can now optimize layout
of `Option<Iter<'a, T>>`.
Oliver Scherer [Fri, 27 Dec 2019 23:35:58 +0000 (00:35 +0100)]
Rollup merge of #65244 - seanmonstar:into-future, r=seanmonstar
add IntoFuture trait and support for await
The [async-await RFC](https://rust-lang.github.io/rfcs/2394-async_await.html#the-await-compiler-built-in) mentions being able to `await` anything implementing `IntoFuture`. Somewhere along the way, it was left out.