librustc: Make C functions unsafe

This commit is contained in:
Patrick Walton
2013-01-23 16:29:31 -08:00
parent e43cff6657
commit 163b97b7bb
43 changed files with 635 additions and 529 deletions

View File

@@ -254,9 +254,13 @@ impl &Arena {
// The external interface
#[inline(always)]
fn alloc<T>(op: fn() -> T) -> &self/T {
if !rusti::needs_drop::<T>() {
self.alloc_pod(op)
} else { self.alloc_nonpod(op) }
unsafe {
if !rusti::needs_drop::<T>() {
self.alloc_pod(op)
} else {
self.alloc_nonpod(op)
}
}
}
}