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 f2f9bd7eb1
commit 789c38fae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]));