bors [Wed, 1 Jan 2020 21:27:11 +0000 (21:27 +0000)]
Auto merge of #67676 - wesleywiser:lint_overflowing_int_casts, r=oli-obk
Lint overflowing integer casts in const prop
This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.
bors [Wed, 1 Jan 2020 11:54:21 +0000 (11:54 +0000)]
Auto merge of #67471 - nnethercote:revert-66405, r=nikomatsakis
Revert parts of #66405.
Because PR #66405 caused major performance regressions in some cases.
That PR had five commits, two of which affected performance, and three
of which were refactorings. This change undoes the performance-affecting
changes, while keeping the refactorings in place.
Because it caused major performance regressions in some cases.
That PR had five commits, two of which affected performance, and three
of which were refactorings. This change undoes the performance-affecting
changes, while keeping the refactorings in place.
Rollup merge of #67748 - MaskRay:frame-pointer, r=rkruppe
Use function attribute "frame-pointer" instead of "no-frame-pointer-elim"
LLVM 8 ([D56351](http://reviews.llvm.org/D56351)) introduced "frame-pointer". In LLVM 10 (D71863),
"no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf" will be
ignored.
-----
In the LLVM monorepo, run `git show origin/release/8.x:llvm/lib/CodeGen/TargetOptionsImpl.cpp` to see that `"frame-pointer"` is available since LLVM 8.
Rollup merge of #67744 - Centril:reduce-diversity, r=petrochenkov
parser: reduce diversity in error handling mechanisms
Instead of having e.g. `span_err`, `fatal`, etc., we prefer to move towards uniformly using `struct_span_err` thus making it harder to emit fatal and/or unstructured diagnostics.
Rollup merge of #67574 - Centril:librustc_lowering, r=Mark-Simulacrum
Extract `rustc_ast_lowering` crate from `rustc`
Working towards https://github.com/rust-lang/rust/issues/65031.
This PR moves `src/librustc/hir/lowering{/, .rs}` to its own crate (`librustc_ast_lowering`) which is very self-contained (only `fn lower_crate` and `trait Resolver` are exposed).
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.
Wesley Wiser [Fri, 13 Dec 2019 03:03:32 +0000 (22:03 -0500)]
Lint overflowing integer casts in const prop
This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.
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?