diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs index 7b5c349c..3cf4f780 100644 --- a/native/src/widget/button.rs +++ b/native/src/widget/button.rs @@ -143,7 +143,7 @@ impl State { impl<'a, Message, Renderer> Widget for Button<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, Message: Clone, { fn width(&self) -> Length { @@ -234,7 +234,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.width.hash(state); self.content.hash_layout(state); @@ -276,7 +277,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a + Clone, { fn from( diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index ccf13848..d611993f 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -110,7 +110,7 @@ impl impl Widget for Checkbox where - Renderer: 'static + self::Renderer + text::Renderer + row::Renderer, + Renderer: self::Renderer + text::Renderer + row::Renderer, { fn width(&self) -> Length { self.width @@ -205,7 +205,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.label.hash(state); } @@ -254,7 +255,7 @@ pub trait Renderer: crate::Renderer { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer + text::Renderer + row::Renderer, + Renderer: 'a + self::Renderer + text::Renderer + row::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index 77b8496b..259a7e6e 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -124,7 +124,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { impl<'a, Message, Renderer> Widget for Column<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -190,7 +190,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.width.hash(state); self.height.hash(state); @@ -234,7 +235,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs index 34032c3a..2590fe3b 100644 --- a/native/src/widget/container.rs +++ b/native/src/widget/container.rs @@ -132,7 +132,7 @@ where impl<'a, Message, Renderer> Widget for Container<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -203,7 +203,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.padding.hash(state); self.width.hash(state); @@ -243,7 +244,7 @@ pub trait Renderer: crate::Renderer { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs index 0f38a90e..6bd0fd68 100644 --- a/native/src/widget/image.rs +++ b/native/src/widget/image.rs @@ -102,7 +102,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.handle.hash(state); self.width.hash(state); diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index f6dd328e..f84775ed 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -356,7 +356,7 @@ pub struct KeyPressEvent { impl<'a, Message, Renderer> Widget for PaneGrid<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -597,8 +597,9 @@ where fn hash_layout(&self, state: &mut Hasher) { use std::hash::Hash; + struct Marker; + std::any::TypeId::of::().hash(state); - std::any::TypeId::of::>().hash(state); self.width.hash(state); self.height.hash(state); self.state.hash_layout(state); @@ -643,7 +644,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/progress_bar.rs b/native/src/widget/progress_bar.rs index 897edb30..5ab76d47 100644 --- a/native/src/widget/progress_bar.rs +++ b/native/src/widget/progress_bar.rs @@ -72,7 +72,7 @@ impl ProgressBar { impl Widget for ProgressBar where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -114,7 +114,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.width.hash(state); self.height.hash(state); @@ -159,7 +160,7 @@ pub trait Renderer: crate::Renderer { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index bc23c116..0ec621bf 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -82,7 +82,7 @@ impl Radio { impl Widget for Radio where - Renderer: 'static + self::Renderer + text::Renderer + row::Renderer, + Renderer: self::Renderer + text::Renderer + row::Renderer, Message: Clone, { fn width(&self) -> Length { @@ -174,7 +174,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.label.hash(state); } @@ -218,7 +219,7 @@ pub trait Renderer: crate::Renderer { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer + row::Renderer + text::Renderer, + Renderer: 'a + self::Renderer + row::Renderer + text::Renderer, Message: 'a + Clone, { fn from(radio: Radio) -> Element<'a, Message, Renderer> { diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index 5f139f66..31f7472f 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -125,7 +125,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { impl<'a, Message, Renderer> Widget for Row<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -191,7 +191,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.width.hash(state); self.height.hash(state); @@ -236,7 +237,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from(row: Row<'a, Message, Renderer>) -> Element<'a, Message, Renderer> { diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index ba39edb1..393095a4 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -115,7 +115,7 @@ impl<'a, Message, Renderer: self::Renderer> Scrollable<'a, Message, Renderer> { impl<'a, Message, Renderer> Widget for Scrollable<'a, Message, Renderer> where - Renderer: 'static + self::Renderer + column::Renderer, + Renderer: self::Renderer + column::Renderer, { fn width(&self) -> Length { Widget::::width(&self.content) @@ -311,7 +311,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.height.hash(state); self.max_height.hash(state); @@ -505,7 +506,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer + column::Renderer, + Renderer: 'a + self::Renderer + column::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs index b2fa5c9d..1feb7825 100644 --- a/native/src/widget/slider.rs +++ b/native/src/widget/slider.rs @@ -114,7 +114,7 @@ impl State { impl<'a, Message, Renderer> Widget for Slider<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, { fn width(&self) -> Length { self.width @@ -205,7 +205,8 @@ where } fn hash_layout(&self, state: &mut Hasher) { - std::any::TypeId::of::>().hash(state); + struct Marker; + std::any::TypeId::of::().hash(state); self.width.hash(state); } @@ -253,7 +254,7 @@ pub trait Renderer: crate::Renderer { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a, { fn from( diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index ae3d74ae..7d1a7415 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -171,7 +171,7 @@ impl<'a, Message, Renderer: self::Renderer> TextInput<'a, Message, Renderer> { impl<'a, Message, Renderer> Widget for TextInput<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: self::Renderer, Message: Clone, { fn width(&self) -> Length { @@ -526,8 +526,8 @@ where fn hash_layout(&self, state: &mut Hasher) { use std::{any::TypeId, hash::Hash}; - - TypeId::of::>().hash(state); + struct Marker; + TypeId::of::().hash(state); self.width.hash(state); self.max_width.hash(state); @@ -632,7 +632,7 @@ pub trait Renderer: crate::Renderer + Sized { impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where - Renderer: 'static + self::Renderer, + Renderer: 'a + self::Renderer, Message: 'a + Clone, { fn from(