Skip to content

Commit 0f3732c

Browse files
committed
box syntax is no longer a nightly feature
It was dropped in rust-lang/rust#49733 and isn't supported by new Syn. box unpacking looks like a good substitute
1 parent fd6ec97 commit 0f3732c

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

testdata/tree/nightly_only/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# `nightly_only` test tree
2+
13
This tree only builds on nightly Rust, and can be used to check that `cargo
24
mutants` uses the corresponding `cargo` and `rustc` when building candidates.
35

testdata/tree/nightly_only/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![feature(box_patterns)]
2+
fn box_an_int() -> Box<i32> {
3+
Box::new(5)
4+
}
5+
6+
#[test]
7+
fn unbox_by_pattern() {
8+
let box a = box_an_int();
9+
assert_eq!(a, 5);
10+
}

testdata/tree/nightly_only/src/main.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ expression: buf
244244
[
245245
{
246246
"package": "nightly_only",
247-
"file": "src/main.rs",
247+
"file": "src/lib.rs",
248248
"line": 2,
249-
"function": "main",
250-
"return_type": "",
251-
"replacement": "()"
249+
"function": "box_an_int",
250+
"return_type": "-> Box<i32>",
251+
"replacement": "Default::default()"
252252
}
253253
]
254254
```

tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ src/lib.rs:1: replace double -> u32 with Default::default()
101101
## testdata/tree/nightly_only
102102

103103
```
104-
src/main.rs:2: replace main with ()
104+
src/lib.rs:2: replace box_an_int -> Box<i32> with Default::default()
105105
```
106106
107107
## testdata/tree/override_dependency

0 commit comments

Comments
 (0)