Skip to content

Commit

Permalink
Auto merge of #26190 - servo:unstable, r=nox
Browse files Browse the repository at this point in the history
Remove use of soon-to-be-deprecated unstable feature

rust-lang/rust#47336 (comment)
  • Loading branch information
bors-servo authored Apr 16, 2020
2 parents 16230ee + 6175a68 commit a4fbad2
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 19 deletions.
8 changes: 6 additions & 2 deletions components/layout_2020/flow/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ impl InlineFormattingContext {
panic!("display:none does not generate an abspos box")
},
};
let hoisted_box = box_.clone().to_hoisted(initial_start_corner, tree_rank);
let hoisted_box = AbsolutelyPositionedBox::to_hoisted(
box_.clone(),
initial_start_corner,
tree_rank,
);
let hoisted_fragment = hoisted_box.fragment.clone();
ifc.push_hoisted_box_to_positioning_context(hoisted_box);
ifc.current_nesting_level.fragments_so_far.push(
Expand Down Expand Up @@ -786,7 +790,7 @@ impl TextRun {
glyphs,
text_decoration_line: ifc.current_nesting_level.text_decoration_line,
}));
if runs.is_empty() {
if runs.as_slice().is_empty() {
break;
} else {
// New line
Expand Down
3 changes: 2 additions & 1 deletion components/layout_2020/flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ impl BlockLevelBox {
))
},
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
let hoisted_box = box_.clone().to_hoisted(Vec2::zero(), tree_rank);
let hoisted_box =
AbsolutelyPositionedBox::to_hoisted(box_.clone(), Vec2::zero(), tree_rank);
let hoisted_fragment = hoisted_box.fragment.clone();
positioning_context.push(hoisted_box);
Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment {
Expand Down
2 changes: 0 additions & 2 deletions components/layout_2020/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#![deny(unsafe_code)]
#![feature(arbitrary_self_types)]
#![feature(exact_size_is_empty)]

#[macro_use]
extern crate serde;
Expand Down
6 changes: 3 additions & 3 deletions components/layout_2020/positioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl AbsolutelyPositionedBox {
}

pub(crate) fn to_hoisted(
self: Arc<Self>,
self_: Arc<Self>,
initial_start_corner: Vec2<Length>,
tree_rank: usize,
) -> HoistedAbsolutelyPositionedBox {
Expand All @@ -124,7 +124,7 @@ impl AbsolutelyPositionedBox {
}
}

let box_offsets = self.contents.style.box_offsets();
let box_offsets = self_.contents.style.box_offsets();
HoistedAbsolutelyPositionedBox {
tree_rank,
box_offsets: Vec2 {
Expand All @@ -140,7 +140,7 @@ impl AbsolutelyPositionedBox {
),
},
fragment: ArcRefCell::new(None),
absolutely_positioned_box: self,
absolutely_positioned_box: self_,
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions components/script/dom/bindings/codegen/CodegenRust.py
Original file line number Diff line number Diff line change
Expand Up @@ -3992,8 +3992,8 @@ def jitInfoInitializer(isTypedMethod):
protoID: PrototypeList::ID::${name} as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: ${depth} },
_bitfield_1: unsafe {
mem::transmute(new_jsjitinfo_bitfield_1!(
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::${opType} as u8,
JSJitInfo_AliasSet::${aliasSet} as u8,
JSValueType::${returnType} as u8,
Expand All @@ -4004,8 +4004,8 @@ def jitInfoInitializer(isTypedMethod):
${isLazilyCachedInSlot},
${isTypedMethod},
${slotIndex},
))
},
).to_ne_bytes()
),
}
""",
opName=opName,
Expand Down Expand Up @@ -5988,6 +5988,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'js::error::throw_type_error',
'js::error::throw_internal_error',
'js::rust::wrappers::Call',
'js::jsapi::__BindgenBitfieldUnit',
'js::jsapi::CallArgs',
'js::jsapi::CurrentGlobalOrNull',
'js::rust::wrappers::GetPropertyKeys',
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/bindings/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ where
#[allow(unrooted_must_root)]
pub unsafe fn from_box(value: Box<T>) -> Self {
Self {
ptr: Box::into_raw_non_null(value),
ptr: Box::leak(value).into(),
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions components/script/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#![feature(box_into_raw_non_null)]
#![feature(const_fn)]
#![feature(const_transmute)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![feature(inner_deref)]
#![feature(plugin)]
#![feature(register_tool)]
#![deny(unsafe_code)]
Expand Down
1 change: 0 additions & 1 deletion components/script_layout_interface/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! to depend on script.
#![deny(unsafe_code)]
#![feature(box_into_raw_non_null)]

#[macro_use]
extern crate html5ever;
Expand Down
2 changes: 0 additions & 2 deletions ports/glutin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
//!
//! [glutin]: https://github.com/tomaka/glutin
#![feature(core_intrinsics)]

#[cfg(not(target_os = "android"))]
include!("main2.rs");

Expand Down

0 comments on commit a4fbad2

Please sign in to comment.