Commit Graph

99753 Commits

Author SHA1 Message Date
Nicholas Nethercote
22943ee27c Remove unnecessary uses of ObligationForest::scratch.
They don't help performance at all, and just complicate things.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
ea726501e1 Use filter and map in to_errors. 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
7130e6c073 Tweak the control flow in process_obligations(). 2019-09-30 05:23:07 +10:00
Nicholas Nethercote
85a56cbd88 Inline mark_as_waiting_from.
It has a single call site, and the code is easier to read this way.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
4a7fb8b13a Rename node_index as index.
For consistency with other variables in this file.
2019-09-30 05:23:07 +10:00
Nicholas Nethercote
3b506d9694 Remove NodeState::OnDfsStack.
It's not necessary; cycles (which are rare) can be detected by looking
at the node stack.

This change speeds things up slightly, as well as simplifying the code a
little.
2019-09-30 05:23:07 +10:00
bors
06c68947ad Auto merge of #64158 - tmandry:libtest-panic-abort, r=alexcrichton
panic=abort support in libtest

Add experimental support for tests compiled with panic=abort. Enabled with `-Z panic_abort_tests`.

r? @alexcrichton
cc @cramertj
2019-09-29 13:53:08 +00:00
bors
d046ffddc4 Auto merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, r=nikomatsakis
Bugfix/rfc 2451 rerebalance tests

r? @nikomatsakis

Fixes #64412
Depends/Contains on #64414

cc #55437 and #63599
2019-09-29 09:52:58 +00:00
bors
fe2f7e0e53 Auto merge of #64886 - Centril:rollup-30dqh8j, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #63492 (Remove redundancy from the implementation of C variadics.)
 - #64589 (Differentiate AArch64 bare-metal targets between hf and non-hf.)
 - #64799 (Fix double panic when printing query stack during an ICE)
 - #64824 (No StableHasherResult everywhere)
 - #64884 (Add pkg-config to dependency list if building for Linux on Linux)

Failed merges:

r? @ghost
2019-09-29 06:08:50 +00:00
Mazdak Farrokhzad
0d4afa164b
Rollup merge of #64884 - jakevossen5:master, r=Mark-Simulacrum
Add pkg-config to dependency list if building for Linux on Linux

I got this message when building from source on Ubuntu:

```
It looks like you're compiling on Linux and also targeting Linux. Currently this
requires the `pkg-config` utility to find OpenSSL but unfortunately `pkg-config`
could not be found. If you have OpenSSL installed you can likely fix this by
installing `pkg-config`.
```

I feel like it would be a better experience to show this in the dependencies instead of having to run into this issue.
2019-09-29 04:36:04 +02:00
Mazdak Farrokhzad
d7d7c2fce2
Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, r=michaelwoerister
No StableHasherResult everywhere

This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping.

This is done for two reasons:
 * we should avoid false "generic" dependency on the result of StableHasher
     * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too.
 * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-29 04:36:02 +02:00
Mazdak Farrokhzad
b30d9beafb
Rollup merge of #64799 - Aaron1011:fix/double-panic, r=Mark-Simulacrum
Fix double panic when printing query stack during an ICE

On the latest nightly, any call to `bug` or `span_bug` will result in two panics - the first one as a normal result of calling `bug` / `span_bug`, and the second as a result of trying to print the query stack from the panic handler. This is caused by the query-printing code attempting to acquire a lock on `HandlerInnder`, which is still being held by `bug`.

This PR moves the actual panic out of `HandlerInner`, into `Handler`. This allows us to release the lock on `HandlerInner` before triggering the panic, ensuring that the panic handler will be able to acquire the lock if necessary.
2019-09-29 04:36:01 +02:00
Mazdak Farrokhzad
a874c659c8
Rollup merge of #64589 - andre-richter:aarch64_bare_metal, r=Amanieu
Differentiate AArch64 bare-metal targets between hf and non-hf.

CC @parched, kindly request you to review.

~~Note: This change breaks code that uses the target `aarch64-unknown-none` for the sake of clearer naming as discussed in the links posted below. A search on github reveals that code using `aarch64-unknown-none` is almost exclusively forked from our embedded WG's OS tutorials repo at https://github.com/rust-embedded/rust-raspi3-OS-tutorials, for which the target was originally created.~~

~~I will adapt this repo to the new target name asap once this PR would go upstream. The minor annoyance for the forks to break temporarily should be acceptable for the sake of introducing a better differentiation now before it is too late.
Also, the break would only happen upon updating the toolchain, giving the user a good hint at what has happened.~~

---------- Patch commit message:
Following up on [1] and [2], this PR adds differntiation for aarch64 bare-metal
targets between versions with and without floating point enabled.

This streamlines the target naming with other existing ARM targets and provides
the user clear indication if he is getting float or non-float for his bare-metal
target.

[1] https://github.com/rust-lang/rust/pull/60135#issuecomment-485851356
[2] https://github.com/rust-embedded/wg/issues/230

Closes: rust-embedded/wg#230
2019-09-29 04:35:59 +02:00
Mazdak Farrokhzad
37333b5131
Rollup merge of #63492 - eddyb:cvarargs, r=nagisa,matthewjasper
Remove redundancy from the implementation of C variadics.

This cleanup was first described in https://github.com/rust-lang/rust/issues/44930#issuecomment-497163539:

* AST doesn't track `c_variadic: bool` anymore, relying solely on a trailing `CVarArgs` type in fn signatures
* HIR doesn't have a `CVarArgs` anymore, relying solely on `c_variadic: bool`
  * same for `ty::FnSig` (see tests for diagnostics improvements from that)
  * `{hir,mir}::Body` have one extra argument than the signature when `c_variadic == true`
  * `rustc_typeck` and `rustc_mir::{build,borrowck}` need to give that argument the right type (which no longer uses a lifetime parameter, but a function-internal scope)
* `rustc_target::abi::call` doesn't need special hacks anymore (since it never sees the `VaListImpl` now, it's all inside the body)

r? @nagisa / @rkruppe cc @dlrobertson @oli-obk
2019-09-29 04:35:58 +02:00
bors
0bbab7d99d Auto merge of #64470 - ecstatic-morse:split-promotion-and-validation, r=eddyb,oli-obk
Implement dataflow-based const validation

This PR adds a separate, dataflow-enabled pass that checks the bodies of `const`s, `static`s and `const fn`s for [const safety](https://github.com/rust-rfcs/const-eval/blob/master/const.md). This is based on my work in #63860, which tried to integrate into the existing pass in [`qualify_consts.rs`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs). However, the resulting pass was even more unwieldy than the original. Unlike its predecessor, this PR is designed to be combined with #63812 to replace the existing pass completely.

The new checker lives in [`librustc_mir/transform/check_consts`](https://github.com/ecstatic-morse/rust/tree/split-promotion-and-validation/src/librustc_mir/transform/check_consts).

[`qualifs.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/qualifs.rs) contains small modifications to the existing `Qualif` trait and its implementors, but is mostly unchanged except for the removal of `IsNotPromotable` and `IsNotImplicitlyPromotable`, which are only necessary for promotion.

[`resolver.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/resolver.rs) contains the dataflow analysis used to propagate qualifs between locals.

Finally, [`validation.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/validation.rs) contains a refactored version of the existing [`Visitor`](ca3766e2e5/src/librustc_mir/transform/qualify_consts.rs (L1024)) in `qualfy_consts.rs`. All errors have been associated with a `struct` to make [comparison with the existing pass](1c19f2d540/src/librustc_mir/transform/qualify_consts.rs (L1006)) simple.

The existing validation logic in [`qualify_consts`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs) has been modified to allow it to run in parallel with the new validator. If [`use_new_validator`](https://github.com/rust-lang/rust/pull/64470/files#diff-c2552a106550d05b69d5e07612f0f812R950) is not set, the old validation will be responsible for actually generating the errors, but those errors can be compared with the ones from the new validator.
2019-09-29 02:33:15 +00:00
bors
b61e694339 Auto merge of #64883 - Centril:rollup-uehjt63, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #64131 (data_structures: Add deterministic FxHashMap and FxHashSet wrappers)
 - #64387 (Fix redundant semicolon lint interaction with proc macro attributes)
 - #64678 (added more context for duplicate lang item errors (fixes #60561))
 - #64763 (Add E0734 and its long explanation)
 - #64793 (Fix format macro expansions spans to be macro-generated)
 - #64837 (Improve wording in documentation of MaybeUninit)
 - #64852 (Print ParamTy span when accessing a field (#52082))
 - #64875 (Upgrade async/await to "used" keywords.)
 - #64876 (Fix typo in intrinsics op safety)
 - #64880 (Slice docs: fix typo)

Failed merges:

r? @ghost
2019-09-28 22:42:58 +00:00
Tyler Mandry
3f0254e3cf Put panic=abort test support behind -Z panic_abort_tests 2019-09-28 13:52:18 -07:00
Tyler Mandry
88376842a0 Add test for libtest panic=abort mode 2019-09-28 13:52:18 -07:00
Tyler Mandry
8ae1ec60cc Spawn one subprocess per unit test when panic=abort 2019-09-28 13:52:18 -07:00
Tyler Mandry
76b12bd8fd Support run-fail ui tests 2019-09-28 13:50:52 -07:00
=
ea347b619e
linux -> Linux 2019-09-28 14:18:29 -06:00
=
b3907fd3c6
add pkg-config to dependencies 2019-09-28 14:17:09 -06:00
Mazdak Farrokhzad
46526718b1
Rollup merge of #64880 - llogiq:slice-docs, r=Centril
Slice docs: fix typo

With #64703, I introduced a typo. Here is the fix. Sorry for the inconvenience.
2019-09-28 22:12:11 +02:00
Mazdak Farrokhzad
1c2dd143f3
Rollup merge of #64876 - vertexclique:vcq/fix-fn-name-intrinsic-op-unsafety, r=varkor
Fix typo in intrinsics op safety

Title pretty much sums up.
2019-09-28 22:12:10 +02:00
Mazdak Farrokhzad
787829d54a
Rollup merge of #64875 - ehuss:async-await-reserved, r=estebank
Upgrade async/await to "used" keywords.

AFAIK, this only affects error messages, removing the word "reserved".

Closes #64853
2019-09-28 22:12:08 +02:00
Mazdak Farrokhzad
6145757a26
Rollup merge of #64852 - Baranowski:param_note_52082, r=estebank
Print ParamTy span when accessing a field (#52082)
2019-09-28 22:12:07 +02:00
Mazdak Farrokhzad
69a3009cbf
Rollup merge of #64837 - nliberg:patch-2, r=Centril
Improve wording in documentation of MaybeUninit

Changes

> variables are properly initialized **at** their respective type

into

> variables are properly initialized **as** their respective type
2019-09-28 22:12:06 +02:00
Mazdak Farrokhzad
d9168e4cfa
Rollup merge of #64793 - immunant:format_spans, r=matthewjasper
Fix format macro expansions spans to be macro-generated

New Exprs generated as part of the format macro expansion should get the macro
expansion span with an expansion context, rather than the span of the format string
which does not.
2019-09-28 22:12:04 +02:00
Mazdak Farrokhzad
01075d8f6b
Rollup merge of #64763 - GuillaumeGomez:long-err-explanation-E0734, r=estebank
Add E0734 and its long explanation

Part of https://github.com/rust-lang/rust/issues/61137
2019-09-28 22:12:02 +02:00
Mazdak Farrokhzad
05881d046e
Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasper
added more context for duplicate lang item errors (fixes #60561)

Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one.

It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging.

I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way.
2019-09-28 22:12:01 +02:00
Mazdak Farrokhzad
55a3eada4d
Rollup merge of #64387 - nathanwhit:redundant-semi-fix, r=varkor
Fix redundant semicolon lint interaction with proc macro attributes

Fixes #63967 and fixes #63947, both of which were caused by the lint's changes to the parser interacting poorly with proc macro attributes and causing span information to be lost

r? @varkor
2019-09-28 22:11:59 +02:00
Mazdak Farrokhzad
b18d8612c8
Rollup merge of #64131 - shivan1b:deterministic-fxhashmap, r=Mark-Simulacrum
data_structures: Add deterministic FxHashMap and FxHashSet wrappers

StableMap
A wrapper for FxHashMap that allows to `insert`, `remove`, `get`, `get_mut` and convert a hashmap into a sorted vector using the method `into_sorted_vector` but no iteration support.

StableSet
A wrapper for FxHashSet that allows to `insert`, `remove`, `get` and convert a hashset into a sorted vector using the method `into_sorted_vector` but no iteration support.

Addresses issue #63713
2019-09-28 22:11:58 +02:00
Andre Bogus
e77dfa27ca Slice docs: fix typo 2019-09-28 21:02:51 +02:00
Mahmut Bulut
c666bd5570
Fix typo in intrinsics op safety 2019-09-28 18:24:05 +02:00
Eric Huss
f6ceccea93 Upgrade async/await to "used" keywords. 2019-09-28 09:15:06 -07:00
bors
488381ce9e Auto merge of #64419 - wesleywiser:const_prop_use_ecx, r=oli-obk
Deduplicate some code between miri and const prop

r? @oli-obk
2019-09-28 15:54:12 +00:00
Mark Rousskov
14a5aefb01 Switch over all StableHash impls to new format 2019-09-28 11:47:36 -04:00
Mark Rousskov
f60e58e575 StableHasher does not need to be generic over the Result type 2019-09-28 11:47:15 -04:00
Eduard-Mihai Burtescu
057f23d3dd rustc_codegen_ssa: remove redundant va_list_ref field from FunctionCx. 2019-09-28 17:39:00 +03:00
Eduard-Mihai Burtescu
a88d181a02 rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures. 2019-09-28 17:39:00 +03:00
Eduard-Mihai Burtescu
7683d1c3aa rustc: don't store a lifetime in hir::TyKind::CVarArgs. 2019-09-28 17:39:00 +03:00
Eduard-Mihai Burtescu
8a9d775888 syntax: don't keep a redundant c_variadic flag in the AST. 2019-09-28 17:38:59 +03:00
Dylan MacKenzie
0bf1a80b32 Rename sty to kind
Picks up changes made in #64513
2019-09-28 07:20:12 -07:00
Dylan MacKenzie
ff4158abf2 Bless miri unleashed output 2019-09-28 07:06:52 -07:00
Dylan MacKenzie
f2e7faf153 Revert "Use conservative, type-based qualifcation for statics"
This reverts commit ac7a343cef8287427a98b9210cdb1a772486be10.
2019-09-28 07:06:52 -07:00
Dylan MacKenzie
8bfe82bfad Correct IndirectlyMutableLocals docs 2019-09-28 07:06:52 -07:00
Dylan MacKenzie
a302055caa Mask results from flow-sensitive resolver with in_any_value_of_ty
We relied previously on the caller (e.g. `Q::in_operand`) to ignore
`Local`s that were indirectly mutable (and thus assumed to be
qualified). However, it's much clearer (and more efficient) to do this
in the resolver itself.

This does not yet remove the masking done in `Q::in_operand` and others
for safety's sake, although I believe that should now be possible.
2019-09-28 07:06:52 -07:00
Dylan MacKenzie
ff6faabda7 Add description for every module in check_consts 2019-09-28 07:06:52 -07:00
Dylan MacKenzie
713ec152fc Share IndirectlyMutableLocals results via reference 2019-09-28 07:06:52 -07:00
Dylan MacKenzie
1a14d17c4d Require fmt::Debug to implement NonConstOp 2019-09-28 07:06:52 -07:00