Skip to content

Commit 26eadc1

Browse files
Rollup merge of rust-lang#156136 - danieljofficial:move-tests-box, r=Kivooeo
Move tests box Hi, I have moved some tests into the box folder. Fixes [133895](rust-lang#133895)
2 parents d7d88fc + 2c2dad1 commit 26eadc1

5 files changed

Lines changed: 23 additions & 3 deletions

tests/ui/issues/issue-20055-box-trait.rs renamed to tests/ui/box/box-array-match-temporary-drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-pass
2-
// See Issues #20055 and #21695.
2+
// See Issues https://github.com/rust-lang/rust/issues/20055 and https://github.com/rust-lang/rust/issues/21695.
33

44
// We are checking here that the temporaries `Box<[i8, k]>`, for `k`
55
// in 1, 2, 3, 4, that are induced by the match expression are

tests/ui/issues/issue-20055-box-trait.stderr renamed to tests/ui/box/box-array-match-temporary-drop.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: method `dummy` is never used
2-
--> $DIR/issue-20055-box-trait.rs:11:8
2+
--> $DIR/box-array-match-temporary-drop.rs:11:8
33
|
44
LL | trait Boo {
55
| --- method in this trait
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/18845
2+
3+
//@ run-pass
4+
// This used to generate invalid IR in that even if we took the
5+
// `false` branch we'd still try to free the Box from the other
6+
// arm. This was due to treating `*Box::new(9)` as an rvalue datum
7+
// instead of as a place.
8+
9+
fn test(foo: bool) -> u8 {
10+
match foo {
11+
true => *Box::new(9),
12+
false => 0
13+
}
14+
}
15+
16+
fn main() {
17+
assert_eq!(9, test(true));
18+
}

tests/ui/issues/issue-23491.rs renamed to tests/ui/box/box-dst-node-with-empty-slice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/23491
2+
13
//@ run-pass
24
#![allow(unused_variables)]
35

tests/ui/issues/issue-20055-box-unsized-array.rs renamed to tests/ui/box/box-fixed-array-coerce-unsized-match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-pass
2-
// Issue #2005: Check that boxed fixed-size arrays are properly
2+
// Issue https://github.com/rust-lang/rust/issues/20055: Check that boxed fixed-size arrays are properly
33
// accounted for (namely, only deallocated if they were actually
44
// created) when they appear as temporaries in unused arms of a match
55
// expression.

0 commit comments

Comments
 (0)