57 lines
2.8 KiB
Diff
57 lines
2.8 KiB
Diff
From fba770255dd72db8301b5f51ef50ab59e7746515 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?=C3=A9clairevoyant?=
|
|
<848000+eclairevoyant@users.noreply.github.com>
|
|
Date: Mon, 20 Mar 2023 07:40:36 -0400
|
|
Subject: [PATCH] remove box_syntax (#711)
|
|
|
|
Rust removed support for box_syntax in a recent nightly release :'(
|
|
---
|
|
crates/eww/src/main.rs | 1 -
|
|
crates/simplexpr/src/eval.rs | 8 ++++----
|
|
crates/simplexpr/src/lib.rs | 1 -
|
|
3 files changed, 4 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs
|
|
index 8e51a626..14bc8190 100644
|
|
--- a/crates/eww/src/main.rs
|
|
+++ b/crates/eww/src/main.rs
|
|
@@ -1,6 +1,5 @@
|
|
#![feature(trace_macros)]
|
|
#![feature(drain_filter)]
|
|
-#![feature(box_syntax)]
|
|
#![feature(box_patterns)]
|
|
#![feature(slice_concat_trait)]
|
|
#![feature(try_blocks)]
|
|
diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs
|
|
index d0b48115..76f811da 100644
|
|
--- a/crates/simplexpr/src/eval.rs
|
|
+++ b/crates/simplexpr/src/eval.rs
|
|
@@ -69,13 +69,13 @@ impl SimplExpr {
|
|
pub fn try_map_var_refs<E, F: Fn(Span, VarName) -> Result<SimplExpr, E> + Copy>(self, f: F) -> Result<Self, E> {
|
|
use SimplExpr::*;
|
|
Ok(match self {
|
|
- BinOp(span, box a, op, box b) => BinOp(span, box a.try_map_var_refs(f)?, op, box b.try_map_var_refs(f)?),
|
|
+ BinOp(span, box a, op, box b) => BinOp(span, Box::new(a.try_map_var_refs(f)?), op, Box::new(b.try_map_var_refs(f)?)),
|
|
Concat(span, elems) => Concat(span, elems.into_iter().map(|x| x.try_map_var_refs(f)).collect::<Result<_, _>>()?),
|
|
- UnaryOp(span, op, box a) => UnaryOp(span, op, box a.try_map_var_refs(f)?),
|
|
+ UnaryOp(span, op, box a) => UnaryOp(span, op, Box::new(a.try_map_var_refs(f)?)),
|
|
IfElse(span, box a, box b, box c) => {
|
|
- IfElse(span, box a.try_map_var_refs(f)?, box b.try_map_var_refs(f)?, box c.try_map_var_refs(f)?)
|
|
+ IfElse(span, Box::new(a.try_map_var_refs(f)?), Box::new(b.try_map_var_refs(f)?), Box::new(c.try_map_var_refs(f)?))
|
|
}
|
|
- JsonAccess(span, box a, box b) => JsonAccess(span, box a.try_map_var_refs(f)?, box b.try_map_var_refs(f)?),
|
|
+ JsonAccess(span, box a, box b) => JsonAccess(span, Box::new(a.try_map_var_refs(f)?), Box::new(b.try_map_var_refs(f)?)),
|
|
FunctionCall(span, name, args) => {
|
|
FunctionCall(span, name, args.into_iter().map(|x| x.try_map_var_refs(f)).collect::<Result<_, _>>()?)
|
|
}
|
|
diff --git a/crates/simplexpr/src/lib.rs b/crates/simplexpr/src/lib.rs
|
|
index 205b2989..8a402877 100644
|
|
--- a/crates/simplexpr/src/lib.rs
|
|
+++ b/crates/simplexpr/src/lib.rs
|
|
@@ -1,6 +1,5 @@
|
|
#![feature(box_patterns)]
|
|
#![feature(pattern)]
|
|
-#![feature(box_syntax)]
|
|
#![feature(try_blocks)]
|
|
#![feature(unwrap_infallible)]
|
|
#![feature(never_type)]
|