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

Allows moving in owned values into multiple closures #7444

Closed
bluss opened this issue Jun 28, 2013 · 3 comments
Closed

Allows moving in owned values into multiple closures #7444

bluss opened this issue Jun 28, 2013 · 3 comments
Assignees
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@bluss
Copy link
Member

bluss commented Jun 28, 2013

The following testcase crashes at runtime when call_f is called the second time. It appears rustc accepts to move the value t into "both" heap closures.

fn call_f(f: ~fn:Owned() -> int) -> int {
    f()
}

fn main() {
    let t = ~3;

    call_f(|| { *t + 1 });
    call_f(|| { *t + 1 });
}

Tested with version f1e09d6 / rustc 0.6 (f1e09d6 2013-06-26 23:07:41 -0700)

Assign to @bblum

@bblum
Copy link
Contributor

bblum commented Jul 6, 2013

More minimal test case is over in the referred bug.

@nikomatsakis
Copy link
Contributor

Interesting, hadn't seen this bug before.

@bluss
Copy link
Member Author

bluss commented Jul 27, 2013

fixed by pull #7849

@bluss bluss closed this as completed Jul 27, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 20, 2022
…=llogiq

Add a suggestion and a note about orphan rules for `from_over_into`

Adds a machine applicable suggestion to convert the `Into` impl into a `From` one to `from_over_into`

Also adds a note explaining that `impl From<Local> for Foreign` is fine if the `Into` type is foreign

Closes rust-lang#7444
Addresses half of rust-lang#9638

changelog: [`from_over_into`] Add a suggestion and a note about orphan rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

3 participants