Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
lowr:patch/no-dyn-without-trait
Sep 19, 2022
Merged

Ensure at least one trait bound in TyKind::DynTy#13264
bors merged 1 commit into
rust-lang:masterfrom
lowr:patch/no-dyn-without-trait

Conversation

@lowr

@lowr lowr commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

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

Veykril commented Sep 19, 2022

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

📌 Commit 9845e37 has been approved by Veykril

It is now in the queue for this repository.

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9845e37 with merge bde76b9...

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

☀️ 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