Skip to content

Conversation

@ShoyuVanilla
Copy link
Member

r? lcnr

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Dec 2, 2025
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this 😊

I think we should explain a few specific concepts here and would have separate headers for each of them:

  • trait Interner already mostly done
    • I'd explicitly mention that it corresponds to the TyCtxt in rustc and is where we put rustc querys
  • mod inherent
    • forward definitions of inherent methods on compiler specific types
    • should be imported via use inherent::*; in the generic crates
    • never used inside of the implementations themselves, they should use the inherent methods of the actual types once they are nameable
  • trait InferCtxtLike and trait SolverDelegate
    • corresponds to the InferCtxt in rustc
    • InferCtxtLike has do be defined in rustc_infer due to coherence rules, does not provide functionality defined in rustc_trait_selection
    • that behavior is abstracted over via the separate SolverDelegate trait
    • ideally all of SolverDelegate should be extracted into the rustc_next_trait_solver with the necessary core operations added to InferCtxtLike
  • rustc_type_ir::search_graph::{Cx, Delegate}
    • abstraction traits already implemented in rustc_next_trait_solver itself, used to support fuzzing of the search graph outside of the trait solver in https://github.com/lcnr/search_graph_fuzz, not relevant for users of the trait solver

@ShoyuVanilla
Copy link
Member Author

Thanks for the review! I'll apply your feedback some hours later 😄

@ShoyuVanilla ShoyuVanilla force-pushed the ra-solver branch 2 times, most recently from 888d29e to fd82821 Compare December 8, 2025 15:50
@ShoyuVanilla
Copy link
Member Author

Sorry for being a bit late 😅 I've been busy at work these days

@lcnr
Copy link
Contributor

lcnr commented Dec 9, 2025

very cool, I like it 👍

thanks for doing this ❤️

@lcnr lcnr merged commit 48d0f3c into rust-lang:main Dec 9, 2025
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants