зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1444151 - Part 2: Make Rust's RefPtr::forget safe, r=froydnj
This commit is contained in:
Родитель
9c3d9faeca
Коммит
944ff7f16d
|
@ -80,8 +80,8 @@ impl <T: RefCounted + 'static> RefPtr<T> {
|
||||||
|
|
||||||
/// Write this RefPtr's value into an outparameter.
|
/// Write this RefPtr's value into an outparameter.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn forget(self, into: &mut *const T) {
|
pub fn forget(self, into: &mut *const T) {
|
||||||
*into = &*self as *const T;
|
*into = &*self;
|
||||||
mem::forget(self);
|
mem::forget(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче