]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfcs/rfc-1789-as-cell/from-mut.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / rfcs / rfc-1789-as-cell / from-mut.rs
1 // run-pass
2
3 use std::cell::Cell;
4
5 fn main() {
6 let slice: &mut [i32] = &mut [1, 2, 3];
7 let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
8 let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells();
9
10 assert_eq!(slice_cell.len(), 3);
11 }