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

fix: Fix a crash introduced in #13147 #13257

Merged
merged 1 commit into from Sep 19, 2022

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Sep 19, 2022

@lnicola
Copy link
Member Author

lnicola commented Sep 19, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

📌 Commit 878a403 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

⌛ Testing commit 878a403 with merge 10d193d...

bors added a commit that referenced this pull request Sep 19, 2022
@lnicola
Copy link
Member Author

lnicola commented Sep 19, 2022

@bors r-

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

☀️ Try build successful - checks-actions
Build commit: 10d193d (10d193d2903511b3f4cb54bed528b8cdab423b30)

@lnicola lnicola force-pushed the revert-13147-fix/dyn-ty-inherent-methods branch from 878a403 to e54f61d Compare September 19, 2022 09:45
@lnicola lnicola changed the title Revert "fix: handle trait methods as inherent methods for trait-related types" fix: Fix a crash introduced in #13147 Sep 19, 2022
@lnicola
Copy link
Member Author

lnicola commented Sep 19, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

📌 Commit e54f61d has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

⌛ Testing commit e54f61d with merge 187bee0...

@lnicola
Copy link
Member Author

lnicola commented Sep 19, 2022

CC @lowr

@bors
Copy link
Collaborator

bors commented Sep 19, 2022

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 187bee0 to master...

@bors bors merged commit 187bee0 into master Sep 19, 2022
@bors bors deleted the revert-13147-fix/dyn-ty-inherent-methods branch September 19, 2022 09:55
bors added a commit that referenced this pull request Sep 19, 2022
Ensure at least one trait bound in `TyKind::DynTy`

One would expect `TyKind::DynTy` to have at least one trait bound, but we may produce a dyn type with no trait bounds at all. This patch prevents it by returning `TyKind::Error` in such cases.

An "empty" dyn type would have caused panic during method resolution without #13257. Although already fixed, I think an invariant to never produce such types would help prevent similar problems in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants