Skip to content

Can't provide non-overlapping impls with *any* type parameters, if a blanket impl exists #30191

@sgrif

Description

@sgrif
use std::convert::Into;

struct Foo;

impl<T> Into<T> for Foo where T: From<String> {
    fn into(self) -> T {
        "foo".into()
    }
}

fn main() {}

This fails due to the blanket impl on Into for From in libcore, even though Foo does not implement From.

Possibly related to, but appears to be distinct from #20400 and #23341

Metadata

Metadata

Assignees

Labels

A-trait-systemArea: Trait systemI-needs-decisionIssue: In need of a decision.T-langRelevant to the language team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions