Fixed cast imports in doctest (rust-lang/portable-simd#355)
This commit is contained in:
parent
f2f9bd7eb1
commit
789c38fae2
@ -26,7 +26,9 @@ pub trait SimdFloat: Copy + Sealed {
|
|||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// # #![feature(portable_simd)]
|
/// # #![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 floats: Simd<f32, 4> = Simd::from_array([1.9, -4.5, f32::INFINITY, f32::NAN]);
|
||||||
/// let ints = floats.cast::<i32>();
|
/// let ints = floats.cast::<i32>();
|
||||||
/// assert_eq!(ints, Simd::from_array([1, -4, i32::MAX, 0]));
|
/// assert_eq!(ints, Simd::from_array([1, -4, i32::MAX, 0]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user