mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Auto merge of #11641 - Ms2ger:flow-deref-mut-lifetime, r=nox
Correct the signature of flow_ref::deref_mut. This also fixes Undefined Behavior in build_display_list_for_subtree. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11641) <!-- Reviewable:end -->
This commit is contained in:
commit
a316fb73e5
2 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ pub type WeakFlowRef = Weak<Flow>;
|
|||
/// See https://github.com/servo/servo/issues/6503
|
||||
/// Use Arc::get_mut instead when possible (e.g. on an Arc that was just created).
|
||||
#[allow(unsafe_code)]
|
||||
pub fn deref_mut<'a>(r: &mut FlowRef) -> &'a mut Flow {
|
||||
pub fn deref_mut<'a>(r: &'a mut FlowRef) -> &'a mut Flow {
|
||||
let ptr: *const Flow = &**r;
|
||||
unsafe {
|
||||
&mut *(ptr as *mut Flow)
|
||||
|
|
|
@ -87,7 +87,7 @@ pub fn build_display_list_for_subtree(root: &mut FlowRef,
|
|||
&mut root_stacking_context.children);
|
||||
let mut build_display_list = BuildDisplayList {
|
||||
state: DisplayListBuildState::new(&layout_context,
|
||||
flow::base(&**root).stacking_context_id),
|
||||
flow::base(&*flow_root).stacking_context_id),
|
||||
};
|
||||
build_display_list.traverse(&mut *flow_root);
|
||||
build_display_list.state.items
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue