Lines Matching full:let
47 /// let u: u32 = transmute!(#![allow(shrink)] 0u64);
55 /// let one_dimensional: [u8; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
57 /// let two_dimensional: [[u8; 4]; 2] = transmute!(one_dimensional);
78 let mut e = $e;
89 let _ = src;
124 let u: Transmute<_, _> = unsafe {
135 let _ = e;
138 // SAFETY: Per the safety comment on `let u` above, the `dst`
156 let dst = unsafe { u.dst };
162 let e = $e;
173 let _ = src;
184 let u = unsafe {
230 /// let src: &[[u8; 2]] = &[[0, 1], [2, 3]][..];
231 /// let dst: &[u8] = transmute_ref!(src);
271 /// let src: &u16 = &0;
272 /// let dst: &u8 = transmute_ref(src);
285 /// let one_dimensional: [u8; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
287 /// let two_dimensional: &[[u8; 4]; 2] = transmute_ref!(&one_dimensional);
308 /// let src = Src::ref_from_bytes(&[0, 1, 2, 3, 4, 5, 6, 7]).unwrap();
309 /// let dst: &Dst = transmute_ref!(src);
350 let e: &_ = $e;
363 let _ = AssertSrcIsIntoBytes(e);
364 let _ = AssertSrcIsImmutable(e);
368 let u = AssertDstIsFromBytes(loop {});
372 let u = AssertDstIsImmutable(loop {});
377 let t = $crate::util::macro_util::Wrap::new(e);
443 /// let src: &mut [[u8; 2]] = &mut [[0, 1], [2, 3]][..];
444 /// let dst: &mut [u8] = transmute_mut!(src);
448 /// let dst_size = size_of_val(dst);
485 /// let src: &mut u16 = &mut 0;
486 /// let dst: &mut u8 = transmute_mut(src);
500 /// let mut one_dimensional: [u8; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
502 /// let two_dimensional: &mut [[u8; 4]; 2] = transmute_mut!(&mut one_dimensional);
527 /// let mut bytes = [0, 1, 2, 3, 4, 5, 6, 7];
528 /// let src = Src::mut_from_bytes(&mut bytes[..]).unwrap();
529 /// let dst: &mut Dst = transmute_mut!(src);
549 let e: &mut _ = $e;
553 let t = $crate::util::macro_util::Wrap::new(e);
635 let e = $e;
694 /// let src: &[[u8; 2]] = &[[0, 1], [2, 3]][..];
695 /// let dst: &[u8] = try_transmute_ref!(src).unwrap();
738 /// let src = Src::ref_from_bytes(&[0, 1, 0, 1, 0, 1, 0, 1]).unwrap();
739 /// let dst: &Dst = try_transmute_ref!(src).unwrap();
771 let e: &_ = $e;
775 let t = $crate::util::macro_util::Wrap::new(e);
840 /// let src: &mut [[u8; 2]] = &mut [[0, 1], [2, 3]][..];
841 /// let dst: &mut [u8] = try_transmute_mut!(src).unwrap();
845 /// let dst_size = size_of_val(dst);
857 /// let src = &mut 0u8;
861 /// let src = &mut 1u8;
865 /// let src = &mut 2u8;
888 /// let mut bytes = [0, 1, 0, 1, 0, 1, 0, 1];
889 /// let src = Src::mut_from_bytes(&mut bytes).unwrap();
895 /// let dst: &Dst = try_transmute_mut!(src).unwrap();
904 let e: &mut _ = $e;
908 let t = $crate::util::macro_util::Wrap::new(e);
970 /// let as_u32: u32 = include_value!("data");
972 /// let as_i32: i32 = include_value!("data");
1274 let array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_transmute()
1275 let array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_transmute()
1276 let x: [[u8; 2]; 4] = transmute!(array_of_u8s); in test_transmute()
1278 let x: [u8; 8] = transmute!(array_of_arrays); in test_transmute()
1282 let x: [[u8; 2]; 3] = transmute!(#![allow(shrink)] array_of_u8s); in test_transmute()
1296 let _: () = transmute!(PanicOnDrop(())); in test_transmute()
1298 let _: () = transmute!(#![allow(shrink)] PanicOnDrop(())); in test_transmute()
1309 let x: usize = transmute!(UnsafeCell::new(1usize)); in test_transmute()
1311 let x: UnsafeCell<usize> = transmute!(1usize); in test_transmute()
1313 let x: UnsafeCell<isize> = transmute!(UnsafeCell::new(1usize)); in test_transmute()
1332 let array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_ref()
1333 let array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_transmute_ref()
1334 let x: &[[u8; 2]; 4] = transmute_ref!(&array_of_u8s); in test_transmute_ref()
1336 let x: &[u8; 8] = transmute_ref!(&array_of_arrays); in test_transmute_ref()
1347 let array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_ref()
1348 let array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_transmute_ref()
1349 let slice_of_arrays = &array_of_arrays[..]; in test_transmute_ref()
1350 let x: &[[u8; 2]] = transmute_ref!(&array_of_u8s); in test_transmute_ref()
1387 let slice_dst_of_u8s = in test_transmute_ref()
1389 let slice_dst_of_u16s = in test_transmute_ref()
1391 let x: &SliceDst<U16, U16> = transmute_ref!(slice_dst_of_u8s); in test_transmute_ref()
1394 let slice_dst_of_u8s = in test_transmute_ref()
1396 let x: &[u8] = transmute_ref!(slice_dst_of_u8s); in test_transmute_ref()
1399 let x: &[u8] = transmute_ref!(slice_dst_of_u16s); in test_transmute_ref()
1402 let x: &[U16] = transmute_ref!(slice_dst_of_u16s); in test_transmute_ref()
1403 let slice_of_u16s: &[U16] = <[U16]>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1408 let bytes = &[0, 1, 2, 3, 4, 5, 6, 7][..]; in test_transmute_ref()
1409 let slice_dst_big = SliceDst::<U32, U16>::ref_from_bytes(bytes).unwrap(); in test_transmute_ref()
1410 let slice_dst_small = SliceDst::<U16, u8>::ref_from_bytes(bytes).unwrap(); in test_transmute_ref()
1411 let x: &SliceDst<U16, u8> = transmute_ref!(slice_dst_big); in test_transmute_ref()
1416 let x: &[u8; 8] = transmute_ref!(X); in test_transmute_ref()
1420 let u = AU64(0); in test_transmute_ref()
1421 let array = [0, 0, 0, 0, 0, 0, 0, 0]; in test_transmute_ref()
1422 let x: &[u8; 8] = transmute_ref!(&u); in test_transmute_ref()
1426 let mut x = 0u8; in test_transmute_ref()
1428 let y: &u8 = transmute_ref!(&mut x); in test_transmute_ref()
1435 let array_of_bools = [false, true, false, true, false, true, false, true]; in test_try_transmute()
1436 let array_of_arrays = [[0, 1], [0, 1], [0, 1], [0, 1]]; in test_try_transmute()
1437 let x: Result<[[u8; 2]; 4], _> = try_transmute!(array_of_bools); in test_try_transmute()
1439 let x: Result<[bool; 8], _> = try_transmute!(array_of_arrays); in test_try_transmute()
1443 let x: Result<usize, _> = try_transmute!(UnsafeCell::new(1usize)); in test_try_transmute()
1445 let x: Result<UnsafeCell<usize>, _> = try_transmute!(1usize); in test_try_transmute()
1447 let x: Result<UnsafeCell<isize>, _> = try_transmute!(UnsafeCell::new(1usize)); in test_try_transmute()
1462 let x: Result<usize, _> = try_transmute!(PanicOnDrop(1usize)); in test_try_transmute()
1468 let y: Result<bool, _> = try_transmute!(PanicOnDrop(2u8)); in test_try_transmute()
1479 let array_of_bools = &[false, true, false, true, false, true, false, true]; in test_try_transmute_ref()
1480 let array_of_arrays = &[[0, 1], [0, 1], [0, 1], [0, 1]]; in test_try_transmute_ref()
1481 let x: Result<&[[u8; 2]; 4], _> = try_transmute_ref!(array_of_bools); in test_try_transmute_ref()
1483 let x: Result<&[bool; 8], _> = try_transmute_ref!(array_of_arrays); in test_try_transmute_ref()
1489 let x: Result<&[[u8; 2]; 4], _> = try_transmute_ref!(array_of_bools); in test_try_transmute_ref()
1494 let u = AU64(0); in test_try_transmute_ref()
1495 let array = [0u8, 0, 0, 0, 0, 0, 0, 0]; in test_try_transmute_ref()
1496 let x: Result<&[u8; 8], _> = try_transmute_ref!(&u); in test_try_transmute_ref()
1500 let mut x = 0u8; in test_try_transmute_ref()
1502 let y: Result<&u8, _> = try_transmute_ref!(&mut x); in test_try_transmute_ref()
1506 let array_of_nkl_u8s = Nkl([0u8, 1, 2, 3, 4, 5, 6, 7]); in test_try_transmute_ref()
1507 let array_of_nkl_arrays = Nkl([[0, 1], [2, 3], [4, 5], [6, 7]]); in test_try_transmute_ref()
1508 let x: Result<&Nkl<[[u8; 2]; 4]>, _> = try_transmute_ref!(&array_of_nkl_u8s); in test_try_transmute_ref()
1512 let array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_try_transmute_ref()
1513 let array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_try_transmute_ref()
1514 let slice_of_arrays = &array_of_arrays[..]; in test_try_transmute_ref()
1515 let x: Result<&[[u8; 2]], _> = try_transmute_ref!(&array_of_u8s); in test_try_transmute_ref()
1519 let slice_dst_of_u8s = in test_try_transmute_ref()
1521 let slice_dst_of_u16s = in test_try_transmute_ref()
1523 let x: Result<&SliceDst<U16, U16>, _> = try_transmute_ref!(slice_dst_of_u8s); in test_try_transmute_ref()
1530 let array_of_u8s = &mut [0u8, 1, 0, 1, 0, 1, 0, 1]; in test_try_transmute_mut()
1531 let array_of_arrays = &mut [[0u8, 1], [0, 1], [0, 1], [0, 1]]; in test_try_transmute_mut()
1532 let x: Result<&mut [[u8; 2]; 4], _> = try_transmute_mut!(array_of_u8s); in test_try_transmute_mut()
1535 let array_of_bools = &mut [false, true, false, true, false, true, false, true]; in test_try_transmute_mut()
1536 let array_of_arrays = &mut [[0u8, 1], [0, 1], [0, 1], [0, 1]]; in test_try_transmute_mut()
1537 let x: Result<&mut [bool; 8], _> = try_transmute_mut!(array_of_arrays); in test_try_transmute_mut()
1542 let array_of_bools = &mut [false, true, false, true, false, true, false, true]; in test_try_transmute_mut()
1543 let array_of_arrays = &mut [[0u8, 1], [0, 1], [0, 1], [0, 1]]; in test_try_transmute_mut()
1545 let x: Result<&mut [bool; 8], _> = try_transmute_mut!(array_of_arrays); in test_try_transmute_mut()
1550 let u = &mut AU64(0); in test_try_transmute_mut()
1551 let array = &mut [0u8, 0, 0, 0, 0, 0, 0, 0]; in test_try_transmute_mut()
1552 let x: Result<&mut [u8; 8], _> = try_transmute_mut!(u); in test_try_transmute_mut()
1556 let mut x = 0u8; in test_try_transmute_mut()
1558 let y: Result<&mut u8, _> = try_transmute_mut!(&mut x); in test_try_transmute_mut()
1562 let mut array_of_nkl_u8s = Nkl([0u8, 1, 2, 3, 4, 5, 6, 7]); in test_try_transmute_mut()
1563 let mut array_of_nkl_arrays = Nkl([[0, 1], [2, 3], [4, 5], [6, 7]]); in test_try_transmute_mut()
1564 let x: Result<&mut Nkl<[[u8; 2]; 4]>, _> = try_transmute_mut!(&mut array_of_nkl_u8s); in test_try_transmute_mut()
1568 let mut array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_try_transmute_mut()
1569 let mut array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_try_transmute_mut()
1570 let slice_of_arrays = &mut array_of_arrays[..]; in test_try_transmute_mut()
1571 let x: Result<&mut [[u8; 2]], _> = try_transmute_mut!(&mut array_of_u8s); in test_try_transmute_mut()
1575 let mut bytes = [0, 1, 2, 3, 4, 5, 6]; in test_try_transmute_mut()
1576 let slice_dst_of_u8s = SliceDst::<u8, [u8; 2]>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_try_transmute_mut()
1577 let mut bytes = [0, 1, 2, 3, 4, 5, 6]; in test_try_transmute_mut()
1578 let slice_dst_of_u16s = SliceDst::<u8, U16>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_try_transmute_mut()
1579 let x: Result<&mut SliceDst<u8, U16>, _> = try_transmute_mut!(slice_dst_of_u8s); in test_try_transmute_mut()
1586 let mut array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_mut()
1587 let mut array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_transmute_mut()
1588 let x: &mut [[u8; 2]; 4] = transmute_mut!(&mut array_of_u8s); in test_transmute_mut()
1590 let x: &mut [u8; 8] = transmute_mut!(&mut array_of_arrays); in test_transmute_mut()
1596 let x: &mut [u8; 8] = transmute_mut!(&mut array_of_arrays); in test_transmute_mut()
1601 let mut array_of_u8s = Nkl([0u8, 1, 2, 3, 4, 5, 6, 7]); in test_transmute_mut()
1602 let mut array_of_arrays = Nkl([[0, 1], [2, 3], [4, 5], [6, 7]]); in test_transmute_mut()
1603 let x: &mut Nkl<[[u8; 2]; 4]> = transmute_mut!(&mut array_of_u8s); in test_transmute_mut()
1605 let x: &mut Nkl<[u8; 8]> = transmute_mut!(&mut array_of_arrays); in test_transmute_mut()
1609 let mut u = AU64(0); in test_transmute_mut()
1610 let array = [0, 0, 0, 0, 0, 0, 0, 0]; in test_transmute_mut()
1611 let x: &[u8; 8] = transmute_mut!(&mut u); in test_transmute_mut()
1615 let mut x = 0u8; in test_transmute_mut()
1617 let y: &u8 = transmute_mut!(&mut x); in test_transmute_mut()
1622 let mut bytes = [0, 1, 2, 3, 4, 5, 6]; in test_transmute_mut()
1623 let slice_dst_of_u8s = SliceDst::<u8, [u8; 2]>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_transmute_mut()
1624 let mut bytes = [0, 1, 2, 3, 4, 5, 6]; in test_transmute_mut()
1625 let slice_dst_of_u16s = SliceDst::<u8, U16>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_transmute_mut()
1626 let x: &mut SliceDst<u8, U16> = transmute_mut!(slice_dst_of_u8s); in test_transmute_mut()
1631 let array_of_u16s: &mut [u16] = &mut [0u16, 1, 2]; in test_transmute_mut()
1632 let array_of_i16s: &mut [i16] = &mut [0i16, 1, 2]; in test_transmute_mut()
1633 let x: &mut [i16] = transmute_mut!(array_of_u16s); in test_transmute_mut()
1638 let mut bytes = [0, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_mut()
1639 let slice_dst_big = SliceDst::<U32, U16>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_transmute_mut()
1640 let mut bytes = [0, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_mut()
1641 let slice_dst_small = SliceDst::<U16, u8>::mut_from_bytes(&mut bytes[..]).unwrap(); in test_transmute_mut()
1642 let x: &mut SliceDst<U16, u8> = transmute_mut!(slice_dst_big); in test_transmute_mut()
1646 let mut array_of_u8s = [0u8, 1, 2, 3, 4, 5, 6, 7]; in test_transmute_mut()
1647 let mut array_of_arrays = [[0, 1], [2, 3], [4, 5], [6, 7]]; in test_transmute_mut()
1648 let slice_of_arrays = &mut array_of_arrays[..]; in test_transmute_mut()
1649 let x: &mut [[u8; 2]] = transmute_mut!(&mut array_of_u8s); in test_transmute_mut()
1655 let mut ctr = 0; in test_macros_evaluate_args_once()
1657 let _: usize = transmute!({ in test_macros_evaluate_args_once()
1663 let mut ctr = 0; in test_macros_evaluate_args_once()
1664 let _: &usize = transmute_ref!({ in test_macros_evaluate_args_once()
1670 let mut ctr: usize = 0; in test_macros_evaluate_args_once()
1671 let _: &mut usize = transmute_mut!({ in test_macros_evaluate_args_once()
1677 let mut ctr = 0; in test_macros_evaluate_args_once()
1679 let _: usize = try_transmute!({ in test_macros_evaluate_args_once()