min_specialization
does not equate T: ~const Trait
with T: Trait
#95187
Labels
A-specialization
Area: Trait impl specialization
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
F-const_trait_impl
`#![feature(const_trait_impl)]`
F-specialization
`#![feature(specialization)]`
requires-nightly
This issue requires a nightly compiler in some way.
Given the following code (playground):
The following error is produced:
This indicates that rustc is not equating the
T: ~const DefaultBound
in the default impl with theT: DefaultBound
in the specialized impl. Rather, it thinks it's a newly-introduced trait bound, and thus it says "cannot specialize on it" since it's not annotated asrustc_specialization_trait
.In my opinion, the
T: ~const DefaultBound
andT: DefaultBound
should be considered equivalent in the context of specialization, and the above code should compile just as the following code does (playground):See also #95186
@rustbot label +F-const_trait_impl +F-specialization +A-specialization +A-traits +requires-nightly
The text was updated successfully, but these errors were encountered: