Negative impls of Auto Traits (OIBIT) don't take into account Trait Bounds #46813
Labels
A-specialization
Area: Trait impl specialization
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
The following code fails to compile:
It produces the following error.
(Playpen)
Even though I restrict the
!FooAuto
implementation to types implementingFoo
(which there is none of), the rust compiler does not seem to take that restriction into account. Instead, it removes theFooAuto
auto-implementation from every type.If I remove the
!FooAuto
line, the code compiles just fine.The same problems happens when I use
impl<T: Foo>
instead ofwhere T: Foo
(Playpen).Also using
impl FooAuto for .. {}
instead ofauto trait FooAuto
results in the same problem (Playpen).The text was updated successfully, but these errors were encountered: