about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-01-10Rollup merge of #92248 - compiler-errors:normalize-type-for-pointee, r=jackh726Matthias Krüger-6/+32
Normalize struct tail type when checking Pointee trait Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on `<Ty as Pointee>::Metadata` later. Fixes #92128 Fixes #92577 Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing `<_ as Pointee>::Metadata` to be properly replaced with an infer variable ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/project.rs#L813)) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types. Fixes #91446
2022-01-10Elaborate param_env predicates when checking if type outlives involving ↵Jack Huey-1/+3
projection holds
2022-01-09eplace usages of vec![].into_iter with [].into_iterLucas Kent-3/+3
2022-01-07Add query to avoid name comparison in `leaf_def`Matthew Jasper-28/+34
2021-12-29Auto merge of #92244 - petrochenkov:alltraits, r=cjgillotbors-6/+6
rustc_metadata: Encode list of all crate's traits into metadata While working on https://github.com/rust-lang/rust/pull/88679 I noticed that rustdoc is casually doing something quite expensive, something that is used only for error reporting in rustc - collecting all traits from all crates in the dependency tree. This PR trades some minor extra time spent by metadata encoder in rustc for major gains for rustdoc (and for rustc runs with errors, which execute the `all_traits` query for better diagnostics).
2021-12-28Rollup merge of #92076 - Aaron1011:rustdoc-auto-trait-ignore, r=cjgillotMatthias Krüger-1/+11
Ignore other `PredicateKind`s in rustdoc auto trait finder Fixes #92073 There's not really anything we can do with them, and they're causing ICEs. I'm not using a wildcard match, as we should check that any new `PredicateKind`s are handled properly by rustdoc.
2021-12-28rustc_metadata: Encode list of all crate's traits into metadataVadim Petrochenkov-6/+6
2021-12-25normalize env constness for nested obligationsDeadbeef-0/+33
2021-12-24Normalize struct tail type when checking Pointee traitMichael Goulet-6/+32
2021-12-22When obligation is a sized predicate, prefer projection or object candidates ↵Jack Huey-19/+29
instead of param_env candidates
2021-12-21remove obligation deduplcnr-22/+0
2021-12-21Fix bad caching of `~const Drop` boundsDeadbeef-3/+3
2021-12-20Auto merge of #92041 - Aaron1011:remove-speculative-evaluation, r=jackh726bors-18/+1
Remove 'speculative evaluation' of predicates Performing 'speculative evaluation' introduces caching bugs that cannot be fixed without invasive changes to projection. Hopefully, we can win back most of the performance lost by re-adding 'cache completion' Fixes #90662
2021-12-20Eliminate `ObligationCauseData`.Nicholas Nethercote-56/+54
This makes `Obligation` two words bigger, but avoids allocating a lot of the time. I previously tried this in #73983 and it didn't help much, but local timings look more promising now.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-2/+2
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-18Re-introduce concept of projection cache 'completion'Aaron Hill-3/+69
Instead of clearing out the cache entirely, we store the intermediate evaluation result into the cache entry. This accomplishes several things: * We avoid the performance hit associated with re-evaluating the sub-obligations * We avoid causing issues with incremental compilation, since the final evaluation result is always the same * We avoid affecting other uses of the same `InferCtxt` which might care about 'side effects' from processing the sub-obligations (e,g. region constraints). Only code that is specifically aware of the new 'complete' code is affected
2021-12-18Ignore other `PredicateKind`s in rustdoc auto trait finderAaron Hill-1/+11
Fixes #92073 There's not really anything we can do with them, and they're causing ICEs. I'm not using a wildcard match, as we should check that any new `PredicateKind`s are handled properly by rustdoc.
2021-12-17Remove 'speculative evaluation' of predicatesAaron Hill-18/+1
Performing 'speculative evaluation' introduces caching bugs that cannot be fixed without invasive changes to projection. Hopefully, we can win back most of the performance lost by re-adding 'cache completion' Fixes #90662
2021-12-16Prove obligations to termination instead of ignoring ambiguities.Oli Scherer-19/+42
Sometimes an obligation depends on a later one, so we can't just process them in order like it was done previously. This is not a problem in our test suite, but there may be ICEs out there and it will definitely be a problem with lazy TAIT.
2021-12-16Rollup merge of #91904 - ↵Matthias Krüger-54/+63
SylvanB:remove_in_band_lifetimes_rustc_trait_selection, r=petrochenkov Remove `in_band_lifetimes` from `rustc_trait_selection` Another one for #91867
2021-12-15Auto merge of #86986 - lcnr:simplify_type, r=nikomatsakis,oli-obkbors-18/+62
extend `simplify_type` might cause a slight perf inprovement and imo more accurately represents what types there are. considering that I was going to use this in #85048 it seems like we might need this in the future anyways :shrug:
2021-12-15Remove `in_band_lifetimes` from `rustc_trait_selection`Sylvan Bowdler-54/+63
2021-12-15Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514Matthias Krüger-1/+1
fix clippy::single_char_pattern perf findings
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-2/+2
2021-12-15Rollup merge of #91881 - Patrick-Poitras:stabilize-iter-zip, r=scottmcmMatthias Krüger-1/+0
Stabilize `iter::zip` Hello all! As the tracking issue (#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue. As the pull request that introduced the feature (#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been used in many places across the rust compiler and standard library since March without any issues. For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-12-14fmtlcnr-2/+1
2021-12-14add some commentslcnr-0/+8
2021-12-14extend `simplify_type`lcnr-17/+54
2021-12-14fix clippy::single_char_pattern perf findingsMatthias Krüger-1/+1
2021-12-13review comment: change wording of suggestionEsteban Kuber-1/+1
2021-12-13review commentsEsteban Kuber-8/+20
2021-12-13Simplify diagnostic logicEsteban Kuber-123/+44
The spans no longer overlap, so we no longer need to specialize the output depending on whether they would.
2021-12-13Fix rebase and clippy testsEsteban Kuber-38/+40
2021-12-13Keep info on pre-desugaring expression for better "incorrect `.await`" ↵Esteban Kuber-2/+36
suggestion Keep the `HirId` of `.await`ed expressions so in the case of a `fn` call on on a sync `fn`, we can suggest maybe turning it into an `async fn`.
2021-12-13Reduce verbosity for `?` on non-`Try` expressionsEsteban Kuber-0/+1
2021-12-13Reduce verbosity when calling `for`-loop on non-`Iterator` expressionEsteban Kuber-2/+5
2021-12-13When `.await` is called on a non-`Future` expression, suggest removalEsteban Kuber-0/+27
Keep track of the origin of a `T: Future` obligation when caused by an `.await` expression. Address #66731.
2021-12-12Auto merge of #91549 - fee1-dead:const_env, r=spastorinobors-236/+181
Eliminate ConstnessAnd again Closes #91489. Closes #89432. Reverts #91491. Reverts #89450. r? `@spastorino`
2021-12-12Auto merge of #90423 - Aaron1011:deduplicate-projection, r=jackh726bors-0/+6
Deduplicate projection sub-obligations
2021-12-12Remap more env constness for queriesDeadbeef-18/+17
2021-12-12Remap predicate/env constness before queryingDeadbeef-4/+24
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-231/+157
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-11Tweak assoc type obligation spansEsteban Kuber-3/+63
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-12-10Rollup merge of #91625 - est31:remove_indexes, r=oli-obkMatthias Krüger-3/+3
Remove redundant [..]s
2021-12-09Remove redundant [..]sest31-3/+3
2021-12-08Use Vec extend instead of repeated pushes in several placesJakub Beránek-6/+2
2021-12-05Auto merge of #91555 - matthiaskrgr:rollup-pq0iaq7, r=matthiaskrgrbors-5/+17
Rollup of 4 pull requests Successful merges: - #90529 (Skip reborrows in AbstractConstBuilder) - #91437 (Pretty print empty blocks as {}) - #91450 (Don't suggest types whose inner type is erroneous) - #91535 (Stabilize `-Z emit-future-incompat` as `--json future-incompat`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-05Rollup merge of #90529 - b-naber:reborrows-consts, r=lcnrMatthias Krüger-5/+17
Skip reborrows in AbstractConstBuilder Fixes https://github.com/rust-lang/rust/issues/90455 Temporary fix to prevent confusing diagnostics that refer to implicit borrows and derefs until we allow borrows and derefs on constant expressions. r? `@oli-obk`
2021-12-05skip reborrows during AbstractConst buildingb-naber-5/+17