Skip to content

Type inference failure when cloning #19855

Closed
@sfackler

Description

@sfackler
fn foo() -> String {
    let x = std::default::Default::default();
    drop(x.clone());
    x
}

fn main() {}
test.rs:3:10: 3:19 error: the type of this value must be known in this context
test.rs:3     drop(x.clone());
                   ^~~~~~~~~
error: aborting due to previous error

cc @nikomatsakis

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions