mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
40ae34194c
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
10 lines
406 B
Rust
10 lines
406 B
Rust
// run-pass
|
|
#![feature(box_into_boxed_slice)]
|
|
fn main() {
|
|
assert_eq!(Box::into_boxed_slice(Box::new(5u8)), Box::new([5u8]) as Box<[u8]>);
|
|
assert_eq!(Box::into_boxed_slice(Box::new([25u8])), Box::new([[25u8]]) as Box<[[u8; 1]]>);
|
|
let a: Box<[Box<[u8; 1]>]> = Box::into_boxed_slice(Box::new(Box::new([5u8])));
|
|
let b: Box<[Box<[u8; 1]>]> = Box::new([Box::new([5u8])]);
|
|
assert_eq!(a, b);
|
|
}
|