- 13 3月, 2018 40 次提交
-
-
由 bors 提交于
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
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
Consolidate `trans_apply_param_substs` and `trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
-
由 Niko Matsakis 提交于
Also, perform substitution in smaller parts.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
Fixes #31567 Fixes #47470 Fixes #48132 Fixes #48179
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
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`
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
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).
-
由 Niko Matsakis 提交于
It is backed by the new `normalize_projection_ty` query, which uses canonicalization.
-
由 Niko Matsakis 提交于
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.)
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
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.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
- `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
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
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
-
由 Niko Matsakis 提交于
-
由 bors 提交于
Update the rls-rustc package Should hopefully fix compiling the rls!
-
由 bors 提交于
Rollup of 13 pull requests - Successful merges: #48201, #48705, #48725, #48824, #48877, #48880, #48887, #48928, #48934, #48480, #48631, #48898, #48954 - Failed merges:
-
由 kennytm 提交于
Add missing links
-
由 kennytm 提交于
Remove auto trait implementation section when empty Fixes #48882.
-
由 kennytm 提交于
Remember state of top-level collapse toggle widget This change allows the big top-right expand/collapse toggle to remember its setting across navigation or page reloads. Prior to this change, there was this annoyance: - browse to some docs - Click the minus button to collapse them - browse to other docs (or reload the page) - Everything is expanded again The solution is based on storing a simple boolean flag in localStorage. I think it's a good improvement, but it does introduce the following potentially surprising behavior: - browse to some docs - click the minus button to collapse them - click to expand a particular item (not the main top-right big one) - reload the page, everything is collapsed Paired with @debugsteven on this.
-
由 kennytm 提交于
Clarify interfaction between File::set_len and file cursor
-
由 Alex Crichton 提交于
Should hopefully fix compiling the rls!
-
由 Guillaume Gomez 提交于
-
由 kennytm 提交于
Fix hygene issue when deriving Debug The code for several of the core traits doesn't use hygenic macros. This isn't a problem, except for the Debug trait, which is the only one that uses a variable, named "builder". Variables can't share names with unit structs, so attempting to [derive(Debug)] on any type while a unit struct with the name "builder" was in scope would result in an error. This commit just changes the name of the variable to "__debug_trait_builder", because I couldn't figure out how to get a list of all unit structs in-scope from within the derive expansion function. If someone wants to have a unit struct with the exact name "__debug_trait_builder", they'll just have to do it without a [derive(Debug)]. I also checked the implementations of the other built-in derives to ensure they didn't declare any variables.
-
由 kennytm 提交于
in which some labels and notes are upgraded to structured suggestions (Meanwhile, a couple of parse-fail tests are moved to UI tests so that the reader can see the new output, and an existing UI test is given a more evocative name.) r? @estebank
-
由 kennytm 提交于
Update stdsimd module Pulls in a redesigned `std::simd` module as well as a replacement for the `is_target_feature_detected!` macro
-
由 kennytm 提交于
tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories
-