rust-lang / chalk

An implementation and definition of the Rust trait system using a PROLOG-like logic solver
https://rust-lang.github.io/chalk/book/
Other
1.81k stars 179 forks source link

fix: generalize types before generating built-in `Normalize` clauses #797

Closed lowr closed 1 year ago

lowr commented 1 year ago

When we generate built-in Normalize clauses, self_ty in the original goal may contain bound variables that prevent us from using it as-is. We need to universally quantify over the bound variables before passing it to trait-specific clause generators, which we've been failing to do for DiscriminantKind.

cc rust-lang/rust-analyzer#15113

compiler-errors commented 1 year ago

ha, I knew that we needed to generalize DiscriminantKind too. I think I pointed that out in some other PR 🤔

@bors r+

bors commented 1 year ago

:pushpin: Commit b1c01a8329d0faa9bc29dced516f2b378f4249dc has been approved by compiler-errors

It is now in the queue for this repository.

lowr commented 1 year ago

https://github.com/rust-lang/chalk/pull/794#discussion_r1163135370 :sweat_smile:

bors commented 1 year ago

:hourglass: Testing commit b1c01a8329d0faa9bc29dced516f2b378f4249dc with merge 7c8c3d29b3b9711c2ca20b1a8439d48cf5664fee...

bors commented 1 year ago

:sunny: Test successful - checks-actions Approved by: compiler-errors Pushing 7c8c3d29b3b9711c2ca20b1a8439d48cf5664fee to master...

bors commented 1 year ago

:sunny: Test successful - checks-actions Approved by: compiler-errors Pushing 7c8c3d29b3b9711c2ca20b1a8439d48cf5664fee to master...