mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Fix freeze scope extension warning
Fixes #455 (for now) Also add a comment about how what we're doing here is unsafe (for reasons that are mostly unrelated to the warning)
This commit is contained in:
parent
feee4ddcb2
commit
e661ce66b6
1 changed files with 10 additions and 1 deletions
|
@ -608,7 +608,16 @@ impl ScriptTask {
|
||||||
let HtmlParserResult {root, js_port, style_port, iframe_port} = html_parsing_result;
|
let HtmlParserResult {root, js_port, style_port, iframe_port} = html_parsing_result;
|
||||||
|
|
||||||
// Create the window and document objects.
|
// Create the window and document objects.
|
||||||
let window = Window::new(&mut *page, self.chan.clone(), self.compositor);
|
let window = {
|
||||||
|
// Need an extra block here due to Rust #6248
|
||||||
|
//
|
||||||
|
// FIXME(Servo #655): Unrelated to the Rust #6248 warning, this is fundamentally
|
||||||
|
// unsafe because the box could go away or get moved while we're holding this raw
|
||||||
|
// pointer. We think it's safe here because the main task will hold onto the box,
|
||||||
|
// and because the current refcounting implementation of @ doesn't move.
|
||||||
|
let page = &mut *page;
|
||||||
|
Window::new(page, self.chan.clone(), self.compositor)
|
||||||
|
};
|
||||||
let document = HTMLDocument::new(root, Some(window));
|
let document = HTMLDocument::new(root, Some(window));
|
||||||
|
|
||||||
// Tie the root into the document.
|
// Tie the root into the document.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue