guix: use rust 1.65 to build the GUI

This allows to get rid of the last patch that was necessary to build the
GUI! 🎉
This commit is contained in:
Antoine Poinsot 2023-03-30 14:05:26 +02:00
parent b295637101
commit 2596e03a9f
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304
2 changed files with 1 additions and 482 deletions

View File

@ -24,5 +24,5 @@
(if
(string=? is_gui "1")
(list
(@@ (gnu packages rust) rust-1.64))
(@@ (gnu packages rust) rust-1.65))
'())))))

View File

@ -1,481 +0,0 @@
commit f71bc71bf6724a1c5e2a3246dd8bd0a90fcf0e15
Author: Antoine Poinsot <darosior@protonmail.com>
Date: Thu Dec 1 15:38:32 2022 +0100
Do not use, or special-case them, unstable features as of 1.60.0
This is in order to make the GUI MSRV effectively 1.60.0.
Default derivation on enums is removed.
Usage of bool_to_option is removed.
Generic associated types is unfortunately special cased as enabled. This
forces use to set RUSTC_BOOTSTRAP=1 in the Guix container...
diff --git a/iced_glow/src/lib.rs b/iced_glow/src/lib.rs
index e3690a69..b5b9cc38 100644
--- a/iced_glow/src/lib.rs
+++ b/iced_glow/src/lib.rs
@@ -20,6 +20,7 @@
#![forbid(rust_2018_idioms)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![feature(generic_associated_types)]
pub use glow;
diff --git a/iced_graphics/src/lib.rs b/iced_graphics/src/lib.rs
index d39dd90c..876b478f 100644
--- a/iced_graphics/src/lib.rs
+++ b/iced_graphics/src/lib.rs
@@ -21,6 +21,7 @@
#![forbid(rust_2018_idioms)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![feature(generic_associated_types)]
mod antialiasing;
mod error;
mod primitive;
diff --git a/iced_native/src/program/state.rs b/iced_native/src/program/state.rs
index 8ae1cacb..25a3028b 100644
--- a/iced_native/src/program/state.rs
+++ b/iced_native/src/program/state.rs
@@ -120,7 +120,11 @@ where
.iter()
.zip(event_statuses)
.filter_map(|(event, status)| {
- matches!(status, event::Status::Ignored).then_some(event)
+ if matches!(status, event::Status::Ignored) {
+ Some(event)
+ } else {
+ None
+ }
})
.cloned()
.collect();
diff --git a/iced_style/src/theme.rs b/iced_style/src/theme.rs
index 55bfa4ca..e29fde31 100644
--- a/iced_style/src/theme.rs
+++ b/iced_style/src/theme.rs
@@ -26,10 +26,9 @@ use iced_core::{Background, Color, Vector};
use std::rc::Rc;
/// A built-in theme.
-#[derive(Debug, Clone, PartialEq, Default)]
+#[derive(Debug, Clone, PartialEq)]
pub enum Theme {
/// The built-in light variant.
- #[default]
Light,
/// The built-in dark variant.
Dark,
@@ -62,6 +61,12 @@ impl Theme {
}
}
+impl Default for Theme {
+ fn default() -> Self {
+ Self::Light
+ }
+}
+
/// A [`Theme`] with a customized [`Palette`].
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Custom {
@@ -80,15 +85,19 @@ impl Custom {
}
/// The style of an application.
-#[derive(Default)]
pub enum Application {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn application::StyleSheet<Style = Theme>>),
}
+impl Default for Application {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl application::StyleSheet for Theme {
type Style = Application;
@@ -120,10 +129,11 @@ impl From<fn(&Theme) -> application::Appearance> for Application {
}
/// The style of a button.
-#[derive(Default)]
+/*
+ * Button
+ */
pub enum Button {
/// The primary style.
- #[default]
Primary,
/// The secondary style.
Secondary,
@@ -139,6 +149,12 @@ pub enum Button {
Custom(Box<dyn button::StyleSheet<Style = Theme>>),
}
+impl Default for Button {
+ fn default() -> Self {
+ Self::Primary
+ }
+}
+
impl button::StyleSheet for Theme {
type Style = Button;
@@ -228,10 +244,11 @@ impl button::StyleSheet for Theme {
}
/// The style of a checkbox.
-#[derive(Default)]
+/*
+ * Checkbox
+ */
pub enum Checkbox {
/// The primary style.
- #[default]
Primary,
/// The secondary style.
Secondary,
@@ -243,6 +260,12 @@ pub enum Checkbox {
Custom(Box<dyn checkbox::StyleSheet<Style = Theme>>),
}
+impl Default for Checkbox {
+ fn default() -> Self {
+ Self::Primary
+ }
+}
+
impl checkbox::StyleSheet for Theme {
type Style = Checkbox;
@@ -340,10 +363,11 @@ fn checkbox_appearance(
}
/// The style of a container.
-#[derive(Default)]
+/*
+ * Container
+ */
pub enum Container {
/// No style.
- #[default]
Transparent,
/// A simple box.
Box,
@@ -351,6 +375,12 @@ pub enum Container {
Custom(Box<dyn container::StyleSheet<Style = Theme>>),
}
+impl Default for Container {
+ fn default() -> Self {
+ Self::Transparent
+ }
+}
+
impl From<fn(&Theme) -> container::Appearance> for Container {
fn from(f: fn(&Theme) -> container::Appearance) -> Self {
Self::Custom(Box::new(f))
@@ -388,15 +418,19 @@ impl container::StyleSheet for fn(&Theme) -> container::Appearance {
}
/// The style of a slider.
-#[derive(Default)]
pub enum Slider {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn slider::StyleSheet<Style = Theme>>),
}
+impl Default for Slider {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl slider::StyleSheet for Theme {
type Style = Slider;
@@ -469,15 +503,20 @@ impl slider::StyleSheet for Theme {
}
/// The style of a menu.
-#[derive(Clone, Default)]
+#[derive(Clone)]
pub enum Menu {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Rc<dyn menu::StyleSheet<Style = Theme>>),
}
+impl Default for Menu {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl menu::StyleSheet for Theme {
type Style = Menu;
@@ -511,10 +550,9 @@ impl From<PickList> for Menu {
}
/// The style of a pick list.
-#[derive(Clone, Default)]
+#[derive(Clone)]
pub enum PickList {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(
@@ -523,6 +561,12 @@ pub enum PickList {
),
}
+impl Default for PickList {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl pick_list::StyleSheet for Theme {
type Style = PickList;
@@ -566,15 +610,19 @@ impl pick_list::StyleSheet for Theme {
}
/// The style of a radio button.
-#[derive(Default)]
pub enum Radio {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn radio::StyleSheet<Style = Theme>>),
}
+impl Default for Radio {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl radio::StyleSheet for Theme {
type Style = Radio;
@@ -621,15 +669,19 @@ impl radio::StyleSheet for Theme {
}
/// The style of a toggler.
-#[derive(Default)]
pub enum Toggler {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn toggler::StyleSheet<Style = Theme>>),
}
+impl Default for Toggler {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl toggler::StyleSheet for Theme {
type Style = Toggler;
@@ -688,15 +740,19 @@ impl toggler::StyleSheet for Theme {
}
/// The style of a pane grid.
-#[derive(Default)]
pub enum PaneGrid {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn pane_grid::StyleSheet<Style = Theme>>),
}
+impl Default for PaneGrid {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl pane_grid::StyleSheet for Theme {
type Style = PaneGrid;
@@ -730,10 +786,11 @@ impl pane_grid::StyleSheet for Theme {
}
/// The style of a progress bar.
-#[derive(Default)]
+/*
+ * Progress Bar
+ */
pub enum ProgressBar {
/// The primary style.
- #[default]
Primary,
/// The success style.
Success,
@@ -743,6 +800,12 @@ pub enum ProgressBar {
Custom(Box<dyn progress_bar::StyleSheet<Style = Theme>>),
}
+impl Default for ProgressBar {
+ fn default() -> Self {
+ Self::Primary
+ }
+}
+
impl From<fn(&Theme) -> progress_bar::Appearance> for ProgressBar {
fn from(f: fn(&Theme) -> progress_bar::Appearance) -> Self {
Self::Custom(Box::new(f))
@@ -783,15 +846,22 @@ impl progress_bar::StyleSheet for fn(&Theme) -> progress_bar::Appearance {
}
/// The style of a rule.
-#[derive(Default)]
+/*
+ * Rule
+ */
pub enum Rule {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn rule::StyleSheet<Style = Theme>>),
}
+impl Default for Rule {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl From<fn(&Theme) -> rule::Appearance> for Rule {
fn from(f: fn(&Theme) -> rule::Appearance) -> Self {
Self::Custom(Box::new(f))
@@ -827,15 +897,19 @@ impl rule::StyleSheet for fn(&Theme) -> rule::Appearance {
/**
* Svg
*/
-#[derive(Default)]
pub enum Svg {
/// No filtering to the rendered SVG.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn svg::StyleSheet<Style = Theme>>),
}
+impl Default for Svg {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl Svg {
/// Creates a custom [`Svg`] style.
pub fn custom_fn(f: fn(&Theme) -> svg::Appearance) -> Self {
@@ -863,15 +937,19 @@ impl svg::StyleSheet for fn(&Theme) -> svg::Appearance {
}
/// The style of a scrollable.
-#[derive(Default)]
pub enum Scrollable {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn scrollable::StyleSheet<Style = Theme>>),
}
+impl Default for Scrollable {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl Scrollable {
/// Creates a custom [`Scrollable`] theme.
pub fn custom<T: scrollable::StyleSheet<Style = Theme> + 'static>(
@@ -961,15 +1039,23 @@ impl scrollable::StyleSheet for Theme {
}
/// The style of text.
-#[derive(Clone, Copy, Default)]
+/*
+ * Text
+ */
+#[derive(Clone, Copy)]
pub enum Text {
/// The default style.
- #[default]
Default,
/// Colored text.
Color(Color),
}
+impl Default for Text {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl From<Color> for Text {
fn from(color: Color) -> Self {
Text::Color(color)
@@ -988,15 +1074,19 @@ impl text::StyleSheet for Theme {
}
/// The style of a text input.
-#[derive(Default)]
pub enum TextInput {
/// The default style.
- #[default]
Default,
/// A custom style.
Custom(Box<dyn text_input::StyleSheet<Style = Theme>>),
}
+impl Default for TextInput {
+ fn default() -> Self {
+ Self::Default
+ }
+}
+
impl text_input::StyleSheet for Theme {
type Style = TextInput;
diff --git a/iced_wgpu/src/lib.rs b/iced_wgpu/src/lib.rs
index dcb699e8..5b3cda57 100644
--- a/iced_wgpu/src/lib.rs
+++ b/iced_wgpu/src/lib.rs
@@ -37,6 +37,7 @@
#![forbid(rust_2018_idioms)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![feature(generic_associated_types)]
pub mod settings;
pub mod triangle;