Commit Graph

102742 Commits

Author SHA1 Message Date
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
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
Mazdak Farrokhzad
02b38ac0ff
Rollup merge of #66468 - RalfJung:simd-cleanup, r=oli-obk
Cleanup Miri SIMD intrinsics

r? @oli-obk @eddyb Cc @gnzlbg
2019-11-21 15:29:05 +01:00
Mazdak Farrokhzad
e4a634189e
Rollup merge of #65730 - csmoe:return-lifetime, r=nikomatsakis
Suggest to add lifetime constraint at explicit ouput of functions

Closes #62097
2019-11-21 15:29:02 +01:00
Mazdak Farrokhzad
0828d5327b
Rollup merge of #65355 - Centril:almost-is-never-enough, r=oli-obk
Stabilize `!` in Rust 1.41.0

This PR stabilizes the `never_type` (written `!`). The type represents computations that we know diverge in the type system and therefore has no values / inhabitants / elements / members.

The current nightly version is 1.40.0 which will become stable on 2019-12-19.

Tracking issue: https://github.com/rust-lang/rust/issues/35121.
Closes https://github.com/rust-lang/rust/issues/57012.
Closes https://github.com/rust-lang/rust/issues/58184.
Original stabilization report: https://github.com/rust-lang/rust/issues/57012#issuecomment-452398538

Additional notes:

- In #62661 we reserved `impl<T> From<!> for T` so this concern should be resolved.
- The type inference fallback change is moved to `#![feature(never_type_fallback)]` (https://github.com/rust-lang/rust/issues/65992).
- You can find all of the tests referencing `never_type` in this PR which also reorganizes these tests whereas they were more scattered before.

r? @nikomatsakis
2019-11-21 15:29:00 +01:00
Mazdak Farrokhzad
238d03b3a3 never_type: test interaction with auto traits 2019-11-21 15:09:18 +01:00
Mazdak Farrokhzad
089229a193 Redefine core::convert::Infallible as !. 2019-11-21 14:55:33 +01:00
Mazdak Farrokhzad
6eb0627b49 Gate fallback via #![feature(never_type_fallback)]. 2019-11-21 14:55:33 +01:00
Mazdak Farrokhzad
8f6197f39f Remove #![feature(never_type)] from tests.
Also remove `never_type` the feature-gate test.
2019-11-21 14:55:32 +01:00
Mazdak Farrokhzad
15c30ddd69 Stabilize the never_type, written !. 2019-11-21 14:55:32 +01:00
Guillaume Gomez
df9fed17ed Update tidy check for error codes testing 2019-11-21 13:12:43 +01:00
Guillaume Gomez
d0b67ddc0f Revert "Update Source Code Pro and include italics"
This reverts commit ea9519bf16.
2019-11-21 11:18:23 +01:00
MaulingMonkey
839d58ca56 debuginfo: Support for std::collections::Hash* in windows debuggers. 2019-11-20 19:27:42 -08:00
Mazdak Farrokhzad
44cebe5970 reduce size of hir::ExprKind 2019-11-21 01:23:29 +01:00
Aaron Hill
a5c45f006a
Bump Miri for return code propagation 2019-11-20 17:26:49 -05:00
Phlosioneer
983cae77dd
Clarify Step Documentation
While the redesign is in progress (#62886), clarify the purpose of replace_zero and replace_one.
2019-11-20 14:40:54 -05:00
bors
f1b882b558 Auto merge of #66578 - Centril:rollup-pgz1v7t, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #66060 (Making ICEs and test them in incremental)
 - #66298 (rustdoc: fixes #64305: disable search field instead of hidding it)
 - #66457 (Just derive Hashstable in librustc)
 - #66496 (rustc_metadata: Privatize more things)
 - #66514 (Fix selected crate search filter)
 - #66535 (Avoid ICE when `break`ing to an unreachable label)
 - #66573 (Ignore run-make reproducible-build-2 on Mac)

Failed merges:

r? @ghost
2019-11-20 19:15:41 +00:00
Mark Rousskov
70805e6444 Delete ProcessCfgMod
The previous commit removes the use of this, and now we cleanup.
2019-11-20 14:07:57 -05:00
Mazdak Farrokhzad
8754409159
Rollup merge of #66573 - pnkfelix:issue-66568-ignore-reproducible-build-2-on-macos, r=alexcrichton
Ignore run-make reproducible-build-2 on Mac

Ignore run-make reproducible-build-2 on Mac (we already ignore it on Windows).

Until we can dedicate resources to fixing this properly, I think we are best off just ignoring this test on platforms/contexts where it does not matter as much.

cc #66568
2019-11-20 18:32:13 +01:00
Mazdak Farrokhzad
52ed2c6dea
Rollup merge of #66535 - estebank:issue-62480, r=matthewjasper
Avoid ICE when `break`ing to an unreachable label

Fix #62480.
2019-11-20 18:32:12 +01:00
Mazdak Farrokhzad
4bd9168d7f
Rollup merge of #66514 - GuillaumeGomez:fix-search-filter-save, r=kinnison
Fix selected crate search filter

Fixes #62929.

r? @kinnison
2019-11-20 18:32:10 +01:00
Mazdak Farrokhzad
5a84f9b86e
Rollup merge of #66496 - petrochenkov:metapriv2, r=eddyb
rustc_metadata: Privatize more things

Continuation of https://github.com/rust-lang/rust/pull/66056.

The most notable change here is that `CrateMetadata` is moved from `cstore.rs` to `decoder.rs`.
Most of uses of `CrateMetadata` fields are in the decoder and uses of `root: CrateRoot` and other fields are so intertwined with each other that it would be hard to move a part of them into `cstore.rs` to privatize `CrateMetadata` fields, so we are going the other way round.

`cstore.rs` can probably be dismantled now, but I'll leave this to some other day.
Similarly, remaining `CrateMetadata` fields can be privatized by introducing some getter/setter methods, but not today.

r? @eddyb
2019-11-20 18:32:09 +01:00
Mazdak Farrokhzad
647eda17e8
Rollup merge of #66457 - cjgillot:just_hashstable, r=Zoxc
Just derive Hashstable in librustc

Split out of #66279

r? @Zoxc
2019-11-20 18:32:07 +01:00
Mazdak Farrokhzad
00cbc75c74
Rollup merge of #66298 - Ppjet6:disable-search-field, r=GuillaumeGomez
rustdoc: fixes #64305: disable search field instead of hidding it

The result seems to be ok but I wasn't entirely sure how to get there. I tried to stay generic a bit but maybe it's not required at all.

@GuillaumeGomez

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 18:32:06 +01:00
Mazdak Farrokhzad
e32397a754
Rollup merge of #66060 - traxys:test_65401, r=michaelwoerister
Making ICEs and test them in incremental

This adds:
 - A way to make the compiler ICE
 - A way to check for ICE in `cfail` tests with `should-ice`
 - A regression test for issue #65401

I am not sure the attribute added `should-ice` is the best for this job
2019-11-20 18:32:04 +01:00
Mark Rousskov
7ec20dd31d Remove pretty printing of specific nodes in AST
The ability to print a specific item as identified by NodeId or path
seems not particularly useful, and certainly carries quite a bit of
complexity with it.
2019-11-20 12:10:23 -05:00
Felix S. Klock II
9b40e0bb9a made gdb pretty-printing script more robust when printing uninitialized vec.
I based this solution on my reading of:

https://rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers#what-is-still-to-be-done

That post claims that there is no clean way to check for garbage pointers, and
so this PR adopts the same solution of tentatively attempting to convert a
dererence to a string, which throws a clean exception on garbage that we can
catch and recover from.

I only made the change to vec and not the other pretty printers because I wanted
to focus my effort on the simplest thing that would resolve issue #64343. In
particular, I *considered* generalizing this fix to work on the other datatypes
in the pretty-printing support library, but I don't want to invest effort in
that until after we resolve our overall debugging support strategy; see also
issues #60826 and #65564.
2019-11-20 16:37:17 +01:00
bors
b9cf541789 Auto merge of #66571 - Centril:rollup-41tn2fw, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #65665 (Update Source Code Pro and include italics)
 - #66478 (rustc_plugin: Remove the compatibility shim)
 - #66497 (Fix #53820)
 - #66526 (Add more context to `async fn` trait error)
 - #66532 (Generate DWARF address ranges for faster lookups)
 - #66546 (Remove duplicate function)
 - #66548 ([RISCV] Disable Atomics on all Non-A RISC-V targets)
 - #66553 (remove HermitCore leftovers from sys/unix)

Failed merges:

r? @ghost
2019-11-20 14:04:12 +00:00
Felix S. Klock II
6ab28b50da Ignore run-make reproducible-build-2 on Mac (we already ignore it on Windows).
Until we can dedicate resources to fixing this properly, I think we are
best off just ignoring this test on platforms/contexts where it does not
matter as much.
2019-11-20 14:07:01 +01:00
Mazdak Farrokhzad
ebd0ef9a39
Rollup merge of #66553 - hermitcore:hermit, r=rkruppe
remove HermitCore leftovers from sys/unix

HermitCore support is already moved to the directory "sys/hermit". => remove leftovers
2019-11-20 12:58:37 +01:00
Mazdak Farrokhzad
fff8ae1aa8
Rollup merge of #66548 - lenary:riscv/disable-atomics-non-a, r=alexcrichton
[RISCV] Disable Atomics on all Non-A RISC-V targets

In a `TargetOptions` configuration, `max_atomic_width: None` causes `max_atomic_width()` to return `Some(target_pointer_width)`. So, contrary to assumptions, `max_atomic_width: None` means you do have atomic support!

RISC-V's rv32i and rv32imc do not have architectural support for atomic memory accesses of any size, because they do not include the `A` architecture extension. This means the values in the target definition should be `Some(0)`.

This bug has been observed via a build failure with oreboot/oreboot#191, where LLVM was still generating libcalls for atomic operations. According to rust-lang/compiler-builtins, "Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations." - so this PR tries to bring rustc inline with this decision.

This commit also removes the outdated bug link, which references a now irrelevant GCC bug.

I will likely also have to revisit the `min_atomic_width` of all the RISC-V targets so they are correct and match what the hardware is capable of (which is more restricted than one might imagine).

r? @alexcrichton
2019-11-20 12:58:35 +01:00
Mazdak Farrokhzad
4997604503
Rollup merge of #66546 - aradzie:remove_duplicate_function, r=Dylan-DPC
Remove duplicate function

Function `source_name` declared in file

[src/librustc_driver/lib.rs](https://github.com/rust-lang/rust/blob/master/src/librustc_driver/lib.rs#L87)

is a duplicate of the function by the same name declared in file

[src/librustc/session/config.rs](https://github.com/rust-lang/rust/blob/master/src/librustc/session/config.rs#L511)
2019-11-20 12:58:33 +01:00
Mazdak Farrokhzad
1346557ba1
Rollup merge of #66532 - cuviper:dwarf-aranges, r=michaelwoerister
Generate DWARF address ranges for faster lookups

This adds a new option `-Zgenerate-arange-section`, enabled by default,
corresponding to LLVM's `-generate-arange-section`. This creates a
`.debug_aranges` section with DWARF address ranges, which some tools
depend on to optimize address lookups (elfutils [22288], [25173]).

This only has effect when debuginfo is enabled, and the additional data
is small compared to the other debug sections. For example, libstd.so
with full debuginfo is about 11MB, with just 61kB in aranges.

[22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288
[25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173

Closes #45246.
r? @michaelwoerister
2019-11-20 12:58:32 +01:00
Mazdak Farrokhzad
0a0d07a1fc
Rollup merge of #66526 - estebank:async-fn-trait-information, r=Centril
Add more context to `async fn` trait error

Follow up to #65937. Fix #65899.
2019-11-20 12:58:30 +01:00
Mazdak Farrokhzad
2d6e3764b4
Rollup merge of #66497 - Nadrieril:fix-53820, r=varkor
Fix #53820

This fixes ICE #53820 by being more clever when matching large arrays with slice patterns.
In particular, it avoids treating large arrays like large tuples, and instead reuses the `VarLenSlice` constructor behaviour to only consider as little values as needed.
As a side-effect, such matches also get improved diagnostics, by reporting `[true, ..]` missing instead of `[true, _, _, _, _, _, _, _]`.
2019-11-20 12:58:29 +01:00
Mazdak Farrokhzad
3ef2384e50
Rollup merge of #66478 - petrochenkov:rmplugin, r=davidtwco
rustc_plugin: Remove the compatibility shim

The compatibility crate was introduced in https://github.com/rust-lang/rust/pull/62727 to migrate Cargo and some other tools, but now it's no longer necessary.
2019-11-20 12:58:27 +01:00
Mazdak Farrokhzad
423137b779
Rollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics

Fixes #65502.

A few notes:
  * As stated in #65502, this does increase the download size.
  * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged.
  * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files ([Source Code Pro otf renders poorly on older Windows system apps](https://github.com/adobe-fonts/source-code-pro/issues/25#issuecomment-9019600)).
2019-11-20 12:58:26 +01:00
Guillaume Gomez
572133845a Change background-color of search input if disabled 2019-11-20 12:57:47 +01:00
bors
ea540b0892 Auto merge of #66392 - estebank:trait-alias-ice, r=eddyb
Do not ICE on trait aliases with missing obligations

Fix #65673.
2019-11-20 10:51:26 +00:00