Commit Graph

75656 Commits

Author SHA1 Message Date
Andrew Cann
32ddb30715 Fix version number 2018-03-14 12:44:51 +08:00
Andrew Cann
a9fc3901b0 stabilise feature(never_type)
Replace feature(never_type) with feature(exhaustive_patterns).
feature(exhaustive_patterns) only covers the pattern-exhaustives checks
that used to be covered by feature(never_type)
2018-03-14 12:44:51 +08:00
Andrew Cann
9b15ddb29e remove defaulting to unit
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
2018-03-14 12:44:51 +08:00
bors
fab632f975 Auto merge of #48684 - GuillaumeGomez:put-back-ui-json-check, r=petrochenkov
Put back ui json check

r? @petrochenkov
2018-03-14 01:40:42 +00:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Guillaume Gomez
8c75e18e5d test for putting back check on json 2018-03-14 00:52:17 +01:00
Peter Hrvola
2f2e17341c Speed up SVH computation by using Fingerprint::combine()
Fix #47297

r? @michaelwoerister
2018-03-14 00:10:57 +01:00
Alex Butler
63f654a495
fix #48816 don't print help on indirect compiler ICE 2018-03-13 22:26:29 +00:00
Jeremy Fitzhardinge
6d534d5880 Clarify usage message for --remap-path-prefix. 2018-03-13 13:26:07 -07:00
bors
c29085761b Auto merge of #48735 - 1011X:master, r=alexcrichton
Move ascii::escape_default to libcore

As requested in #46409, the `ascii::escape_default` method has been added to the core library. All I did was copy over the `std::ascii` module file, remove the (redundant) `AsciiExt` trait, and change some of the documentation to match. None of the tests were changed.

I wasn't sure how to handle the annotations. For `EscapeDefault` and `escape_default()`, I changed them to `#[unstable(feature = "core_ascii", issue = "46409")]`. Is that alright? Or should I leave them as they were?
2018-03-13 19:50:13 +00:00
Michael Lamparski
dc96467e22 Fix ICE on malformed plugin attributes 2018-03-13 15:23:36 -04:00
Michael Lamparski
decbb83f9e Add test for issue 48941
A broken test to be fixed in the next commit.
2018-03-13 15:23:36 -04:00
bobtwinkles
52bb99dcc7 Move 48070 test to ui 2018-03-13 14:52:11 -04:00
bobtwinkles
21a9770d38 Adds a test for #48070
Resolves #48070.
The bug itself was fixed by #48770, but that PR didn't add a test for it.
2018-03-13 14:21:51 -04:00
gnzlbg
01cc5b3e19 add intrinsics for portable packed simd vector reductions 2018-03-13 16:47:48 +01:00
Alex Crichton
0e0f74bcf9 rustc: Embed LLVM bitcode by default on iOS
This commit updates rustc to embed bitcode in each object file generated by
default when compiling for iOS. This was determined in #35968 as a step
towards better compatibility with the iOS toolchain, so let's give it a spin and
see how it turns out!

Note that this also updates the `cc` dependency which should propagate this
change of embedding bitcode for C dependencies as well.
2018-03-13 08:29:19 -07:00
Alex Crichton
1999a3fb41 rustbuild: Tweak CFLAGS to various libstd pieces
* Pass `opt_level(2)` when calculating CFLAGS to get the right flags on iOS
* Unconditionally pass `-O2` when compiling libbacktrace

This should...

Close #48903
Close #48906
2018-03-13 08:28:27 -07:00
bors
8c4ff22a2d Auto merge of #48411 - nikomatsakis:chalkify-canonical-query-mir, r=eddyb
introduce canonical queries, use for normalization and dropck-outlives

This branch adds in the concept of a **canonicalized trait query** and uses it for three specific operations:

- `infcx.at(cause, param_env).normalize(type_foldable)`
    - normalizes all associated types in `type_foldable`
- `tcx.normalize_erasing_regions(param_env, type_foldable)`
    - like normalize, but erases regions first and in the result; this leads to better caching
- `infcx.at(cause, param_env).dropck_outlives(ty)`
    - produces the set of types that must be live when a value of type `ty` is dropped
    - used from dropck but also NLL outlives

This is a kind of "first step" towards a more Chalk-ified approach. It leads to a **big** speedup for NLL, which is basically dominated by the dropck-outlives computation. Here are some timing measurements for the `syn` crate (pre-branch measurements coming soon):

| Commit | NLL disabled | NLL enabled |
| ------- | --- | --- |
| Before my branch | 5.43s | 8.99s |
| After my branch | 5.36s | 7.25s |

(Note that NLL enabled still does *all the work* that NLL disabled does, so this is not really a way to compare the performance of NLL versus the AST-based borrow checker directly.) Since this affects all codepaths, I'd like to do a full perf run before we land anything.

Also, this is not the "final point" for canonicalization etc. I think canonicalization can be made substantially faster, for one thing. But it seems like a reasonable starting point for a branch that's gotten a bit larger than I would have liked.

**Commit convention:** First of all, this entire branch ought to be a "pure refactoring", I believe, not changing anything about external behavior. Second, I've tagged the most important commits with `[VIC]` (very important commit), so you can scan for those. =)

r? @eddyb
2018-03-13 15:24:45 +00:00
Niko Matsakis
17c4103f3f add "text" sections for things that seem likely to be a problem 2018-03-13 11:22:08 -04:00
Niko Matsakis
29dc902beb remove dead code 2018-03-13 11:22:08 -04:00
Niko Matsakis
d326738586 replace inline docs with references to rustc-guide 2018-03-13 11:22:08 -04:00
Niko Matsakis
fc04c41a40 add a debug assertion that only outlives-oblig. result from norm. 2018-03-13 11:22:08 -04:00
Niko Matsakis
6288faa3a3 trans_apply_param_substs => subst_and_normalize_erasing_regions
Consolidate `trans_apply_param_substs` and
`trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-13 11:22:08 -04:00
Niko Matsakis
0d17f95465 short-circuit work when instantiating query responses
Also, perform substitution in smaller parts.
2018-03-13 11:22:08 -04:00
Niko Matsakis
03c5428be3 short-circuit dropck_outlives for simple cases 2018-03-13 11:22:07 -04:00
Niko Matsakis
1e4e632ad8 add regression tests for various MIR bugs that get fixed
Fixes #31567
Fixes #47470
Fixes #48132
Fixes #48179
2018-03-13 11:22:07 -04:00
Niko Matsakis
36e5092dfa add some debug output 2018-03-13 11:22:07 -04:00
Niko Matsakis
0a2ac85e3f move drain_fulfillment_cx_or_panic to be private to traits::trans 2018-03-13 11:22:07 -04:00
Niko Matsakis
e4728e494e transition various normalization functions to the new methods
In particular:

- `fully_normalize_monormophic_ty` => `normalize_erasing_regions`
- `normalize_associated_type_in_env` => `normalize_erasing_regions`
- `fully_normalize_associated_types_in` => `normalize_erasing_regions`
- `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13 11:22:07 -04:00
Niko Matsakis
211d9ad7db introduce tcx.normalize_erasing_regions(..) operaton [VIC] 2018-03-13 11:22:07 -04:00
Niko Matsakis
ca87d24467 introduce infcx.at(..).dropck_outlives(..) operaton [VIC]
Backed by a canonicalized query. This computes all the types/regions that need
to be live when the destructor runs (i.e., that the dtor may access).
2018-03-13 11:22:07 -04:00
Niko Matsakis
3a50b41da4 introduce infcx.at(..).normalize(..) operation [VIC]
It is backed by the new `normalize_projection_ty` query, which uses
canonicalization.
2018-03-13 11:22:05 -04:00
Oliver Schneider
0d88db1693
Reuse the query caching infrastructure for const eval 2018-03-13 16:21:54 +01:00
Niko Matsakis
8c024fdafb in Foo(X) dep-nodes, allow X to be a ty not a tt
Before, the identifier `X` was also used when generating a pattern
to match against the dep-node. So `Foo(DefId)` would generate a match
pattern like:

    match foo {
        Foo(DefId) => ...
    }

This does not scale to more general types like `&'tcx
Ty<'tcx>`. Therefore, we now require *exactly one* argument (the macro
was internally tupling anyway, and no actual nodes use more than one
argument), and then we can generate a fixed pattern like:

    match foo {
        Foo(arg) => ...
    }

Huzzah. (Also, hygiene is nice.)
2018-03-13 11:21:31 -04:00
Niko Matsakis
993c1488cc add canonicalize method to InferCtxt [VIC] 2018-03-13 11:21:31 -04:00
Niko Matsakis
80b4c45ee4 change ParamEnv::and to sometimes keep the environment [VIC]
In general, we've been moving towards a semantics where you can have
contradictory where-clauses, and we try to honor them.  There are
already existing run-pass tests where we take that philosophy as
well (e.g., `compile-fail/issue-36839.rs`). The current behavior of
`and`, where it strips the environment, breaks that code.
2018-03-13 11:21:31 -04:00
Niko Matsakis
64d4ed300b move ParamEnv methods from ty/util to ty/mod 2018-03-13 11:21:30 -04:00
Niko Matsakis
6d0f9319df refactor ParamEnv::empty(Reveal) into two distinct methods
- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-13 11:21:30 -04:00
Niko Matsakis
1d377d10a1 add handy helper for Cell<usize>, used for perf stats 2018-03-13 11:21:30 -04:00
Niko Matsakis
652b3b71f3 random reformatting 2018-03-13 11:21:30 -04:00
Niko Matsakis
0037cca2f7 comment the purpose of TransNormalize 2018-03-13 11:21:30 -04:00
Niko Matsakis
d0aff859d5 make regions "traceable" so you can do infcx.at(..).eq(r1, r2) 2018-03-13 11:21:30 -04:00
Niko Matsakis
10ae216b75 fix typo in comment 2018-03-13 11:21:30 -04:00
Niko Matsakis
5ddcd09b53 add TypeRelation and Lift impls for Kind 2018-03-13 11:21:29 -04:00
Niko Matsakis
23837c1901 improve TypeFoldable/Lift macros and make a bunch of stuff use them
Improvements:

- Use Clone not Copy for the "simple cases"
- Separate TypeFoldable and Lift for the "simple cases"
- Support generics type parameters
- Support named fields in enum variants
- etc
2018-03-13 11:21:29 -04:00
Niko Matsakis
f873c1e2db require Lifted types to outlive 'tcx 2018-03-13 11:21:29 -04:00
Oliver Schneider
af099bb240
Cache const eval queries 2018-03-13 15:57:59 +01:00
Alex Crichton
04442af18b rustc: Don't invoke lld with an @-file
Looks like LLD doesn't support this yet, so always try to use the OS before we
fall back to using `@`
2018-03-13 07:54:03 -07:00
Simon Sapin
4897935e86 Add hexadecimal formatting of integers with fmt::Debug
This can be used for integers within a larger types which implements Debug
(possibly through derive) but not fmt::UpperHex or fmt::LowerHex.

```rust
assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]");
assert!(format!("{:02X?}", b"Foo\0") == "[46, 6F, 6F, 00]");
```

RFC: https://github.com/rust-lang/rfcs/pull/2226
2018-03-13 14:53:06 +01:00
Anthony Defranceschi
a48224b9ac Add a section for using assertions into doc tests.
See #47945.
2018-03-13 14:20:57 +01:00