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

trans::datum does something incorrect for structs with destructors #6572

Closed
catamorphism opened this issue May 18, 2013 · 7 comments
Closed
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …)

Comments

@catamorphism
Copy link
Contributor

A comment in trans::datum::try_deref suggests that deref'ing a newtype struct with a destructor isn't being done correctly.

@catamorphism
Copy link
Contributor Author

There's a similar comment in trans::expr::trans_def_dps_unadjusted.

@luqmana
Copy link
Member

luqmana commented Jun 1, 2013

#6861 is what the comment in trans::expr::trans_def_dps_unadjusted would be talking about. Addressed by #6889.

@nikomatsakis
Copy link
Contributor

This comment is just out of date. It was referring to the drop field that we add to structs with dtors; we used to insert this in the front, requiring that every index be offset by 1, but I changed it to insert in the back, avoiding that problem. I'll open a PR to remove the FIXME.

@bblum
Copy link
Contributor

bblum commented Aug 16, 2013

@nikomatsakis can this be closed?

@nikomatsakis
Copy link
Contributor

The FIXME is still present, so to close we need to open a PR (and perhaps add a test -- though one probably exists), but yes I believe there is no actual bug here.

@jeremyletang
Copy link
Contributor

@nikomatsakis trans::datum::try_deref and the FIXME doesn't exist anymore.
Maybe this issue can be closed?

@nikomatsakis
Copy link
Contributor

Let's close.

flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 25, 2021
Fix bad suggestion for `match_single_binding` lint

Fix a bad suggestion that needs curly braces when the target `match` is the body of an arm.

Fixes rust-lang#6572

changelog: none
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

5 participants