Commit Graph

102669 Commits

Author SHA1 Message Date
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
Nadrieril
3531c52bfe Factor out range construction in all_constructors 2019-11-15 16:14:32 +00:00
Nadrieril
8f7ba7a058 Clarify conditions for exhaustive integer range matching 2019-11-15 16:01:03 +00:00
Nadrieril
c75685bef6 Note link between apply/specialize/arity functions 2019-11-15 15:38:31 +00:00
Ralf Jung
065e1b8d8a more comment 2019-11-15 15:57:01 +01:00
Yuki Okushi
09f0ee51c9 Apply suggestion from Centril
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-15 23:54:52 +09:00
Yuki Okushi
564c78a698 Fix test case and issue number 2019-11-15 23:54:52 +09:00
Yuki Okushi
74329bf619 Add test for issue-58094 2019-11-15 23:54:52 +09:00
Yuki Okushi
4e621a8b0c Add test for issue-36122 2019-11-15 23:54:52 +09:00
Tyler Mandry
d252ba35d4 Improve error message for tests with panic=abort 2019-11-15 05:52:06 -08:00
Tyler Mandry
b8dca6c827 Add --force-run-in-process unstable libtest option 2019-11-15 05:52:06 -08:00
Mark Rousskov
c31a8754e3 Move JSON emitter to rustc_errors 2019-11-15 08:45:49 -05:00
Mark Rousskov
3f93ffc333 Remove SourceMapper trait
SourceMap is now in the root of all rustc-specific crates, syntax_pos,
so there's no need for the trait object to decouple the dependencies
between librustc_errors and libsyntax as was needed previously.
2019-11-15 08:45:43 -05:00
bors
1bd30ce2aa Auto merge of #66449 - tmandry:rollup-3p1t0sb, r=tmandry
Rollup of 4 pull requests

Successful merges:

 - #66197 (Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering)
 - #66429 (Add a regression test for #62524)
 - #66435 (Correct `const_in_array_repeat_expressions` feature name)
 - #66443 (Port erased cleanup)

Failed merges:

r? @ghost
2019-11-15 13:45:25 +00:00
Tyler Mandry
0f2f03fbd1
Rollup merge of #66443 - GuillaumeGomez:port-erased-cleanup, r=Mark-Simulacrum
Port erased cleanup

Just realised that the changes I made in #65965 were removed after the move of all error codes so here it is. I made them into separate commits to make the history look better this time.

r? @Mark-Simulacrum
2019-11-15 14:44:52 +01:00
Tyler Mandry
d99026e891
Rollup merge of #66435 - JohnTitor:fix-spelling, r=Centril
Correct `const_in_array_repeat_expressions` feature name

Fixes #66433

r? @estebank
2019-11-15 14:44:50 +01:00
Tyler Mandry
c6cdbe9a3e
Rollup merge of #66429 - guanqun:add-unit-test, r=Centril
Add a regression test for #62524

Closes #62524
2019-11-15 14:44:48 +01:00
Tyler Mandry
c5bb2ec0dd
Rollup merge of #66197 - Centril:transparent-ast, r=varkor
Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering

We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions.  This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported.

r? @varkor
2019-11-15 14:44:47 +01:00
Mark Rousskov
942f0a6f7a Move SourceMap to syntax_pos
This does not update the use sites or delete the now unnecessary
SourceMapper trait, to allow git to interpret the file move as a rename
rather than a new file.
2019-11-15 08:38:31 -05:00
Mark Rousskov
e1a87ca17a Move FatalError to syntax_pos
This is a bit unfortunate, but code needs to be able to fatally error
early on (in particular, syntax_pos after we move SourceMap there). It's
also a tiny bit of code, which means it's ultimately not that bad.
2019-11-15 08:21:23 -05:00
Guillaume Gomez
f9fdc380c7 Clean up E0025, E0034, E0044, E0046 and E0053 2019-11-15 13:24:47 +01:00
Guillaume Gomez
041c9f6f48 Clean up E0054 2019-11-15 13:24:47 +01:00
Guillaume Gomez
1a3c8c8964 Clean up E0050 2019-11-15 13:24:47 +01:00