Commit Graph

82878 Commits

Author SHA1 Message Date
Mark Mansi
548f28e194 fix test stderrs 2018-08-27 13:06:26 -05:00
Niko Matsakis
09feec6d5c make to_location O(1) 2018-08-27 13:57:55 -04:00
Niko Matsakis
7eec37b2f9 merge PointIndexMap and RegionValueElements 2018-08-27 13:57:55 -04:00
Niko Matsakis
1ab08ef846 micro-optimize dominator code 2018-08-27 13:57:55 -04:00
Niko Matsakis
57f39ee79b kill dead code from util/liveness 2018-08-27 13:57:55 -04:00
Niko Matsakis
af3ff10c7d improve comment on LiveVar 2018-08-27 13:57:55 -04:00
Niko Matsakis
94697ba4b6 rename LocalWithRegion to LiveVar 2018-08-27 13:57:55 -04:00
Niko Matsakis
437485527e comment what trace does 2018-08-27 13:57:55 -04:00
Niko Matsakis
9394a99f8e fix comment 2018-08-27 13:57:55 -04:00
Niko Matsakis
a63ece43b3 enable feature impl_header_lifetime_elision 2018-08-27 13:57:55 -04:00
Niko Matsakis
4e3740ace0 liveness.rs: rustfmt 2018-08-27 13:57:55 -04:00
Niko Matsakis
12f50a6e75 implement liveness tracing, remove old liveness system 2018-08-27 13:57:55 -04:00
Alex Crichton
51fd3bf6a8 rustc: Suggest removing extern crate in 2018
This commit updates the `unused_extern_crates` lint to make automatic
suggestions about removing `extern crate` annotations in the 2018 edition. This
ended up being a little easier than originally though due to what's likely been
fixed issues in the resolver!

Closes #52829
2018-08-27 10:52:21 -07:00
Niko Matsakis
f1a675a467 update comment in the interest of precision 2018-08-27 13:48:40 -04:00
Niko Matsakis
a13e4aea81 remove the liveness mode and simplify categorize
Less modes!
2018-08-27 13:48:40 -04:00
bors
70a21e89f1 Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakis
fix for late-bound regions

Fix for https://github.com/rust-lang/rust/issues/53419

r? @nikomatsakis
2018-08-27 17:42:45 +00:00
Mark Mansi
6c264d764e Fix anon param + make it allow-by-def 2018-08-27 12:40:16 -05:00
Mark Mansi
15b2640e70 fix another 2018-08-27 12:40:16 -05:00
Mark Mansi
3a9cf12021 fix some anon params 2018-08-27 12:40:16 -05:00
Mark Mansi
e0d03fd524 oops 2018-08-27 12:40:16 -05:00
Mark Mansi
20723178cc warn on anon params in 015 2018-08-27 12:40:16 -05:00
Ralf Jung
6c78fa822a use associated const for machine controlling mutable statics
So get rid of the IsStatic trait again
2018-08-27 18:12:49 +02:00
Ralf Jung
5b737dbbf4 get rid of *most* of the fn call hack by honoring mir.spread_arg 2018-08-27 18:12:49 +02:00
Ralf Jung
c38cc896dc fix len() on non-array but array-layout types (e.g. SIMD) 2018-08-27 18:12:49 +02:00
Ralf Jung
07bdd48b60 expand comment on how statics work 2018-08-27 18:12:49 +02:00
Ralf Jung
c898e1911d fix handling of unsized types in validation; validate str to be UTF-8 2018-08-27 18:12:49 +02:00
Ralf Jung
89cfd08b47 validate enum discriminant whenever it is read 2018-08-27 18:12:49 +02:00
Ralf Jung
548b3738c2 dedicated handling for binops on bool and char (UB if they are not valid) 2018-08-27 18:12:49 +02:00
Ralf Jung
9cfc9f0765 get rid of FinishStatic hack from stack clenaup; const_eval can do that itself 2018-08-27 18:12:49 +02:00
Ralf Jung
ef96a60a4d move const_eval out of rustc_mir::interpret
to make sure that it does not access private implementation details
2018-08-27 18:12:49 +02:00
Ralf Jung
035c69f658 switch validation to use operand, not mplace
this means we can get rid of the public allocate_op, and make OpTy only
constructible in librustc_mir
2018-08-27 18:12:49 +02:00
Ralf Jung
a5baea64af terminator/drop.rs is just one fn... merge it together with the other terminator stuff 2018-08-27 18:12:49 +02:00
Ralf Jung
aa645f30da Clean up function calling
Still not as clean as I'd like it, but better
2018-08-27 18:12:49 +02:00
Ralf Jung
66d64babed simplify const_to_allocation_provider because it is used for statics only 2018-08-27 18:12:49 +02:00
Ralf Jung
286fc5caa2 allow Machine to hook into foreign statics; remove unused HasMemory trait 2018-08-27 18:12:49 +02:00
Ralf Jung
2592b20347 without all those copies of constants, we can finally make eval_operand take &self 2018-08-27 18:12:49 +02:00
Ralf Jung
c141ccf158 Miri Memory Work
* Unify the two maps in memory to store the allocation and its kind together.
* Share the handling of statics between CTFE and miri: The miri engine always
  uses "lazy" `AllocType::Static` when encountering a static.  Acessing that
  static invokes CTFE (no matter the machine).  The machine only has any
  influence when writing to a static, which CTFE outright rejects (but miri
  makes a copy-on-write).
* Add an `AllocId` to by-ref consts so miri can use them as operands without
  making copies.
* Move responsibilities around for the `eval_fn_call` machine hook: The hook
  just has to find the MIR (or entirely take care of everything); pushing the
  new stack frame is taken care of by the miri engine.
* Expose the intrinsics and lang items implemented by CTFE so miri does not
  have to reimplement them.
2018-08-27 18:12:49 +02:00
bors
8785e348ba Auto merge of #53580 - nikomatsakis:nll-issue-53568, r=pnkfelix
fix NLL ICEs

Custom type-ops reuse some of the query machinery -- but while query results are canonicalized after they are constructed, custom type ops are not, and hence we have to resolve the type variables to avoid an ICE here.

Also, use the type-op machinery for implied outlives bounds.

Fixes #53568
Fixes #52992
Fixes #53680
2018-08-27 14:44:13 +00:00
Douglas Campos
d9791d6538 add test for the suggestion from prelude 2018-08-27 14:12:31 +00:00
Douglas Campos
ae853752d8 no need to special case std 2018-08-27 12:36:30 +00:00
bors
b638d8c75f Auto merge of #53656 - nnethercote:HybridIdxSet-tweaks, r=nikomatsakis
`HybridIdxSet` tweaks

A couple of tweaks to `HybridIdxSet`.

r? @nikomatsakis
2018-08-27 11:47:03 +00:00
Matthew Jasper
7f7fadaee6 Also use smaller spans for unsize adjustments 2018-08-27 12:36:49 +01:00
bors
291d958585 Auto merge of #53624 - Zoxc:ice-fix, r=oli-obk
Move with_globals setup from run_compiler to run

An alternative to https://github.com/rust-lang/rust/pull/53526

Note this breaks some miri stuff and clippy since they call `run_compiler` directly, and they now need to also call `with_globals ` cc @rust-lang/dev-tools

r? @oli-obk
2018-08-27 09:08:27 +00:00
Nicholas Nethercote
130e55665f Avoid calling unroll_place() in a common case.
This reduces the execution time for `ucd-check` by 25%.
2018-08-27 18:46:36 +10:00
bors
7625c03167 Auto merge of #53648 - japaric:thumb-lld, r=alexcrichton
change the default linker of the ARM Cortex-M targets

to rust-lld so users won't need an external linker to build programs

This will break nightly builds.

We discussed this within the embedded WG and with the embedded community in
rust-embedded/wg#160 and there was consensus in that this breaking change is
worthwhile and that we should do it now before it becomes impossible to do
without breaking stable builds.

We have already written an announcement (see rust-embedded/wg#196) that explains
the breakage and instructs the users how to fix their builds. The TL;DR is that
they can switch to the old behavior by passing the `-C linker` flag to rustc.
We'll post the announcement as soon as this change makes into nightly.

closes rust-embedded/wg#160

r? @alexcrichton
2018-08-27 06:30:10 +00:00
John Kåre Alsaker
0972658578 Update clippy 2018-08-27 06:48:15 +02:00
bors
3a2c603eea Auto merge of #53640 - alexcrichton:more-symbol-tweaks, r=michaelwoerister
rustc: Continue to tweak "std internal symbols"

In investigating [an issue][1] with `panic_implementation` defined in an
executable that's optimized I once again got to rethinking a bit about the
`rustc_std_internal_symbol` attribute as well as weak lang items. We've sort of
been non-stop tweaking these items ever since their inception, and this
continues to the trend.

The crux of the bug was that in the reachability we have a [different branch][2]
for non-library builds which meant that weak lang items (and std internal
symbols) weren't considered reachable, causing them to get eliminiated by
ThinLTO passes. The fix was to basically tweak that branch to consider these
symbols to ensure that they're propagated all the way to the linker.

Along the way I've attempted to erode the distinction between std internal
symbols and weak lang items by having weak lang items automatically configure
fields of `CodegenFnAttrs`. That way most code no longer even considers weak
lang items and they're simply considered normal functions with attributes about
the ABI.

In the end this fixes the final comment of #51342

[1]: https://github.com/rust-lang/rust/issues/51342#issuecomment-414368019
[2]: 35bf1ae257/src/librustc/middle/reachable.rs (L225-L238)
2018-08-27 01:28:52 +00:00
John Kåre Alsaker
bd04796d6e Move with_globals setup from run_compiler to run 2018-08-27 02:19:07 +02:00
Alex Crichton
0a2282e128 rustc: Continue to tweak "std internal symbols"
In investigating [an issue][1] with `panic_implementation` defined in an
executable that's optimized I once again got to rethinking a bit about the
`rustc_std_internal_symbol` attribute as well as weak lang items. We've sort of
been non-stop tweaking these items ever since their inception, and this
continues to the trend.

The crux of the bug was that in the reachability we have a [different branch][2]
for non-library builds which meant that weak lang items (and std internal
symbols) weren't considered reachable, causing them to get eliminiated by
ThinLTO passes. The fix was to basically tweak that branch to consider these
symbols to ensure that they're propagated all the way to the linker.

Along the way I've attempted to erode the distinction between std internal
symbols and weak lang items by having weak lang items automatically configure
fields of `CodegenFnAttrs`. That way most code no longer even considers weak
lang items and they're simply considered normal functions with attributes about
the ABI.

In the end this fixes the final comment of #51342

[1]: https://github.com/rust-lang/rust/issues/51342#issuecomment-414368019
[2]: 35bf1ae257/src/librustc/middle/reachable.rs (L225-L238)
2018-08-26 16:34:14 -07:00
bors
51777b188d Auto merge of #53715 - pietroalbini:missing-components-manifest, r=alexcrichton
Include missing tools in the manifest and mark them as unavailable

This PR changes the `build-manifest` tool to always include the missing components in the manifest, marking them as `available = false`. This blocks rustup from updating to a different nightly if the component is installed.

The code builds and _should_ be correct, but I don't know a way to test the changes locally.

r? @alexcrichton
cc @kennytm https://github.com/rust-lang-nursery/rustup.rs/issues/1486
2018-08-26 22:49:47 +00:00