Skip to content

Trait object coercion does not work with return objects #12744

Closed
@jmgrosen

Description

@jmgrosen
fn foo() -> ~std::any::Any {
    ~3u32
}
test_trait.rs:4:5: 4:10 error: mismatched types: expected `~std::any::Any:Send` but found `~u32` (expected trait std::any::Any but found ~-ptr)
test_trait.rs:4     ~3u32
                    ^~~~~
error: aborting due to previous error

I guess #11156 missed it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions