Skip to content

Trait object coercion regression #16861

Closed
@sfackler

Description

@sfackler

This code has stopped compiling some time in the last week:

trait Foo {}

impl Foo for i32 {}

fn test(_: &[&Foo]) {}

fn main() {
    test([&1i32]);
}
test.rs:8:10: 8:17 error: mismatched types: expected `&[&Foo]`, found `[&i32, .. 1]` (expected &-ptr, found vector)
test.rs:8     test([&1i32]);
                   ^~~~~~~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)A-trait-systemArea: Trait system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions