mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Cleanup dynamic freeze scope artificially extended warnings
This commit is contained in:
parent
3503cb3df9
commit
c6c9533cd1
3 changed files with 25 additions and 17 deletions
|
@ -165,7 +165,11 @@ impl Drop for Shaper {
|
||||||
|
|
||||||
impl Shaper {
|
impl Shaper {
|
||||||
pub fn new(font: @mut Font) -> 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,
|
let hb_face: *hb_face_t = hb_face_create_for_tables(get_font_table_func,
|
||||||
font_ptr as *c_void,
|
font_ptr as *c_void,
|
||||||
null());
|
null());
|
||||||
|
|
|
@ -135,7 +135,7 @@ pub impl LocalImageCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
priv fn get_state(&self, url: &Url) -> @mut ImageState {
|
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 {
|
let new_state = @mut ImageState {
|
||||||
prefetched: false,
|
prefetched: false,
|
||||||
decoded: false,
|
decoded: false,
|
||||||
|
@ -143,7 +143,8 @@ pub impl LocalImageCache {
|
||||||
last_response: ImageNotReady
|
last_response: ImageNotReady
|
||||||
};
|
};
|
||||||
new_state
|
new_state
|
||||||
}
|
};
|
||||||
|
*state // Unborrowing the state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,8 +201,11 @@ impl ScriptContext {
|
||||||
window_size: Size2D(800, 600),
|
window_size: Size2D(800, 600),
|
||||||
damage: MatchSelectorsDamage,
|
damage: MatchSelectorsDamage,
|
||||||
};
|
};
|
||||||
|
// Indirection for Rust Issue #6248, dynamic freeze scope artifically extended
|
||||||
let script_context_ptr: *ScriptContext = &*script_context;
|
let script_context_ptr = {
|
||||||
|
let borrowed_ctx= &mut *script_context;
|
||||||
|
borrowed_ctx as *mut ScriptContext
|
||||||
|
};
|
||||||
js_context.set_cx_private(script_context_ptr as *());
|
js_context.set_cx_private(script_context_ptr as *());
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue