librustc: Make C functions unsafe
This commit is contained in:
parent
e43cff6657
commit
163b97b7bb
43 changed files with 635 additions and 529 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue