Skip to content

The implementation From<&[T; N]> for Option<&[T]> seems missing #125600

Closed
@minghuaw

Description

@minghuaw

The following code currently does not compile

fn foo<'a>(a: impl Into<Option<&'a [i32]>>) { }

fn main() {
    // error[E0277]: the trait bound `Option<&[i32]>: From<&[{integer}; 3]>` is not satisfied
    foo(&[1,2,3]);

    // error[E0277]: the trait bound `Option<&[i32]>: From<Option<&[{integer}; 3]>>` is not satisfied
    foo(Some(&[1,2,3]));
}

Kindly raising this as an issue because something similar was recently merged #113489

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions