Skip to content

An impl on Vec<T> for trait T causes Vec::from_slice to disappear #15060

Closed
@apoelstra

Description

@apoelstra

The code

trait T {}
impl<U: T> Vec<U> {}
fn main() { let r = Vec::from_slice(&[1u]); }

fails with

break.rs:4:21: 4:36 error: unresolved name `Vec::from_slice`.
break.rs:4 fn main() { let r = Vec::from_slice(&[1u]); }

Removing the impl line causes the code to compile fine.

Thx Ms2ger for finding such a small example case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions