about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-12-29Rollup merge of #106202 - estebank:trim-paths, r=NilstriebMatthias Krüger-4/+10
Trim more paths in obligation types
2022-12-29Rollup merge of #106223 - estebank:suggest-let-ty-borrow, r=compiler-errorsMatthias Krüger-0/+9
On unsized locals with explicit types suggest `&` Fix #72742.
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-1/+1
r=compiler-errors Rename `Rptr` to `Ref` in AST and HIR The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28On unsized locals with explicit types suggest `&`Esteban Küber-0/+9
Fix #72742.
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-1/+1
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-1/+1
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28Allow trait method paths to satisfy const Fn boundsDeadbeef-7/+27
2022-12-28better names and a commentMichael Goulet-1/+1
2022-12-27Trim more paths in obligation typesEsteban Küber-4/+10
2022-12-27Restore cyclic closure messageMichael Goulet-1/+20
2022-12-27Rollup merge of #106151 - TaKO8Ki:remove-unused-imports, r=jackh726fee1-dead-1/+0
Remove unused imports
2022-12-26remove unused importsTakayuki Maeda-1/+0
2022-12-25fix more clippy::style findingsMatthias Krüger-24/+19
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-11/+8
rustc: Remove needless lifetimes
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-69/+1422
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
2022-12-21Don't call typeck if we have no typeck resultsMichael Goulet-11/+8
This has a 10000000% chance of us causing a cycle if we're not careful
2022-12-21CollectAllMismatches relation should respect int/float infer varsMichael Goulet-7/+20
2022-12-21Rename things to be a bit clearerMichael Goulet-14/+11
2022-12-21Substitute things correctlyMichael Goulet-1/+2
2022-12-21Remove some unnecessary try_map_boundMichael Goulet-8/+2
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-11/+8
2022-12-20dedup assemblylcnr-298/+267
2022-12-19implement the skeleton of the updated trait solverlcnr-69/+1453
2022-12-19Rollup merge of #105882 - compiler-errors:issue-105832, r=jackh726Dylan DPC-5/+3
Don't ICE in closure arg borrow suggestion Fixes #105832
2022-12-19Rollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnrDylan DPC-17/+22
Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators Right now, we suggest a `T: Sync` bound for both `&T` and `&mut T` upvars. A user on URLO [found this confusing](https://users.rust-lang.org/t/error-complains-about-missing-sync-but-send-is-whats-missing/86021), so I wrote this quick fix to look at the mutability before making the suggestion.
2022-12-18Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=NilstriebMatthias Krüger-8/+8
use &str / String literals instead of format!()
2022-12-18Rollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errorsMatthias Krüger-2/+2
don't clone Copy types
2022-12-18Rollup merge of #105867 - matthiaskrgr:rec_param, r=compiler-errorsMatthias Krüger-6/+1
remove redundant fn params that were only "used" in recursion
2022-12-18Don't ICE in closure arg borrow suggestionMichael Goulet-5/+3
2022-12-18Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obkMatthias Krüger-1/+1
don't destuct references just to reborrow
2022-12-18don't restuct references just to reborrowMatthias Krüger-1/+1
2022-12-18avoid .into() conversion to identical typesMatthias Krüger-2/+2
2022-12-18use &str / String literals instead of format!()Matthias Krüger-8/+8
2022-12-18remove redundant fn params that were only "used" in recursionMatthias Krüger-6/+1
2022-12-18don't clone Copy typesMatthias Krüger-2/+2
2022-12-17Suggest a `T: Send` bound for `&mut T` upvars in `Send` generatorsMatthew House-17/+22
2022-12-16Auto merge of #105717 - compiler-errors:anonymize, r=jackh726bors-4/+4
always use `anonymize_bound_vars` Unless this is perf-sensitive, it's probably best to always use one anonymize function that does the right thing for all bound vars. r? types
2022-12-16Auto merge of #104334 - compiler-errors:ufcs-sugg-wrong-def-id, r=estebankbors-5/+6
Use impl's def id when calculating type to specify in UFCS Fixes #104327 Fixes #104328 Also addresses https://github.com/rust-lang/rust/pull/102670#discussion_r987381197
2022-12-15Rollup merge of #105727 - estebank:use-impl-trait, r=oli-obkMatthias Krüger-8/+20
Tweak output for bare `dyn Trait` in arguments Fix #35825.
2022-12-15Rollup merge of #105694 - ouz-a:issue_105689, r=estebankMatthias Krüger-13/+15
Don't create dummy if val has escaping bounds var Skips creating/pushing obligations if val has escaping bounds vars. Fixes #105689
2022-12-15Consider lifetimes when comparing assoc types in method chainEsteban Küber-1/+1
Do not say "Type changed to X here" when the only difference is caused by lifetimes.
2022-12-15Use `with_forced_trimmed_paths` moreEsteban Küber-16/+21
2022-12-15Point at method chains on `E0271` errorsEsteban Küber-89/+119
2022-12-15Auto merge of #105746 - matthiaskrgr:rollup-sz3grbv, r=matthiaskrgrbors-18/+26
Rollup of 11 pull requests Successful merges: - #104592 (Ensure async trait impls are async (or otherwise return an opaque type)) - #105623 (Fix `-Z print-type-sizes` for generators with discriminant field ordered first) - #105627 (Auto traits in `dyn Trait + Auto` are suggestable) - #105633 (Make `report_projection_error` more `Term` agnostic) - #105683 (Various cleanups to dest prop) - #105692 (Add regression test for #104678) - #105707 (rustdoc: remove unnecessary CSS `kbd { cursor: default }`) - #105715 (Do not mention long types in E0599 label) - #105722 (more clippy::complexity fixes) - #105724 (rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`) - #105730 (rustdoc: remove no-op CSS `.item-info:before { color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-15Rollup merge of #105633 - compiler-errors:term-agnostic, r=oli-obkMatthias Krüger-18/+26
Make `report_projection_error` more `Term` agnostic Fixes #105632
2022-12-15Auto merge of #105285 - compiler-errors:conflicting-param-env-2, r=estebankbors-28/+99
Highlight conflicting param-env candidates, again Un-reverts #98794 (i.e. reverts #99290). The previous time I attempted to land this PR, it was because of an incremental issue (#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly. The main motivation for trying to re-land this is that it fixes #105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates: ``` error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>` | note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found --> $DIR/conflicting-bounds.rs:3:1 | LL | pub trait Gen<'source> { | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | Self: for<'s> Gen<'s, Output = T>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0283`. ``` Fixes #105131. Fixes (again) #98786
2022-12-14Tweak output for bare `dyn Trait` in argumentsEsteban Küber-8/+20
Fix #35825.
2022-12-14always use anonymize_bound_varsMichael Goulet-4/+4
2022-12-14Highlight conflicting param-env candidates, againMichael Goulet-28/+99
2022-12-14Make report_projection_error more term agnosticMichael Goulet-18/+26