Skip to content
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

Resolve obligations more carefully #18391

Closed
nikomatsakis opened this issue Oct 28, 2014 · 4 comments
Closed

Resolve obligations more carefully #18391

nikomatsakis opened this issue Oct 28, 2014 · 4 comments

Comments

@nikomatsakis
Copy link
Contributor

Resolving trait obligations can be an important part of type inference. However, right now we do it in a bit of an ad-hoc way:

  • Every once in a while, we eagerly resolve new obligations that haven't been attempted yet.
  • If we are looking at a type variable and need more type information, we do a full resolve of all obligations. This helps in some cases.

Probably we ought to avoid resolving obligations at all until we want more type information, and then we should do it only with obligations that will help with the variable in question. I am not sure if this is as simple as scanning for obligations that reference the variable somewhere -- I think not, we probably have to construct some kind of dependence graph. What can happen otherwise is something like:

$0 : Foo<$1>
$1 : Bar<$2>

To decide $2, we need to know $1, but to know $1, we have to resolve the first obligation.

@nikomatsakis
Copy link
Contributor Author

Related to #18208

@steveklabnik
Copy link
Member

@nikomatsakis was this closed by #18386? I can't tell.

@steveklabnik
Copy link
Member

Triage: a year later, with still no comments, I'm going assume this one is fixed.

@nikomatsakis
Copy link
Contributor Author

Well, it has not been fixed. However... it may be that having this issue open has no real value. Never mind, I'll re-close it. :)

(Ah, I guess I did sort of address this in my recent ObligationForest branch.)

lnicola pushed a commit to lnicola/rust that referenced this issue Oct 29, 2024
…on-panic

internal: log original syntax on panic
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

No branches or pull requests

2 participants