From 922393b04f64d34bb4ff1ad4e5d3171697a706d2 Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Fri, 7 May 2021 09:09:10 +0200 Subject: [PATCH] Enable from_{}_storage only when std/alloc available --- src/base/matrix.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/base/matrix.rs b/src/base/matrix.rs index f9b391efc..3cde8a4f6 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -29,7 +29,10 @@ use crate::base::storage::{ ContiguousStorage, ContiguousStorageMut, Owned, SameShapeStorage, Storage, StorageMut, }; use crate::base::{Const, DefaultAllocator, OMatrix, OVector, Scalar, Unit}; -use crate::{ArrayStorage, DMatrix, DVector, Dynamic, SMatrix, SimdComplexField, VecStorage}; +use crate::{ArrayStorage, SMatrix, SimdComplexField}; + +#[cfg(any(feature = "std", feature = "alloc"))] +use crate::{DMatrix, DVector, Dynamic, VecStorage}; /// A square matrix. pub type SquareMatrix = Matrix; @@ -332,6 +335,7 @@ impl SMatrix { // TODO: Consider removing/deprecating `from_vec_storage` once we are able to make // `from_data` const fn compatible +#[cfg(any(feature = "std", feature = "alloc"))] impl DMatrix { /// Creates a new heap-allocated matrix from the given [VecStorage]. /// @@ -346,6 +350,7 @@ impl DMatrix { // TODO: Consider removing/deprecating `from_vec_storage` once we are able to make // `from_data` const fn compatible +#[cfg(any(feature = "std", feature = "alloc"))] impl DVector { /// Creates a new heap-allocated matrix from the given [VecStorage]. ///