Skip to content

Commit bccc5a3

Browse files
authored
Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk
Remove unsizing coercions for tuples See rust-lang/rust#42877 (comment) and below comments for justification. Tracking issue: #42877 Fixes: #135217
2 parents 798bb5f + 268da86 commit bccc5a3

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

tests/pass/unsized.rs

-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
//@revisions: stack tree
22
//@[tree]compile-flags: -Zmiri-tree-borrows
3-
#![feature(unsized_tuple_coercion)]
43
#![feature(unsized_fn_params)]
54
#![feature(custom_mir, core_intrinsics)]
65

7-
use std::mem;
8-
9-
fn unsized_tuple() {
10-
let x: &(i32, i32, [i32]) = &(0, 1, [2, 3]);
11-
let y: &(i32, i32, [i32]) = &(0, 1, [2, 3, 4]);
12-
let mut a = [y, x];
13-
a.sort();
14-
assert_eq!(a, [x, y]);
15-
16-
assert_eq!(&format!("{:?}", a), "[(0, 1, [2, 3]), (0, 1, [2, 3, 4])]");
17-
assert_eq!(mem::size_of_val(x), 16);
18-
}
19-
206
fn unsized_params() {
217
pub fn f0(_f: dyn FnOnce()) {}
228
pub fn f1(_s: str) {}
@@ -56,7 +42,6 @@ fn unsized_field_projection() {
5642
}
5743

5844
fn main() {
59-
unsized_tuple();
6045
unsized_params();
6146
unsized_field_projection();
6247
}

0 commit comments

Comments
 (0)