Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

By letting the solver take control of them (reveal them when needed and define them when needed), by providing them in the TypingMode plus few helpers.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 24, 2025
By letting the solver take control of them (reveal them when needed and define them when needed), by providing them in the `TypingMode` plus few helpers.
@ChayimFriedman2
Copy link
Contributor Author

Fixed the panic, now this can be reviewed.

pub(crate) struct InferenceTable<'db> {
pub(crate) db: &'db dyn HirDatabase,
pub(crate) trait_env: Arc<TraitEnvironment<'db>>,
pub(crate) tait_coercion_table: Option<FxHashMap<InternedOpaqueTyId, Ty<'db>>>,
Copy link
Member

Choose a reason for hiding this comment

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

I'm really happy that my opaque hack here can be finally removed 🎉

);
}

#[ignore = "FIXME(next-solver): TAIT support was removed, need to rework it to work with `#[define_opaque]`"]
Copy link
Member

Choose a reason for hiding this comment

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

👍

impl<'db> InferenceTable<'db> {
pub(crate) fn new(db: &'db dyn HirDatabase, trait_env: Arc<TraitEnvironment<'db>>) -> Self {
/// Inside hir-ty you should use this for inference only, and always pass `owner`.
/// Outside it, always pass `owner = None`.
Copy link
Member

@ShoyuVanilla ShoyuVanilla Oct 28, 2025

Choose a reason for hiding this comment

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

Expressing this with a new enum type would be great, though it is stated well in the comment and I think this is okay as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope this is temporary, since I plan to remove all usages of InferenceTable except inference (its role was to do what InferCtxt does now).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, InferenceTable feels quite awkward now 😅

Copy link
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

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

👍

@ShoyuVanilla
Copy link
Member

I'll add this to the merge queue, as the implementation feels right and is relatively less complex compared to other big next-solver changes 😄

@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Oct 28, 2025
Merged via the queue into rust-lang:master with commit 6155980 Oct 28, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2025
@ChayimFriedman2 ChayimFriedman2 deleted the opaques-ns branch October 28, 2025 08:15
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