forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librustc: Fix bug with newtype structs containing dtors
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use core::libc::c_int; | ||
use core::libc; | ||
|
||
pub struct Fd(c_int); | ||
|
||
impl Drop for Fd { | ||
fn finalize(&self) { | ||
unsafe { | ||
libc::close(**self); | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
} | ||
|
||
|
9e26d16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+
is_newtypepish
is unused after this change, and I was already wondering whether it even made sense to have it before I knew about this bug, so we might want to just remove it as a followup change.