Skip to content

Commit

Permalink
box syntax is no longer a nightly feature
Browse files Browse the repository at this point in the history
It was dropped in rust-lang/rust#49733
and isn't supported by new Syn.

box unpacking looks like a good substitute
  • Loading branch information
sourcefrog committed Apr 30, 2023
1 parent fd6ec97 commit 0f3732c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions testdata/tree/nightly_only/README.md
@@ -1,3 +1,5 @@
# `nightly_only` test tree

This tree only builds on nightly Rust, and can be used to check that `cargo
mutants` uses the corresponding `cargo` and `rustc` when building candidates.

Expand Down
10 changes: 10 additions & 0 deletions testdata/tree/nightly_only/src/lib.rs
@@ -0,0 +1,10 @@
#![feature(box_patterns)]
fn box_an_int() -> Box<i32> {
Box::new(5)
}

#[test]
fn unbox_by_pattern() {
let box a = box_an_int();
assert_eq!(a, 5);
}
5 changes: 0 additions & 5 deletions testdata/tree/nightly_only/src/main.rs

This file was deleted.

Expand Up @@ -244,11 +244,11 @@ expression: buf
[
{
"package": "nightly_only",
"file": "src/main.rs",
"file": "src/lib.rs",
"line": 2,
"function": "main",
"return_type": "",
"replacement": "()"
"function": "box_an_int",
"return_type": "-> Box<i32>",
"replacement": "Default::default()"
}
]
```
Expand Down
Expand Up @@ -101,7 +101,7 @@ src/lib.rs:1: replace double -> u32 with Default::default()
## testdata/tree/nightly_only

```
src/main.rs:2: replace main with ()
src/lib.rs:2: replace box_an_int -> Box<i32> with Default::default()
```
## testdata/tree/override_dependency
Expand Down

0 comments on commit 0f3732c

Please sign in to comment.