-
Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
I tried this code:
mod supertrait {
trait V<T> {}
trait A : V<u32> {}
struct T {}
impl A for T {}
impl V<u32> for T {}
impl V<i32> for dyn A {} // `(dyn A + 'static)` automatically implements trait `V`
}
mod nosupertrait {
trait V<T> {}
trait A {}
struct T {}
impl A for T {}
impl V<u32> for T {}
impl V<i32> for dyn A {} // ok
}I expected to see this happen: No error in either case.
Instead, this happened: Using a supertrait causes the compiler to complain about auto implemented trait as if type parameters are not being taken into account.
Meta
rustc --version --verbose:
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: x86_64-pc-windows-msvc
release: 1.88.0
LLVM version: 20.1.5
Backtrace
<backtrace>
Metadata
Metadata
Assignees
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.