Skip to content

Move out of self doesn't work #3724

Closed
Closed
@catamorphism

Description

@catamorphism

Move the unwrap_exclusive function in core::private into the impl item just before it (impl<T: Send> Exclusive<T> { ...) and change it to:

    #[inline(always)]
    fn unwrap_exclusive(self) -> T {
        let Exclusive { x: x } <- self;
        let inner = unsafe { unwrap_shared_mutable_state(move x) };
        let ExData { data: data, _ } <- inner;
        move data
    }

This yields:

/Users/tchevalier/rust2/src/libcore/private.rs:548:34: 548:38 error: illegal move from self (cannot move out of a field of self)
/Users/tchevalier/rust2/src/libcore/private.rs:548         let Exclusive { x: x } <- self;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions