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

"let _ = foo" destructor semantics is broken #8194

Closed
bblum opened this issue Aug 1, 2013 · 1 comment
Closed

"let _ = foo" destructor semantics is broken #8194

bblum opened this issue Aug 1, 2013 · 1 comment
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …)

Comments

@bblum
Copy link
Contributor

bblum commented Aug 1, 2013

What this ought to do in the long term is under discussion in #3181, but I'm pretty sure some bug broke the current behaviour.

Test case:

struct Foo;

impl Drop for Foo {
    fn drop(&self) {
        error!("this oughta happen first");
    }
}

fn foo(foo: Foo) {
    // { use std::util; util::ignore(foo); } // this works as expected
    let _ = foo; // this doesn't
    // { let _ = foo; } // behaves the same as without the braces
    error!("this oughta happen second");
}

fn main() {
    foo(Foo);
}
@alexcrichton
Copy link
Member

Closing as a dupe of #10488.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …)
Projects
None yet
Development

No branches or pull requests

2 participants