-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Normalize lazy type aliases when probing for ADTs #113755
Conversation
@@ -302,7 +302,9 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> { | |||
match ty.kind() { | |||
ty::Adt(adt_def, _) => Some(*adt_def), | |||
// FIXME(#104767): Should we handle bound regions here? | |||
ty::Alias(ty::Projection | ty::Inherent, _) if !ty.has_escaping_bound_vars() => { | |||
ty::Alias(ty::Projection | ty::Inherent | ty::Weak, _) | |||
if !ty.has_escaping_bound_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.
Couldn't come up with a snippet containing a weak type alias in expression position that has escaping bound 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.
Can't have it in path expressions, which is where this would be encountered afaict.
Also, should we only normalize away the layers of lazy type alias? This also has the side effect of an alias that normalizes to a regular projection gets normalized.
Why don't we normalize here to begin with? Does @aliemjay know?
self_ty.map(|ty| ty.raw), |
Ideally, this would just pass ty.normalized
instead of ty.raw
...
@bors r+ rollup Yeap, this feature is very incomplete. I'll need to come up with a plan for finishing it. But fuzzing for ices is a great way to find the worst issues |
…s, r=oli-obk Normalize lazy type aliases when probing for ADTs Fixes rust-lang#113736. r? `@oli-obk`
…s, r=oli-obk Normalize lazy type aliases when probing for ADTs Fixes rust-lang#113736. r? ``@oli-obk``
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#113042 (Add Platform Support documentation for MIPS Release 6 targets) - rust-lang#113539 (fixed typo) - rust-lang#113614 (platform-support.md: It's now verified that NetBSD/riscv64 can self-h…) - rust-lang#113750 (Add missing italicization to `sort_unstable_by_key` complexity ) - rust-lang#113755 (Normalize lazy type aliases when probing for ADTs) - rust-lang#113756 (fix wrong link) - rust-lang#113762 (Fix typo) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #113736.
r? @oli-obk