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 type alias in projected_ty #15297

Merged
merged 1 commit into from Jul 16, 2023
Merged

Normalize type alias in projected_ty #15297

merged 1 commit into from Jul 16, 2023

Conversation

HKalbasi
Copy link
Member

fix #15143

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2023
@HKalbasi
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 16, 2023

📌 Commit 832eb0d has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 16, 2023

⌛ Testing commit 832eb0d with merge d824511...

@bors
Copy link
Collaborator

bors commented Jul 16, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing d824511 to master...

@bors bors merged commit d824511 into rust-lang:master Jul 16, 2023
10 checks passed
db: &dyn HirDatabase,
closure_field: impl FnOnce(ClosureId, &Substitution, usize) -> Ty,
krate: CrateId,
) -> Ty {
if matches!(base.data(Interner).kind, TyKind::Alias(_) | TyKind::AssociatedType(..)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TyKind::AssociatedType won't get normalized as it represents an unnormalizable associated type as in <T as Trait>::Assoc where T is a generic param.

Also, I noticed you occasionally use ty.data(Interner).kind instead of ty.kind(Interner). Even though they don't make any difference performance-wise, I'd say the latter conveys the intention of the code better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"internal error: entered unreachable code: Only adt has field"
4 participants