Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move out of self doesn't work #3724

Closed
catamorphism opened this issue Oct 11, 2012 · 3 comments
Closed

Move out of self doesn't work #3724

catamorphism opened this issue Oct 11, 2012 · 3 comments
Labels
A-lifetimes Area: Lifetimes / regions A-trait-system Area: Trait system
Milestone

Comments

@catamorphism
Copy link
Contributor

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;
@nikomatsakis
Copy link
Contributor

This is in borrowck. Should be a fairly straightforward limitation to lift.

@erickt
Copy link
Contributor

erickt commented Nov 27, 2012

I heard a rumor in the irc channel that this was fixed, but I can't figure out how to do it with rust HEAD. Did this get implemented?

@catamorphism
Copy link
Contributor Author

It's implemented now.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 4, 2024
Use the symbol_name query instead of trying to infer from the link_name attribute

This prevents the calculated name from going out of sync with exported_symbols. It also avoids having to special case the panic_impl lang item.

It also makes it easier to fix miri with rust-lang#127173.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-trait-system Area: Trait system
Projects
None yet
Development

No branches or pull requests

3 participants