Skip to content

Unconditionally-const supertraits are considered not dyn compatible #145627

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

Let's save some space in the design of const traits by making dyn Trait where trait Trait: const Super not dyn compatible.

Such a trait cannot satisfy dyn Trait: Trait; we could in the future make this dyn compatible but NOT implement Trait, but that's a bit weird and seems like it needs to be independently justified moving forward.

Fixes #145198

r? fee1-dead

@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 Aug 19, 2025
@compiler-errors compiler-errors force-pushed the const-supertrait-dyn-compat branch from d367474 to a65a29d Compare August 19, 2025 20:43
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. 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.

trait Sub: const Super has unusable dyn
3 participants