-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Do not record unresolved const vars in generator interior #104788
Conversation
r? @fee1-dead (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in need_type_info.rs cc @lcnr |
/// Returns the first unresolved variable contained in `T`. In the | ||
/// process of visiting `T`, this will resolve (where possible) | ||
/// type variables in `T`, but it never constructs the final, | ||
/// resolved type, so it's more efficient than | ||
/// `resolve_vars_if_possible()`. | ||
pub fn unresolved_type_vars<T>(&self, value: &T) -> Option<(Ty<'tcx>, Option<Span>)> | ||
/// Returns the first unresolved type or const variable contained in `T`. | ||
/// In the process of visiting `T`, this will resolve (where possible) | ||
/// type variables in `T`, but it never constructs the final, resolved | ||
/// type, so it's more efficient than `resolve_vars_if_possible()`. | ||
pub fn unresolved_non_region_vars<T>(&self, value: &T) -> Option<(ty::Term<'tcx>, Option<Span>)> |
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.
With #101900, I think this should be called unresolved_type_or_const_vars
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.
Sure, though I would assume that effect vars, if they existed, would also need to be included in this, or else we'd have the same ICE
@@ -121,33 +122,62 @@ impl<'a, 'tcx> UnresolvedTypeFinder<'a, 'tcx> { | |||
} | |||
|
|||
impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeFinder<'a, 'tcx> { |
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.
Rename?
d08470f
to
6210812
Compare
@bors r+ |
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#104786 (Use the power of adding helper function to simplify code w/ `Mutability`) - rust-lang#104788 (Do not record unresolved const vars in generator interior) - rust-lang#104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`) - rust-lang#104921 (Remove unnecessary binder from `get_impl_future_output_ty`) - rust-lang#104924 (jsondoclint: Accept trait alias is places where trait expected.) - rust-lang#104928 (rustdoc: use flexbox CSS to align sidebar button instead of position) - rust-lang#104943 (jsondoclint: Handle using enum variants and glob using enums.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Don't record types in the generator interior when we see unresolved const variables.
We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode.
Fixes #104787