diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index a7f3d259fbd..c613d741eb6 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -62,7 +62,7 @@ macro_rules! with_all_bounds { /// NB: We need Clone so that we can derive(Clone) on struct with that /// are parameterized on SelectorImpl. See /// https://github.com/rust-lang/rust/issues/26925 - pub trait SelectorImpl: Clone + Sized { + pub trait SelectorImpl: Clone + Sized + 'static { type AttrValue: $($InSelector)*; type Identifier: $($InSelector)* + PrecomputedHash; type ClassName: $($InSelector)* + PrecomputedHash; diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 8c3c033a8de..d980eb2afab 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -69,7 +69,7 @@ macro_rules! offset_of { /// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references. const MAX_REFCOUNT: usize = (isize::MAX) as usize; -pub struct Arc { +pub struct Arc { // FIXME(bholley): When NonZero/Shared/Unique are stabilized, we should use // Shared here to get the NonZero optimization. Gankro is working on this. // @@ -84,7 +84,7 @@ pub struct Arc { /// /// This lets us build arcs that we can mutate before /// freezing, without needing to change the allocation -pub struct UniqueArc(Arc); +pub struct UniqueArc(Arc); impl UniqueArc { #[inline] @@ -542,7 +542,7 @@ impl HeaderWithLength { } type HeaderSliceWithLength = HeaderSlice, T>; -pub struct ThinArc { +pub struct ThinArc { ptr: *mut ArcInner>, } @@ -563,7 +563,7 @@ fn thin_to_thick(thin: *mut ArcInner>) fake_slice as *mut ArcInner> } -impl ThinArc { +impl ThinArc { /// Temporarily converts |self| into a bonafide Arc and exposes it to the /// provided callback. The refcount is not modified. #[inline(always)] @@ -593,19 +593,19 @@ impl Deref for ThinArc { } } -impl Clone for ThinArc { +impl Clone for ThinArc { fn clone(&self) -> Self { ThinArc::with_arc(self, |a| Arc::into_thin(a.clone())) } } -impl Drop for ThinArc { +impl Drop for ThinArc { fn drop(&mut self) { let _ = Arc::from_thin(ThinArc { ptr: self.ptr }); } } -impl Arc> { +impl Arc> { /// Converts an Arc into a ThinArc. This consumes the Arc, so the refcount /// is not modified. pub fn into_thin(a: Self) -> ThinArc { @@ -630,7 +630,7 @@ impl Arc> { } } -impl PartialEq for ThinArc { +impl PartialEq for ThinArc { fn eq(&self, other: &ThinArc) -> bool { ThinArc::with_arc(self, |a| { ThinArc::with_arc(other, |b| { @@ -640,7 +640,7 @@ impl PartialEq for ThinArc { } } -impl Eq for ThinArc {} +impl Eq for ThinArc {} #[cfg(test)] mod tests { diff --git a/components/style/gecko_bindings/sugar/ownership.rs b/components/style/gecko_bindings/sugar/ownership.rs index 6c4746013b3..0b5111b3870 100644 --- a/components/style/gecko_bindings/sugar/ownership.rs +++ b/components/style/gecko_bindings/sugar/ownership.rs @@ -11,7 +11,7 @@ use std::ptr; use stylearc::Arc; /// Indicates that a given Servo type has a corresponding Gecko FFI type. -pub unsafe trait HasFFI : Sized { +pub unsafe trait HasFFI : Sized + 'static { /// The corresponding Gecko type that this rust type represents. /// /// See the examples in `components/style/gecko/conversions.rs`. diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 4114b2f2b22..1ec0dee0ef7 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2193,7 +2193,7 @@ pub fn get_writing_mode(inheritedbox_style: &style_structs::InheritedBox) -> Wri } /// A reference to a style struct of the parent, or our own style struct. -pub enum StyleStructRef<'a, T: 'a> { +pub enum StyleStructRef<'a, T: 'static> { /// A borrowed struct from the parent, for example, for inheriting style. Borrowed(&'a Arc), /// An owned struct, that we've already mutated.