git: 185d84b7d0a2 - main - x11/eww: Fix build with rust 1.72.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Sep 2023 06:49:34 UTC
The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=185d84b7d0a20a033c5f36a54635a17939a3bf99 commit 185d84b7d0a20a033c5f36a54635a17939a3bf99 Author: Mikael Urankar <mikael@FreeBSD.org> AuthorDate: 2023-09-01 16:13:21 +0000 Commit: Mikael Urankar <mikael@FreeBSD.org> CommitDate: 2023-09-11 06:49:29 +0000 x11/eww: Fix build with rust 1.72.0 Approved by: portmgr (build fix blanket) --- x11/eww/distinfo | 2 +- x11/eww/files/patch-rust-1.72.0 | 58 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/x11/eww/distinfo b/x11/eww/distinfo index f19312ec1222..d949d745975e 100644 --- a/x11/eww/distinfo +++ b/x11/eww/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1663703127 +TIMESTAMP = 1693583209 SHA256 (rust/crates/ahash-0.7.6.crate) = fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47 SIZE (rust/crates/ahash-0.7.6.crate) = 38030 SHA256 (rust/crates/aho-corasick-0.7.19.crate) = b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e diff --git a/x11/eww/files/patch-rust-1.72.0 b/x11/eww/files/patch-rust-1.72.0 new file mode 100644 index 000000000000..790a30a8e58f --- /dev/null +++ b/x11/eww/files/patch-rust-1.72.0 @@ -0,0 +1,58 @@ +https://github.com/elkowar/eww/commit/acf255f24a19cad47fdc05e2a031325bab17c822 + +From acf255f24a19cad47fdc05e2a031325bab17c822 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=A9clairevoyant?= + <848000+eclairevoyant@users.noreply.github.com> +Date: Sat, 29 Jul 2023 08:48:13 -0400 +Subject: [PATCH] Comply with rust-lang/rfcs#2140 (#815) + +--- + crates/eww/src/error_handling_ctx.rs | 2 +- + crates/eww/src/main.rs | 4 +- + crates/eww/src/widgets/widget_definitions.rs | 2 +- + 5 files changed, 544 insertions(+), 417 deletions(-) + +diff --git a/crates/eww/src/error_handling_ctx.rs b/crates/eww/src/error_handling_ctx.rs +index 32732003..05af2724 100644 +--- crates/eww/src/error_handling_ctx.rs ++++ crates/eww/src/error_handling_ctx.rs +@@ -53,7 +53,7 @@ pub fn anyhow_err_to_diagnostic(err: &anyhow::Error) -> Option<Diagnostic<usize> + } + + pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic<usize>) -> anyhow::Result<String> { +- diagnostic.labels.drain_filter(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); ++ diagnostic.labels.retain(|label| !Span(label.range.start, label.range.end, label.file_id).is_dummy()); + + let mut config = term::Config::default(); + let mut chars = Chars::box_drawing(); +diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs +index 1e61c3bf..9211d03b 100644 +--- crates/eww/src/main.rs ++++ crates/eww/src/main.rs +@@ -1,9 +1,9 @@ + #![feature(trace_macros)] +-#![feature(drain_filter)] ++#![feature(extract_if)] + #![feature(box_patterns)] + #![feature(slice_concat_trait)] + #![feature(try_blocks)] +-#![feature(hash_drain_filter)] ++#![feature(hash_extract_if)] + #![allow(rustdoc::private_intra_doc_links)] + + extern crate gtk; +diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs +index 2cdc9071..a1429407 100644 +--- crates/eww/src/widgets/widget_definitions.rs ++++ crates/eww/src/widgets/widget_definitions.rs +@@ -127,7 +127,7 @@ static DEPRECATED_ATTRS: Lazy<HashSet<&str>> = + /// @desc these properties apply to _all_ widgets, and can be used anywhere! + pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Widget) -> Result<()> { + let deprecated: HashSet<_> = DEPRECATED_ATTRS.to_owned(); +- let contained_deprecated: Vec<_> = bargs.unhandled_attrs.drain_filter(|a, _| deprecated.contains(&a.0 as &str)).collect(); ++ let contained_deprecated: Vec<_> = bargs.unhandled_attrs.extract_if(|a, _| deprecated.contains(&a.0 as &str)).collect(); + if !contained_deprecated.is_empty() { + let diag = error_handling_ctx::stringify_diagnostic(gen_diagnostic! { + kind = Severity::Error, +diff --git a/rust-toolchain.toml b/rust-toolchain.toml +index 3d6465bf..1ffbc91b 100644