-
Notifications
You must be signed in to change notification settings - Fork 661
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
Fix futures #28469
base: mainnet
Are you sure you want to change the base?
Fix futures #28469
Conversation
Also, fix the span for function inputs.
This way we don't get misleading error messages.
2760c4c
to
8df853f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, left some nits and comments.
Any chance this approach can be used to address either of these issues:
I believe the CI failure is due to some expectations that need to be regenerated
Cargo.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update the lockfile? One implication of doing this often is that the CI caches are invalidated every time the lockfile changes.
} | ||
|
||
let ty: Type = if is_future { | ||
inferred_type.expect("Type checking guarantees the inferred type is present") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. Could we use the unreachable
macro here? This helps us look back on those sorts of invariants.
8df853f
to
2f8b4f4
Compare
Indeed, this issue is now fixed (and I've updated the last commit message to refer to it). And I think this one is too. Maybe. The compiler will now give an error for the code in the example, because you can't assign a Future out of a tuple to a new variable like that. I think that suffices to fix this issue, but maybe there is still a problem around type checking futures? |
Now futures are tracked properly, whether they're stored directly in a variable or in a tuple. Also, error if a future is used improperly. Fixes #28471
2f8b4f4
to
12ea37e
Compare
No description provided.