remove box_syntax (#711)

Rust removed support for box_syntax in a recent nightly release :'(
This commit is contained in:
éclairevoyant 2023-03-20 07:40:36 -04:00 committed by GitHub
parent 45154bbf59
commit fba770255d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View file

@ -1,6 +1,5 @@
#![feature(trace_macros)] #![feature(trace_macros)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(box_syntax)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(slice_concat_trait)] #![feature(slice_concat_trait)]
#![feature(try_blocks)] #![feature(try_blocks)]

View file

@ -93,14 +93,14 @@ impl SimplExpr {
pub fn try_map_var_refs<E, F: Fn(Span, VarName) -> Result<SimplExpr, E> + Copy>(self, f: F) -> Result<Self, E> { pub fn try_map_var_refs<E, F: Fn(Span, VarName) -> Result<SimplExpr, E> + Copy>(self, f: F) -> Result<Self, E> {
use SimplExpr::*; use SimplExpr::*;
Ok(match self { 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<_, _>>()?), 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, 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, safe, box a, box b) => { JsonAccess(span, safe, box a, box b) => {
JsonAccess(span, safe, box a.try_map_var_refs(f)?, box b.try_map_var_refs(f)?) JsonAccess(span, safe, Box::new(a.try_map_var_refs(f)?), Box::new(b.try_map_var_refs(f)?))
} }
FunctionCall(span, name, args) => { FunctionCall(span, name, args) => {
FunctionCall(span, name, args.into_iter().map(|x| x.try_map_var_refs(f)).collect::<Result<_, _>>()?) FunctionCall(span, name, args.into_iter().map(|x| x.try_map_var_refs(f)).collect::<Result<_, _>>()?)

View file

@ -1,6 +1,5 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(pattern)] #![feature(pattern)]
#![feature(box_syntax)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(unwrap_infallible)] #![feature(unwrap_infallible)]
#![feature(never_type)] #![feature(never_type)]