You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// another crate which depends on provideruse provider::{Marker,Unpacked,Wrapper};structMarked;implMarkerforMarked{}structInto;implFrom<<Wrapper<Marked>asUnpacked>::Inner>forInto{fnfrom(_: <Wrapper<Marked>asUnpacked>::Inner) -> Self{Self}}
The current output is:
error[E0119]: conflicting implementations of trait `std::convert::From<Into>` for type `Into`
--> src/lib.rs:9:1
|
9 | impl From<<Wrapper<Marked> as Unpacked>::Inner> for Into {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> From<T> for T;
= note: upstream crates may add a new impl of trait `provider::Marker` for type `provider::Wrapper<Marked>` in future versions
Basically I'm trying to work around not having specialisation by using Wrapper type: one behaviour for Marker implementors and second one for the Wapper<T> where T: Marker. Then I try to describe trait, which will UnpackWrapper or resolve Marker itself. Everything is fine, until I try to use those traits in another crate.
I vaguely do understand, that compiler may look at impl<T: Marker> Unpacked for T { .. } blanket impl and figure out that Marker implementation theoretically may be added in the future. But clearly these can't be done because of already existing impl impl<T: Marker> Unpacked for Wrapper<T> { .. }. Is this an ok behaviour of the compiler or a bug? And if this is a valid error where I can find more info about restrictions?
The text was updated successfully, but these errors were encountered:
Given the following code:
The current output is:
Basically I'm trying to work around not having specialisation by using
Wrapper
type: one behaviour forMarker
implementors and second one for theWapper<T> where T: Marker
. Then I try to describe trait, which willUnpack
Wrapper
or resolveMarker
itself. Everything is fine, until I try to use those traits in another crate.I vaguely do understand, that compiler may look at
impl<T: Marker> Unpacked for T { .. }
blanket impl and figure out thatMarker
implementation theoretically may be added in the future. But clearly these can't be done because of already existing implimpl<T: Marker> Unpacked for Wrapper<T> { .. }
. Is this an ok behaviour of the compiler or a bug? And if this is a valid error where I can find more info about restrictions?The text was updated successfully, but these errors were encountered: