Skip to content

Commit

Permalink
remove box_syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Burka committed Jun 4, 2023
1 parent 3c2aef6 commit 76e87e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg_attr(
all(test, feature = "nightly"),
feature(box_syntax, box_patterns)
feature(box_patterns)
)]
#![cfg_attr(feature = "debug", feature(trace_macros))]
#![cfg_attr(not(test), no_std)]
Expand Down Expand Up @@ -423,11 +423,11 @@ mod tests {
#[test]
fn nightly() {
// box patterns
let foo = (box 42, [1, 2, 3]);
let foo = (Box::new(42), [1, 2, 3]);
guard!({ return } unless Some(foo) => Some((box x, _)));
println!("{}", x);

let mut foo = Some((box 42, [1, 2, 3]));
let mut foo = Some((Box::new(42), [1, 2, 3]));
{
guard!({ return } unless foo => Some((box ref x, _)));
println!("{}", x);
Expand All @@ -443,12 +443,12 @@ mod tests {
}

// slice patterns
let foo = (box 42, [1, 2, 3]);
let foo = (Box::new(42), [1, 2, 3]);
guard!({ return } unless Some(foo) => Some((_, [a, b, c])));
println!("{} {} {}", a, b, c);

// advanced slice patterns
let foo = (box 42, [1, 2, 3]);
let foo = (Box::new(42), [1, 2, 3]);
guard!({ return } unless Some((foo.0, &foo.1)) => Some((box x, &[head, tail @ ..])));
println!("{} {} {:?}", x, head, tail);
}
Expand Down

0 comments on commit 76e87e4

Please sign in to comment.