diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs index 7b5c349cc1..409ec41d81 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 ButtonWidget; + 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 ccf1384823..482e379fa8 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 CheckboxWidget; + 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 77b8496bae..ee02244d2b 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 ColumnWidget; + 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 34032c3a59..3b661c059c 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 ContainerWidget; + 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/pane_grid.rs b/native/src/widget/pane_grid.rs index f6dd328e7f..08b530c4a7 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; - - std::any::TypeId::of::>().hash(state); + struct PaneGridWidget; + 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 897edb30c4..0e6e9367fa 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 ProgressBarWidget; + 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 bc23c1163a..c1e36e3d17 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 RadioWidget; + 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 5f139f6615..405ba001f5 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 RowWidget; + 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 ba39edb10e..f1506a3e89 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 ScrollableWidget; + 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 b2fa5c9d39..3e8c836e3f 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 SliderWidget; + 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 ae3d74ae65..7a171d572e 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 TextInputWidget; + 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(