Commit Graph

102742 Commits

Author SHA1 Message Date
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
Mazdak Farrokhzad
6e5a4c1385
Rollup merge of #66350 - hermitcore:hermit, r=rkruppe
protect creation of destructors by a mutex

- add on HermitCore an additional lock to protect static data
2019-11-15 18:01:58 +01:00
Nadrieril
694a511df5 Apply suggestions from code review 2019-11-15 17:00:38 +00:00
Nadrieril
cde9808eaa Add regression test 2019-11-15 16:55:38 +00:00
Nadrieril
addd8a9003 Apply suggestions from code review 2019-11-15 16:55:38 +00:00
Nadrieril
b679e77f04 Factor out IntRange::is_subrange 2019-11-15 16:55:38 +00:00
Nadrieril Feneanar
9165dd056b Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-15 16:55:37 +00:00
Nadrieril
c38aad4f4b Add test for failing try_eval_bits 2019-11-15 16:55:37 +00:00
Nadrieril
d31b4c3750 Remove fishy condition
That condition was leftover from a refactor, and was probably not
intended. In fact it can't trigger: it would require a ConstantValue of
an integral type for which `try_eval_bits` fails. But since we only
apply `subtract_ctors` to the output of `all_ctors`, this won't happen.
2019-11-15 16:55:34 +00:00
Nadrieril
e47d631ca0 Malformed range patterns can't happen thanks to E0030 2019-11-15 16:49:42 +00:00
Nadrieril
3e5aadc350 Remove unnecessary data from ConstantValue/ConstantRange 2019-11-15 16:49:41 +00:00
Nadrieril
f674f89e93 Store Const directly in ConstantRange 2019-11-15 16:45:55 +00:00
Nadrieril
0192124202 Make should_treat_range_exhaustively a method 2019-11-15 16:44:34 +00:00
Nadrieril
d1642f1eb5 Inline now-trivial IntRange::from_ctor 2019-11-15 16:44:33 +00:00
Nadrieril
aadd5e5263 Factor out getting the boundaries of an IntRange 2019-11-15 16:42:10 +00:00
Nadrieril
84784dd68e Eagerly convert ranges to IntRange
That way no `ConstantRange` or `ConstantValue` ever needs to be
converted to `IntRange`.
2019-11-15 16:42:10 +00:00
Nadrieril
6b8bfefa00 Add IntRange::to_pat and use it instead of custom display() 2019-11-15 16:42:08 +00:00
Yuki Okushi
614abe48b0 Fix nll test 2019-11-16 01:40:59 +09:00
Nadrieril
4232816be9 formatting 2019-11-15 16:39:56 +00:00
Nadrieril
f93a70063c Introduce IntRange constructor 2019-11-15 16:39:31 +00:00
Nadrieril
1909e3f2bf Constructor::display was only needed for displaying IntRange
I'm planning to stop using `ConstantRange`/`ConstantValue` for integral
types, so going through `Constructor` will soon not be relevant.
2019-11-15 16:14:34 +00:00
Nadrieril
75a50886aa Avoid converting through Constructor when subtracting ranges 2019-11-15 16:14:34 +00:00
Nadrieril
c6c862574d Special-case subtracting from a range if that range is not an IntRange 2019-11-15 16:14:34 +00:00
Nadrieril
6de7afdf95 Prefer IntRange::into_ctor to range_to_ctor 2019-11-15 16:14:34 +00:00
Nadrieril
0a186103ae Move range exhaustiveness check to IntRange::intersection
Only IntRange should need to worry about range exhaustiveness really.
2019-11-15 16:14:34 +00:00
Nadrieril
81db2ee902 Special-case range inclusion when the range is integral but non-exhaustive 2019-11-15 16:14:34 +00:00
Nadrieril
f3752ee5d5 Cleanup constructor_covered_by_range 2019-11-15 16:14:34 +00:00
Nadrieril
8c1835dc6e IntRange::from_pat is redundant with pat_constructors 2019-11-15 16:14:34 +00:00
Nadrieril
34ad52e84f pat_constructor does not need pcx anymore 2019-11-15 16:14:34 +00:00