summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/solve
AgeCommit message (Collapse)AuthorLines
2024-01-29merge builtin unsize candidates againlcnr-87/+41
2024-01-29bye bye `assemble_candidates_via_self_ty`lcnr-111/+31
2024-01-23Random type checker changesMichael Goulet-1/+1
2024-01-19Add trait obligation tracking to FulfillCtxt and expose FnCtxt in ↵Gavin Gray-60/+76
rustc_infer using callback. Pass each obligation to an fn callback with its respective inference context. This avoids needing to keep around copies of obligations or inference contexts. Specify usability of inspect_typeck in comment.
2024-01-15Rollup merge of #119897 - compiler-errors:fulfillment-errors, r=lcnrMatthias Krüger-8/+8
`OutputTypeParameterMismatch` -> `SignatureMismatch` I'm probably missing something that made this rename more complicated. What did you end up getting stuck on when renaming this selection error, `@lcnr?` **also** I renamed the `FulfillmentErrorCode` variants. This is just churn but I wanted to do it forever. I can move it out of this PR if desired. r? lcnr
2024-01-13assert that trait solver is only created in proper infcxMichael Goulet-0/+5
2024-01-12Remove redundant Code from FulfillmentErrorCode variantsMichael Goulet-8/+8
2024-01-12Rollup merge of #119817 - compiler-errors:normalize-opaques, r=lcnrGuillaume Gomez-19/+22
Remove special-casing around `AliasKind::Opaque` when structurally resolving in new solver This fixes a few inconsistencies around where we don't eagerly resolve opaques to their (locally-defined) hidden types in the new solver. It essentially allows this code to work: ```rust fn main() { type Tait = impl Sized; struct S { i: i32, } let x: Tait = S { i: 0 }; println!("{}", x.i); } ``` Since `Tait` is defined in `main`, we are able to poke through the type of `x` with deref. r? lcnr
2024-01-12Auto merge of #119735 - lcnr:provisional-cache-readd, r=compiler-errorsbors-111/+265
next solver: provisional cache this adds the cache removed in #115843. However, it should now correctly track whether a provisional result depends on an inductive or coinductive stack. While working on this, I was using the following doc: https://hackmd.io/VsQPjW3wSTGUSlmgwrDKOA. I don't think it's too helpful to understanding this, but am somewhat hopeful that the inline comments are more useful. There are quite a few future perf improvements here. Given that this is already very involved I don't believe it is worth it (for now). While working on this PR one of my few attempts to significantly improve perf ended up being unsound again because I was not careful enough :sparkles: r? `@compiler-errors`
2024-01-11Remove special-casing around aliaskind in new solverMichael Goulet-19/+22
2024-01-10More commentsMichael Goulet-10/+30
2024-01-10Check reveal and can_define_opaque_ty in try_normalize_ty_recurMichael Goulet-12/+16
2024-01-09this is not a rust code snippetlcnr-4/+5
2024-01-09add comments and testslcnr-36/+58
2024-01-09avoid always rerunning in case of a cyclelcnr-34/+71
2024-01-09readd the provisional cachelcnr-62/+161
2024-01-08`all` to `any`lcnr-5/+5
don't really know why, but it is a lot easier for me to think about cycles that way.
2024-01-08do not track root depth of cycleslcnr-37/+32
results in slightly cleaner logic while making the following commit easier
2024-01-08use doc commentslcnr-3/+3
2023-12-28Movability doesn't need to be a query anymoreMichael Goulet-2/+2
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-22/+24
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-2/+2
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-19add commentlcnr-0/+14
2023-12-18dont discard overflow from normalizes-to goalslcnr-22/+45
2023-12-18track the source of nested goalslcnr-77/+145
2023-12-15Annotate some bugsMichael Goulet-2/+9
2023-12-14Unconditionally register alias-relate in projection goalMichael Goulet-11/+23
2023-12-14consistently use "next solver" instead of "new solver"lcnr-4/+4
2023-12-14update use of feature flagslcnr-5/+4
2023-12-14rename `-Ztrait-solver` to `-Znext-solver`lcnr-4/+5
2023-12-12refactor writeback: emit normalization errors with new solverlcnr-5/+4
2023-12-08Rollup merge of #117586 - compiler-errors:the-canonicalizer, r=lcnrMatthias Krüger-430/+1
Uplift the (new solver) canonicalizer into `rustc_next_trait_solver` Uplifts the new trait solver's canonicalizer into a new crate called `rustc_next_trait_solver`. The crate name is literally a bikeshed-avoidance name, so let's not block this PR on that -- renames are welcome later. There are a host of other changes that were required to make this possible: * Expose a `ConstTy` trait to get the `Interner::Ty` from a `Interner::Const`. * Expose some constructor methods to construct `Bound` variants. These are currently methods defined on the interner themselves, but they could be pulled into traits later. * Expose a `IntoKind` trait to turn a `Ty`/`Const`/`Region` into their corresponding `*Kind`s. * Some minor tweaks to other APIs in `rustc_type_ir`. The canonicalizer code itself is best reviewed **with whitespace ignored.** r? ``@lcnr``
2023-12-08Uplift canonicalizer into new trait solver crateMichael Goulet-430/+1
2023-12-08Implement `async gen` blocksMichael Goulet-0/+65
2023-12-08implement and use `NormalizesTo`lcnr-61/+71
2023-12-07add unused `NormalizesTo` predicatelcnr-0/+6
2023-12-05Continue folding if deep normalizer failsMichael Goulet-14/+40
2023-12-05Add deeply_normalize_for_diagnostics, use it in coherenceMichael Goulet-2/+18
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-2/+2
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-29new solver: improve instrument annotationslcnr-1/+4
2023-11-26Clean dead codesr0cky-17/+0
2023-11-25Rollup merge of #118259 - spastorino:move-eager-resolver-to-infer, ↵León Orell Valerian Liehr-80/+5
r=compiler-errors Move EagerResolution to rustc_infer::infer::resolve `EagerResolver` fits better in `rustc_infer::infer::resolver`. Started to disentagle #118118 that has a lot of unrelated things. r? `@compiler-errors` `@lcnr`
2023-11-24Move EagerResolution to rustc_infer::infer::resolveSantiago Pastorino-80/+5
2023-11-24Rollup merge of #118243 - lcnr:commit-if-ok, r=compiler-errorsMichael Goulet-9/+9
EvalCtxt::commit_if_ok don't inherit nested goals we use it to check whether an alias is rigid, so we want to avoid considering an alias rigid simply because the inference constraints from normalizing it caused another nested goal fail r? `@compiler-errors`
2023-11-24EvalCtxt::commit_if_ok don't inherit nested goalslcnr-9/+9
2023-11-22Auto merge of #118120 - compiler-errors:closure-kind, r=lcnrbors-3/+0
Remove `PredicateKind::ClosureKind` We don't need the `ClosureKind` predicate kind -- instead, `Fn`-family trait goals are left as ambiguous, and we only need to make progress on `FnOnce` projection goals for inference purposes. This is similar to how we do confirmation of `Fn`-family trait and projection goals in the new trait solver, which also doesn't use the `ClosureKind` predicate. Some hacky logic is added in the second commit so that we can keep the error messages the same.
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-0/+1
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-5/+5
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-21Remove ClosureKind predicate kindMichael Goulet-3/+0
2023-11-20handle reservation impls, track impl sourcelcnr-25/+45