about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-8/+8
2024-05-10De-tuple two `vtable_trait_first_method_offset` args.Nicholas Nethercote-8/+4
Thus eliminating a `FIXME` comment.
2024-05-10Remove out-of-date comment.Nicholas Nethercote-2/+0
The use of `Binder` was removed in the recent #123900, but the comment wasn't removed at the same time.
2024-05-10Use fewer origins when creating type variables.Nicholas Nethercote-55/+15
`InferCtxt::next_{ty,const}_var*` all take an origin, but the `param_def_id` is almost always `None`. This commit changes them to just take a `Span` and build the origin within the method, and adds new methods for the rare cases where `param_def_id` might not be `None`. This avoids a lot of tedious origin building. Specifically: - next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of `TypeVariableOrigin` - next_ty_var_with_origin: added - next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin - next_const_var_with_origin: added - next_region_var, next_region_var_in_universe: these are unchanged, still take RegionVariableOrigin The API inconsistency (ty/const vs region) seems worth it for the large conciseness improvements.
2024-05-09always use `GenericArgsRef`lcnr-2/+2
2024-05-09analyse visitor: build proof tree in probelcnr-11/+34
2024-05-07Fix ICEs in diagnostic::on_unimplementedMichael Goulet-51/+69
2024-05-08Auto merge of #124683 - estebank:issue-124651, r=compiler-errorsbors-6/+8
Do not ICE on foreign malformed `diagnostic::on_unimplemented` Fix #124651.
2024-05-07Rollup merge of #124846 - compiler-errors:const-eval, r=lcnrMatthias Krüger-3/+3
Don't ICE when we cannot eval a const to a valtree in the new solver Use `const_eval_resolve` instead of `try_const_eval_resolve` because naming aside, the former doesn't ICE when a value can't be evaluated to a valtree. r? lcnr
2024-05-07Rollup merge of #124827 - lcnr:generalize-incomplete, r=compiler-errorsMatthias Krüger-1/+4
generalize hr alias: avoid unconstrainable infer vars fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/108 see inline comments for more details r? `@compiler-errors` cc `@BoxyUwU`
2024-05-07generalize hr alias: avoid unconstrainable infer varslcnr-1/+4
2024-05-07Don't ICE when we cannot eval a const to a valtree in the new solverMichael Goulet-3/+3
2024-05-06Rollup merge of #124809 - lcnr:prepopulate-opaques, r=compiler-errorsMatthias Krüger-9/+6
borrowck: prepopulate opaque storage more eagerly otherwise we ICE due to ambiguity when normalizing while computing implied bounds. r? ``@compiler-errors``
2024-05-06Rollup merge of #124759 - compiler-errors:impl-args, r=lcnrMatthias Krüger-65/+93
Record impl args in the proof tree in new solver Rather than rematching them during select. Also use `ImplSource::Param` instead of `ImplSource::Builtin` for alias-bound candidates, so we don't ICE in `Instance::resolve`. r? lcnr
2024-05-06Use correct ImplSource for alias boundsMichael Goulet-2/+1
2024-05-06Record impl args in the InsepctCandiate rather than rematching during selectMichael Goulet-65/+94
2024-05-06Rollup merge of #124771 - compiler-errors:cand-has-failing-wc, r=lcnrMatthias Krüger-6/+42
Don't consider candidates with no failing where clauses when refining obligation causes in new solver Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds). r? lcnr
2024-05-06Rollup merge of #124724 - compiler-errors:prefer-lower, r=lcnrMatthias Krüger-5/+13
Prefer lower vtable candidates in select in new solver Also, adjust the select visitor to only winnow when the *parent* goal is `Certainty::Yes`. This means that we won't winnow in cases when we have any ambiguous inference guidance from two candidates. r? lcnr
2024-05-06switch new solver to directly inject opaque typeslcnr-9/+6
2024-05-06Don't consider candidates with no failing where clausesMichael Goulet-6/+42
2024-05-06Prefer lower vtable candidates in select in new solverMichael Goulet-5/+13
2024-05-04Rollup merge of #124718 - compiler-errors:record-impl-args, r=lcnrMatthias Krüger-2/+6
Record impl args in the proof tree Weren't recording these since they went through a different infcx method r? lcnr
2024-05-04Rollup merge of #124717 - compiler-errors:do-not-recomment-next-solver, r=lcnrMatthias Krüger-0/+9
Implement `do_not_recommend` in the new solver Put the test into `diagnostic_namespace` test folder even though it's not in the diagnostic namespace, because it should be soon. r? lcnr cc `@weiznich`
2024-05-04Record impl args in the proof treeMichael Goulet-2/+6
2024-05-04Implement do_not_recommend in the new solverMichael Goulet-0/+9
2024-05-04Only consider ambiguous goals when finding best obligation for ambiguitiesMichael Goulet-9/+11
2024-05-03Rollup merge of #124418 - compiler-errors:better-cause, r=lcnrMichael Goulet-40/+200
Use a proof tree visitor to refine the `Obligation` for error reporting in new solver With the magic of `ProofTreeVisitor`, we can close the gap that we have on `ObligationCause`s being not as descriptive in the new trait solver. r? lcnr Needs some work and obviously documentation.
2024-05-03Do not ICE on foreign malformed `diagnostic::on_unimplemented`Esteban Küber-6/+8
Fix #124651.
2024-05-02Take ocx by move for pending obligationsMichael Goulet-1/+8
2024-05-02Use ObligationCtxt in favor of TraitEngine in many placesMichael Goulet-71/+99
2024-05-02Higher ranked goal source, do overflow handling less badlyMichael Goulet-80/+87
2024-05-02Use a proof tree visitor to refine the Obligation for error reportingMichael Goulet-10/+147
2024-05-02Record more kinds of things as impl where boundsMichael Goulet-12/+13
2024-05-02Store goal source in InspectGoalMichael Goulet-12/+27
2024-05-02Record certainty before evaluating nesteds, so we make candidatesMichael Goulet-2/+2
2024-05-02Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmeaseMatthias Krüger-2/+2
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)` I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
2024-05-02Inline & delete `Ty::new_unit`, since it's just a field accessWaffle Lapkin-2/+2
2024-05-02shallow resolve in orphan checklcnr-36/+43
2024-05-02Auto merge of #124521 - Mark-Simulacrum:bootstrap-bump, r=albertlarsan68bors-1/+0
Bump bootstrap compiler to latest beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday This also cherry-picks d716d72586548963f32e5c8d57c41db0065fa6e0 from the beta branching, to continue to workaround #122758. r? bootstrap
2024-05-01Step bootstrap cfgsMark Rousskov-1/+0
2024-05-02Auto merge of #124529 - compiler-errors:select, r=lcnrbors-328/+156
Rewrite select (in the new solver) to use a `ProofTreeVisitor` We can use a proof tree visitor rather than collecting and recomputing all the nested goals ourselves. Based on #124415
2024-05-01Rewrite select to use a ProofTreeVisitorMichael Goulet-328/+156
2024-05-01Rollup merge of #124566 - lcnr:normalizes-to-proof-tree, r=compiler-errorsMatthias Krüger-50/+120
fix `NormalizesTo` proof tree issue fixes #124422 cc #121848 r? ``@compiler-errors``
2024-05-01reviewlcnr-13/+15
2024-05-01Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnrbors-6/+6
Cleanup: Replace item names referencing GitHub issues or error codes with something more meaningful **lcnr** in https://github.com/rust-lang/rust/pull/117164#pullrequestreview-1969935387: > […] while I know that there's precendent to name things `Issue69420`, I really dislike this as it requires looking up the issue to figure out the purpose of such a variant. Actually referring to the underlying issue, e.g. `AliasMayNormToUncovered` or whatever and then linking to the issue in a doc comment feels a lot more desirable to me. We should ideally rename all the functions and enums which currently use issue numbers. I've grepped through `compiler/` like crazy and think that I've found all instances of this pattern. However, I haven't renamed `compute_2229_migrations_*`. Should I? The first commit introduces an abhorrent and super long name for an item because naming is hard but also scary looking / unwelcoming names are good for things related to temporary-ish backcompat hacks. I'll let you discover it by yourself. Contains a bit of drive-by cleanup and a diag migration bc that was the simplest option. r? lcnr or compiler
2024-04-30Auto merge of #117164 - fmease:orphan-norm, r=lcnrbors-67/+115
Lazily normalize inside trait ref during orphan check & consider ty params in rigid alias types to be uncovered Fixes #99554, fixes rust-lang/types-team#104. Fixes #114061. Supersedes #100555. Tracking issue for the future compatibility lint: #124559. r? lcnr
2024-04-30Give items related to issue 33140 a more meaningful nameLeón Orell Valerian Liehr-6/+6
2024-04-30fix `NormalizesTo` proof tree issuelcnr-50/+118
2024-04-30Normalize trait ref before orphan check & consider ty params in alias types ↵León Orell Valerian Liehr-67/+115
to be uncovered
2024-04-30Rollup merge of #124511 - nnethercote:rm-extern-crates, r=fee1-deadMatthias Krüger-14/+25
Remove many `#[macro_use] extern crate foo` items This requires the addition of more `use` items, which often make the code more verbose. But they also make the code easier to read, because `#[macro_use]` obscures where macros are defined. r? `@fee1-dead`