-
-
Notifications
You must be signed in to change notification settings - Fork 15k
min_specialization does not equate T: ~const Trait with T: Trait #95187
Copy link
Copy link
Closed
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-specialization`#![feature(specialization)]``#![feature(specialization)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-specialization`#![feature(specialization)]``#![feature(specialization)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given the following code (playground):
The following error is produced:
This indicates that rustc is not equating the
T: ~const DefaultBoundin the default impl with theT: DefaultBoundin 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 DefaultBoundandT: DefaultBoundshould 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