Commit Graph

102669 Commits

Author SHA1 Message Date
clemencetbk
4e1eeb9a45 Add explanation message for E0641 2019-11-16 12:04:17 -05:00
Nadrieril
5b420a9dc4 Add regression test for issue 53820 2019-11-16 16:43:55 +00:00
Nadrieril
d93c1b320c Introduce new FixedLenSlice constructor
It is used in the case where a variable-length slice pattern is used to
match on an array of known size. This allows considering only those
entries in the array that are captured by one of the patterns.
As a side-effect, diagnostics improve a bit for those cases.
2019-11-16 16:43:20 +00:00
Nadrieril
c00ecfa8d2 Add some tests 2019-11-16 16:18:46 +00:00
Vadim Petrochenkov
8575743793 rustc_plugin: Remove Registry::register_attribute 2019-11-16 18:50:23 +03:00
Vadim Petrochenkov
8668c1a190 Add some more tests 2019-11-16 18:31:55 +03:00
Vadim Petrochenkov
808522894b expand: Stop marking derive helper attributes as known
Pass them through name resolution instead
2019-11-16 18:31:47 +03:00
Vadim Petrochenkov
a3126a5013 resolve: Introduce a new scope for derive helpers 2019-11-16 18:20:57 +03:00
Vadim Petrochenkov
c064630e77 resolve: Scope::DeriveHelpers -> Scope::DeriveHelpersCompat
These helpers are resolved before their respective derives through a kind of look ahead into future expansions.
Some of these will migrate to proper resolution, others will be deprecated.

```
#[trait_helper] // Deprecate
#[derive(Trait)]
#[trait_helper] // Migrate to proper resolution
```
2019-11-16 18:20:39 +03:00
Ralf Jung
5e115a25ca avoid some casts 2019-11-16 16:09:45 +01:00
bors
5f00849dc4 Auto merge of #66333 - mark-i-m:fix-rustc-guide-1, r=ehuss
Fix rustc guide again

r? @ehuss

Sorry, links change fast in this world...
2019-11-16 14:27:53 +00:00
Nadrieril
143fb4357f Tweak VarLenSlice subtraction 2019-11-16 13:33:46 +00:00
Ralf Jung
8952c8aa42 ICE on invalid MIR 2019-11-16 14:10:07 +01:00
Ralf Jung
09180d71fd make simd_size return a u64 2019-11-16 13:31:09 +01:00
Ralf Jung
44b68116c5 rename and move read_vector_ty 2019-11-16 13:15:45 +01:00
cosine
bd63c594c2 Use "field is never read" instead of "field is never used" 2019-11-16 07:12:37 -05:00
Ralf Jung
405866aaa3 re-add miri intrinsic ABI check 2019-11-16 11:44:32 +01:00
Ralf Jung
e8ff4656fc avoid linking errors 2019-11-16 09:37:45 +01:00
Ralf Jung
52d7246a93 miri panic_unwind: fix hack for SEH platforms 2019-11-16 09:29:26 +01:00
Magnus Ulimoen
e85f40cbd2 add missing 'static lifetime in docs
The example refers to a static lifetime parameter that can be elided.
This parameter is not included, meaning lifetime elision is not shown.
2019-11-16 08:40:35 +01:00
bors
9b0214d9c5 Auto merge of #66255 - ehuss:update-cc, r=alexcrichton
Update cc, git2, num_cpus.

This updates the `cc` crate, bringing in better parallel building support. Also updates `git2` which enables the parallel feature. (Note: I don't expect it will have a significant impact on build time, but seems good to update anyways.)

The main thorn is that `cc` gained knowledge about RISC-V architectures (https://github.com/alexcrichton/cc-rs/pull/428, https://github.com/alexcrichton/cc-rs/pull/429, https://github.com/alexcrichton/cc-rs/pull/430), but the builders on CI do not have the riscv C compiler installed. This means that bootstraps' cc detection was finding a C compiler that isn't installed, and fails.

The solution here is to override the cc detection to `false`. The C compiler isn't actually used on riscv platforms. AFAIK, the only location would be compiler_builtins, and it currently forces C support off (a533ae9c5a/build.rs (L49-L55)).

Other possible solutions:
- Add the override in cc_detect for riscv (or any "no-C" platform like wasm32 and nvptx)
- Install and use the appropriate c compiler. I tried this the `g++-riscv64-linux-gnu` package, but it failed missing some header file.

Closes #66232
2019-11-16 07:26:57 +00:00
bors
1d8b6ce89e Auto merge of #66453 - Centril:rollup-w1ohzxs, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #66350 (protect creation of destructors by a mutex)
 - #66407 (Add more tests for fixed ICEs)
 - #66415 (Add --force-run-in-process unstable option to libtest)
 - #66427 (Move the JSON error emitter to librustc_errors)
 - #66441 (libpanic_unwind for Miri: make sure we have the SEH lang items when needed)

Failed merges:

r? @ghost
2019-11-16 02:40:52 +00:00
Mazdak Farrokhzad
8444e1628c move DIAGNOSTICS usage to rustc_driver 2019-11-16 02:32:33 +01:00
bors
82161cda33 Auto merge of #66326 - Nadrieril:refactor-intrange, r=varkor
Refactor integer range handling in the usefulness algorithm

Integer range handling had accumulated a lot of debt. This cleans up a lot of it.

In particular this:
- removes unnecessary conversions between `Const` and `u128`, and between `Constructor` and `IntRange`
- clearly distinguishes between on the one hand ranges of integers that may or may not be matched exhaustively, and on the other hand ranges of non-integers that are never matched exhaustively and are compared using Const-based shenanigans
- cleans up some overly complicated code paths
- generally tries to be more idiomatic.

As a nice side-effect, I measured a 10% perf increase on `unicode_normalization`.

There's one thing that I feel remains to clean up: the [overlapping range check](https://github.com/rust-lang/rust/pull/64007), which is currently quite ad-hoc. But that is intricate enough that I'm leaving it out of this PR.

There's also one little thing I'm not sure I understand: can `try_eval_bits` fail for an integer constant value in that code ? What would that mean, and how do I construct a test case for this possibility ?
2019-11-15 23:28:50 +00:00
Wesley Wiser
9e1b210c6a Respond to review feedback 2019-11-15 18:18:50 -05:00
Wesley Wiser
3732b7acf1 [ConstProp] Avoid OOM crashes by not evaluating large Places
Fixes #66397
2019-11-15 18:18:50 -05:00
Wesley Wiser
d389f64cdb Fix spurious CI filures due to OOM
Fixes #66342
2019-11-15 18:18:50 -05:00
Eduard-Mihai Burtescu
d137e8e4a5 Update src/llvm-project to include rust-lang/llvm-project#27. 2019-11-15 22:56:40 +02:00
Steven Malis
56f9212b72 Change makefile back to python27. 2019-11-15 11:19:13 -08:00
Dylan MacKenzie
a1135cc946 Remove newtype for qualifs in rustc_metadata
We have a proper type for these now, so the wrapper is no longer
necessary.
2019-11-15 10:33:52 -08:00
Dylan MacKenzie
ea95e94f51 Fix nits from review 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
1e840f8893 Use mir::QualifSet to store qualifs 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
056edc0d48 Use a bespoke type for the result of mir_const_qualif 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
a4ce2011cb A Downcast is now reached when const-checking a for loop
I believe this occurs because the old checker stopped processing basic
blocks after a `SwitchInt`.
2019-11-15 10:33:52 -08:00
Dylan MacKenzie
9a2e53a7b3 Remove -Z flag for suppressing validation mismatch ICE 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
d1f0ef527c Add explanation of test for validation mismatch 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
8f5494b470 Silence miri unleashed warnings in test 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
c8156b9484 Remove unnecessary fmt::Debug bound 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
3d2bc50b51 Remove remaining validator mismatch code 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
7527766993 Move delay_span_bug into emit_error for if/loop 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
6d4e2042f9 Remove qualify_consts completely 2019-11-15 10:33:52 -08:00
Dylan MacKenzie
55da0c0368 Use new const-checker for mir_const_qualif
Now `mir_const_qualif` must be called for `static`s and `const fn`s as
well as `const`s since it is responsible for const-checking. We return
the qualifs in the return place for everything, even though they will
only be used for `const`s.
2019-11-15 10:33:32 -08:00
Dylan MacKenzie
973b16ab4b Enable standalone const-checking with Validator
Unlike the original pass, we check *every* non-cleanup basic block
instead of stopping at `SwitchInt`. We use the `is_cfg_cyclic` function
to check for loops unlike the original checker which could not differentiate
between true cycles and basic blocks with more than two predecessors.

The last three functions are all copied verbatim from `qualify_consts`.
2019-11-15 10:33:32 -08:00
Dylan MacKenzie
48811048f8 Allow Validator to get qualifs for the return place 2019-11-15 10:33:32 -08:00
Dylan MacKenzie
dbae15a41b Remove requires_sync 2019-11-15 10:33:32 -08:00
Dylan MacKenzie
1924cc8c7d Remove QUALIF_ERROR_BIT checking 2019-11-15 10:33:31 -08:00
Mazdak Farrokhzad
ae9a62633a
Rollup merge of #66441 - RalfJung:seh, r=oli-obk
libpanic_unwind for Miri: make sure we have the SEH lang items when needed

r? @oli-obk  @alexcrichton This is required to fix the Miri toolstate. Turns out rustc complains when doing codegen for MSVC and these lang items do not exist. For now `cfg(miri)` needs to still be able to codegen (we [plan to change that](https://github.com/rust-lang/miri/pull/1048#issuecomment-554108470) but that's a larger project requiring improvements to xargo and maybe also cargo; that should not block fixing the toolstate). Yes, this is a hack, but it is inside `cfg(miri)` so I hope this is okay.

Cc @Aaron1011
2019-11-15 18:02:04 +01:00
Mazdak Farrokhzad
ae0c8b5f09
Rollup merge of #66427 - Mark-Simulacrum:errors-json, r=Centril
Move the JSON error emitter to librustc_errors

This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself.

Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).
2019-11-15 18:02:02 +01:00
Mazdak Farrokhzad
4e6e1eccf1
Rollup merge of #66415 - tmandry:force-test-in-process, r=alexcrichton
Add --force-run-in-process unstable option to libtest

When running tests with `-Zpanic_abort_tests`, it's sometimes desirable to fall back to the old behavior of only running tests in-process. This comes in handy if the system process launcher is unavailable, or the test code somehow expects all tests to be run in the same process.

For example, in Fuchsia we have unit tests that actually test the process launcher itself, in which case we can't use the process launcher to run the tests :).

r? @alexcrichton
cc @cramertj,@petrhosek
2019-11-15 18:02:01 +01:00
Mazdak Farrokhzad
e3c78d549e
Rollup merge of #66407 - JohnTitor:add-ice-tests, r=Centril
Add more tests for fixed ICEs

Closes #36122 (fixed in 1.20.0)
Closes #58094 (fixed in #66054)
Also, fix mistaken test case, from #30904 to #30906 (cc @eddyb)

r? @Centril
2019-11-15 18:01:59 +01:00