summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
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-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-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
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-6/+2
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-3/+3
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03Annotate `derive`d spans and move span suggestion codeEsteban Kuber-3/+3
* Annotate `derive`d spans from the user's code with the appropciate context * Add `Span::can_be_used_for_suggestion` to query if the underlying span at the users' code
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-157/+231
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-12-02Auto merge of #91469 - matthiaskrgr:rollup-xom3j55, r=matthiaskrgrbors-1/+5
Rollup of 12 pull requests Successful merges: - #89954 (Fix legacy_const_generic doc arguments display) - #91321 (Handle placeholder regions in NLL type outlive constraints) - #91329 (Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives`) - #91364 (Improve error message for incorrect field accesses through raw pointers) - #91387 (Clarify and tidy up explanation of E0038) - #91410 (Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline) - #91435 (Improve diagnostic for missing half of binary operator in `if` condition) - #91444 (disable tests in Miri that take too long) - #91457 (Add additional test from rust issue number 91068) - #91460 (Document how `last_os_error` should be used) - #91464 (Document file path case sensitivity) - #91466 (Improve the comments in `Symbol::interner`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-02Rollup merge of #91329 - Aaron1011:modulo-regions-test, r=jackh726Matthias Krüger-1/+5
Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives` A global predicate is not guarnatenteed to outlive all regions. If the predicate involves late-bound regions, then it may fail to outlive other regions (e.g. `for<'b> &'b bool: 'static` does not hold) We now only produce `EvaluatedToOk` when a global predicate has no late-bound regions - in that case, the ony region that can be present in the type is 'static
2021-12-02Auto merge of #91318 - eggyal:reduce-boilerplate-around-infallible-folders, ↵bors-119/+101
r=jackh726 Reduce boilerplate around infallible folders Further to https://github.com/rust-lang/rust/pull/91230#issuecomment-981059666 r? `@jackh726`
2021-12-02Rename TypeFolderFallible to FallibleTypeFolderAlan Egerton-2/+2