-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Description
This won't work:
pub struct Wrapper<T>(T);
impl<T> From<Wrapper<T>> for T {
fn from(val: Wrapper<T>) -> T { val.0 }
}
and neither will:
pub struct Wrapper<T>(T);
impl<T> Into<T> for Wrapper<T> {
fn into(self) -> T { self.0 }
}
In previous (post-1.0) versions of the compiler, the latter was able to be implemented, however, now it's seen as conflicting with impl<T, U> Into<U> for T where U: From<T>
, which is definitely the correct behaviour.
But right now, not being able to implement From
for this case seems very much to me like a bug.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team