Skip to content

failure to infer move mode for a variable when the move is from *x #23675

Closed
@nikomatsakis

Description

@nikomatsakis

Example (play: http://is.gd/idpRaW)

use std::mem;
struct Trace;
fn foo(b: Box<Trace>) {
    do1(|| mem::drop(*b));
}
fn do1<F:FnOnce()>(f: F) { }
fn main() { }

If you change mem::drop(*b) to mem::drop(b), it compiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions