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

Normalize lazy type aliases when probing for ADTs #113755

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

fmease
Copy link
Member

@fmease fmease commented Jul 16, 2023

Fixes #113736.

r? @oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 16, 2023
@@ -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() =>
Copy link
Member Author

@fmease fmease Jul 16, 2023

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.

Copy link
Member

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...

@oli-obk
Copy link
Contributor

oli-obk commented Jul 16, 2023

@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

@bors
Copy link
Contributor

bors commented Jul 16, 2023

📌 Commit c856c74 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 16, 2023
…s, r=oli-obk

Normalize lazy type aliases when probing for ADTs

Fixes rust-lang#113736.

r? `@oli-obk`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 16, 2023
…s, r=oli-obk

Normalize lazy type aliases when probing for ADTs

Fixes rust-lang#113736.

r? ``@oli-obk``
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2023
…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
@bors bors merged commit b42ada2 into rust-lang:master Jul 17, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Jul 17, 2023
@fmease fmease deleted the probe-adt-norm-lazy-ty-alias branch July 17, 2023 01:46
@fmease fmease added the F-lazy_type_alias `#![feature(lazy_type_alias)]` label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-lazy_type_alias `#![feature(lazy_type_alias)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: lazy_type_alias None in compiler/rustc_hir_analysis/src/astconv/mod.rs
5 participants