Skip to content

Commit aca6984

Browse files
committed
Need use alloc::vec when std isn't enabled to use array! macro
1 parent 0d2529b commit aca6984

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/free_functions.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ use crate::{imp_prelude::*, LayoutRef};
4646
///
4747
/// This macro uses `vec![]`, and has the same ownership semantics;
4848
/// elements are moved into the resulting `Array`.
49+
/// If running with `no_std`, this may require that you `use alloc::vec`
50+
/// before being able to use the `array!` macro.
4951
///
5052
/// Use `array![...].into_shared()` to create an `ArcArray`.
5153
///
@@ -655,9 +657,10 @@ pub fn meshgrid<T: Meshgrid>(arrays: T, indexing: MeshIndex) -> T::Output
655657
#[cfg(test)]
656658
mod tests
657659
{
658-
use crate::{meshgrid, Axis, MeshIndex};
659-
660660
use super::s;
661+
use crate::{meshgrid, Axis, MeshIndex};
662+
#[cfg(not(feature = "std"))]
663+
use alloc::vec;
661664

662665
#[test]
663666
fn test_meshgrid2()

0 commit comments

Comments
 (0)