about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/solve/trait_goals.rs
AgeCommit message (Collapse)AuthorLines
2024-06-18Uplift the new trait solverMichael Goulet-1181/+0
2024-06-18SolverDelegateMichael Goulet-29/+29
2024-06-16Auto merge of #126505 - compiler-errors:no-vtable, r=lcnrbors-18/+14
Only compute vtable information during codegen This PR removes vtable information from the `Object` and `TraitUpcasting` candidate sources in the trait solvers, and defers the computation of relevant information to `Instance::resolve`. This is because vtables really aren't a thing in the trait world -- they're an implementation detail in codegen. Previously it was just easiest to tangle this information together since we were already doing the work of looking at all the supertraits in the trait solver, and specifically because we use traits to represent when it's possible to call a method via a vtable (`Object` candidate) and do upcasting (`Unsize` candidate). but I am somewhat suspicious we're doing a *lot* of extra work, especially in polymorphic contexts, so let's see what perf says.
2024-06-15Rollup merge of #126496 - compiler-errors:more-generics, r=lcnrGuillaume Gomez-32/+32
Make proof tree probing and `Candidate`/`CandidateSource` generic over interner `<TyCtxt<'tcx>>` is ugly, but will become `<I>` when things actually become generic. r? lcnr
2024-06-14Only compute vtable information during codegenMichael Goulet-18/+14
2024-06-14Add TyCtxt::is_lang_itemMichael Goulet-11/+10
2024-06-14Make Candidate generic over internerMichael Goulet-32/+32
2024-06-03check_is_object_safe -> is_object_safeMichael Goulet-1/+1
2024-06-01Deduplicate supertrait_def_ids codeMark Rousskov-3/+2
2024-05-28EvalCtxt::tcx() -> EvalCtxt::interner()Michael Goulet-24/+27
2024-05-19Make EvalCtxt generic over internerMichael Goulet-28/+29
2024-05-18Uplift inspect into rustc_type_irMichael Goulet-3/+3
2024-05-16Rename ToPredicate for UpcastMichael Goulet-4/+4
2024-05-13Remove `extern crate rustc_middle` from `rustc_trait_selection`.Nicholas Nethercote-0/+1
2024-05-12solve: replace all `debug` with `trace`lcnr-2/+2
2024-05-10Lift `TraitRef` into `rustc_type_ir`Michael Goulet-3/+7
2024-05-06Record impl args in the InsepctCandiate rather than rematching during selectMichael Goulet-0/+1
2024-05-02Record more kinds of things as impl where boundsMichael Goulet-2/+3
2024-04-29Actually use probes when needed and stop relying on existing outer probesMichael Goulet-165/+197
2024-04-29Make names more accurateMichael Goulet-3/+8
2024-04-25Remove special-casing for SimplifiedType for next solverMichael Goulet-7/+9
2024-04-16Add simple async drop glue generationzetanumbers-0/+12
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-04-08Auto merge of #122077 - oli-obk:eager_opaque_checks4, r=lcnrbors-4/+1
Pass list of defineable opaque types into canonical queries This eliminates `DefiningAnchor::Bubble` for good and brings the old solver closer to the new one wrt cycles and nested obligations. At that point the difference between `DefiningAnchor::Bind([])` and `DefiningAnchor::Error` was academic. We only used the difference for some sanity checks, which actually had to be worked around in places, so I just removed `DefiningAnchor` entirely and just stored the list of opaques that may be defined. fixes #108498 fixes https://github.com/rust-lang/rust/issues/116877 * [x] run crater - https://github.com/rust-lang/rust/pull/122077#issuecomment-2013293931
2024-04-08Avoid fetching the opaque type origin when only "is this in the defining ↵Oli Scherer-4/+1
scope" is actually needed
2024-04-08Actually create ranged int types in the type system.Oli Scherer-0/+1
2024-03-22Auto merge of #122900 - matthiaskrgr:rollup-nls90mb, r=matthiaskrgrbors-33/+35
Rollup of 8 pull requests Successful merges: - #114009 (compiler: allow transmute of ZST arrays with generics) - #122195 (Note that the caller chooses a type for type param) - #122651 (Suggest `_` for missing generic arguments in turbofish) - #122784 (Add `tag_for_variant` query) - #122839 (Split out `PredicatePolarity` from `ImplPolarity`) - #122873 (Merge my contributor emails into one using mailmap) - #122885 (Adjust better spastorino membership to triagebot's adhoc_groups) - #122888 (add a couple more tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-22Split out ImplPolarity and PredicatePolarityMichael Goulet-33/+35
2024-03-22Programmatically convert some of the pat ctorsMichael Goulet-1/+1
2024-03-22Implement `FusedIterator` for `gen` blockShoyu Vanilla-0/+22
2024-03-14Rollup merge of #122238 - fee1-dead-contrib:builtin-impl-next-solver-dox, r=lcnrMatthias Krüger-0/+8
Document some builtin impls in the next solver This does not cover all builtin impls, but ones that I were able to go over within a cycle. r? `@lcnr` Let me know if the place isn't correct for these, or if you'd like me to change how the impls are presented ^^
2024-03-14move impl documentation to their actual locationsDeadbeef-33/+2
2024-03-09Document some builtin impls in the next solverDeadbeef-0/+39
2024-03-07Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`Yoshitomo Nakanishi-3/+3
2024-03-06remove outdated fixme commentDeadbeef-1/+0
The `TraitPredicate` no longer has constness as we have desugared it to work with the type system through const generics instead.
2024-02-29Rollup merge of #121681 - jswrenn:nix-visibility-analysis, r=compiler-errorsMatthias Krüger-2/+1
Safe Transmute: Revise safety analysis This PR migrates `BikeshedIntrinsicFrom` to a simplified safety analysis (described [here](https://github.com/rust-lang/project-safe-transmute/issues/15)) that does not rely on analyzing the visibility of types and fields. The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis. Notably, this PR removes the `Context` type parameter from `BikeshedIntrinsicFrom`. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter. r? `@compiler-errors`
2024-02-27Add a couple helpers, make return types less confusingMichael Goulet-6/+12
2024-02-27safe transmute: revise safety analysisJack Wrenn-2/+1
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
2024-02-15Consider principal trait ref's auto-trait super-traits in dyn upcastingMichael Goulet-8/+15
2024-02-13Rollup merge of #120549 - lcnr:errs-showcase, r=compiler-errorsMatthias Krüger-5/+5
modify alias-relate to also normalize ambiguous opaques allows a bunch of further cleanups and generally simplifies the type system. To handle https://github.com/rust-lang/trait-system-refactor-initiative/issues/8 we'll have to add a some additional complexity to the `(Alias, Infer)` branches in alias-relate, so removing the opaque type special case here is really valuable. It does worsen `deduce_closure_signature` and friends even more as they now receive an inference variable which is only constrained via an `AliasRelate` goal. These probably have to look into alias relate goals somehow. Leaving that for a future PR as this is something we'll have to tackle regardless. r? `@compiler-errors`
2024-02-13use alias-relate to structurally normalize in the solverlcnr-5/+5
2024-02-13Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errorsbors-4/+7
Merge `impl_polarity` and `impl_trait_ref` queries Hopefully this is perf neutral. I want to finish https://github.com/rust-lang/rust/pull/120835 and stop using the HIR in `coherent_trait`, which should then give us a perf improvement.
2024-02-12Stop calling `impl_polarity` when `impl_trait_ref` was also calledOli Scherer-4/+7
2024-02-12Dejargnonize substShoyu Vanilla-3/+3
2024-02-08reviews + rebaseBoxy-1/+0
2024-02-08introduce `enter_forall`Boxy-2/+10
2024-02-06Teach typeck/borrowck/solvers how to deal with async closuresMichael Goulet-0/+60
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-1/+2
2024-01-29merge builtin unsize candidates againlcnr-49/+41
2023-12-28Movability doesn't need to be a query anymoreMichael Goulet-1/+1
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-7/+7