Fixed cast imports in doctest (rust-lang/portable-simd#355)

This commit is contained in:
Jubilee
2023-07-07 03:49:42 -07:00
committed by GitHub
parent 4bfad947d6
commit d63e7453ef
+3 -1
View File
@@ -26,7 +26,9 @@ pub trait SimdFloat: Copy + Sealed {
/// # Example
/// ```
/// # #![feature(portable_simd)]
/// # use core::simd::Simd;
/// # #[cfg(feature = "as_crate")] use core_simd::simd;
/// # #[cfg(not(feature = "as_crate"))] use core::simd;
/// # use simd::{f32x2, SimdFloat, SimdInt, Simd};
/// let floats: Simd<f32, 4> = Simd::from_array([1.9, -4.5, f32::INFINITY, f32::NAN]);
/// let ints = floats.cast::<i32>();
/// assert_eq!(ints, Simd::from_array([1, -4, i32::MAX, 0]));