Cleanup dynamic freeze scope artificially extended warnings

This commit is contained in:
JJ Weber 2013-05-25 15:10:06 -07:00
parent 3503cb3df9
commit c6c9533cd1
3 changed files with 25 additions and 17 deletions

View file

@ -165,7 +165,11 @@ impl Drop for Shaper {
impl Shaper {
pub fn new(font: @mut Font) -> Shaper {
let font_ptr: *mut Font = &mut *font;
// Indirection for Rust Issue #6248, dynamic freeze scope artifically extended
let font_ptr = {
let borrowed_font= &mut *font;
borrowed_font as *mut Font
};
let hb_face: *hb_face_t = hb_face_create_for_tables(get_font_table_func,
font_ptr as *c_void,
null());

View file

@ -135,7 +135,7 @@ pub impl LocalImageCache {
}
priv fn get_state(&self, url: &Url) -> @mut ImageState {
*do self.state_map.find_or_insert_with(url.clone()) |_| {
let state = do self.state_map.find_or_insert_with(url.clone()) |_| {
let new_state = @mut ImageState {
prefetched: false,
decoded: false,
@ -143,7 +143,8 @@ pub impl LocalImageCache {
last_response: ImageNotReady
};
new_state
}
};
*state // Unborrowing the state
}
}

View file

@ -201,8 +201,11 @@ impl ScriptContext {
window_size: Size2D(800, 600),
damage: MatchSelectorsDamage,
};
let script_context_ptr: *ScriptContext = &*script_context;
// Indirection for Rust Issue #6248, dynamic freeze scope artifically extended
let script_context_ptr = {
let borrowed_ctx= &mut *script_context;
borrowed_ctx as *mut ScriptContext
};
js_context.set_cx_private(script_context_ptr as *());
unsafe {