Skip to content

Ensure at least one trait bound in TyKind::DynTy #13264

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

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

lowr
Copy link
Contributor

@lowr lowr commented Sep 19, 2022

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.

@Veykril
Copy link
Member

Veykril commented Sep 19, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2022

📌 Commit 9845e37 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 19, 2022

⌛ Testing commit 9845e37 with merge bde76b9...

@bors
Copy link
Contributor

bors commented Sep 19, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing bde76b9 to master...

@bors bors merged commit bde76b9 into rust-lang:master Sep 19, 2022
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.

3 participants