-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Plumb inference obligations through librustc/middle, take 3/2 #32542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Hmm. Passing the Regardless, I'm inclined to land this work in some form, we can always fine tune later. |
@nikomatsakis The relevant code was under
was the reason why I changed it up for the code in I didn't try to figure through whether or not error reporting or whatever other side effects on the inference context depended on keeping e.g. the same trace across failures or other side-effects on the Edited for a wee bit of clarity |
@soltanmm I totally agree that if we are going to re-use a |
Refactor s.t. TypeRelation implementors in `infer` don't escape InferCtxt Some clean-up so that we can go back to the future of #31867 as opposed to #32542. r? @nikomatsakis
Plumb obligations through librustc/infer Like rust-lang#32542, but more like rust-lang#31867. TODO before merge: make an issue for the propagation of obligations through... uh, everywhere... then replace the `#????`s with the actual issue number. cc @jroesch r? @nikomatsakis
This is a limited rewrite of #31867 due to its significant bitrot. Due to some recent work on master using
Lub
across multiplecommit_if_ok
s I plumbed type-relating side-effects throughrelate.rs
instead of using internal state in individualTypeRelation
implementors.There's some miscellaneous clean-up and I'll admit to being lazy about using some old
try!
s instead of the?
syntax, but IIRC that can be addressed by an automated tool taking a pass at the code again whenever.Next up: replacing
consider_unification_despite_ambiguity
with a new obligation variant that's satisfied after a closure type has been determined.cc @jroesch
r? @nikomatsakis