librustc: Fix bug with newtype structs containing dtors

This commit is contained in:
Patrick Walton 2013-03-24 21:04:01 -07:00
parent a376f46862
commit 3b2fcf9f59
2 changed files with 17 additions and 2 deletions

View file

@ -679,7 +679,6 @@ pub impl Datum {
}
let repr = adt::represent_type(ccx, self.ty);
fail_unless!(adt::is_newtypeish(repr));
let ty = ty::subst(ccx.tcx, substs, variants[0].args[0]);
return match self.mode {
ByRef => {
@ -719,7 +718,6 @@ pub impl Datum {
}
let repr = adt::represent_type(ccx, self.ty);
fail_unless!(adt::is_newtypeish(repr));
let ty = fields[0].mt.ty;
return match self.mode {
ByRef => {

View file

@ -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() {
}