1
Fork 0

core: Rename 'unsafe' mod to 'cast'

This commit is contained in:
Brian Anderson 2012-09-18 17:34:08 -07:00
parent 77480e8e44
commit 2906f2de31
51 changed files with 218 additions and 218 deletions

View file

@ -359,7 +359,7 @@ impl<T: Const Send> &RWARC<T> {
// Whatever region the input reference had, it will be safe to use
// the same region for the output reference. (The only 'unsafe' part
// of this cast is removing the mutability.)
let new_data = unsafe { unsafe::transmute_immut(data) };
let new_data = unsafe { cast::transmute_immut(data) };
// Downgrade ensured the token belonged to us. Just a sanity check.
assert ptr::ref_eq(&state.data, new_data);
// Produce new token
@ -390,7 +390,7 @@ fn unwrap_rw_arc<T: Const Send>(+arc: RWARC<T>) -> T {
// field is never overwritten; only 'failed' and 'data'.
#[doc(hidden)]
fn borrow_rwlock<T: Const Send>(state: &r/mut RWARCInner<T>) -> &r/RWlock {
unsafe { unsafe::transmute_immut(&mut state.lock) }
unsafe { cast::transmute_immut(&mut state.lock) }
}
// FIXME (#3154) ice with struct/&<T> prevents these from being structs.