Parse other types of array length expressions
diff --git a/src/ty.rs b/src/ty.rs
index b33206a..f9e3a2d 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -211,7 +211,11 @@
pub mod parsing {
use super::*;
use {TraitBoundModifier, TyParamBound};
+ #[cfg(feature = "full")]
+ use ConstExpr;
use constant::parsing::const_expr;
+ #[cfg(feature = "full")]
+ use expr::parsing::expr;
use generics::parsing::{lifetime, lifetime_def, ty_param_bound, bound_lifetimes};
use ident::parsing::ident;
use lit::parsing::quoted_string;
@@ -248,6 +252,7 @@
(Ty::Slice(Box::new(elem)))
));
+ #[cfg(not(feature = "full"))]
named!(ty_array -> Ty, do_parse!(
punct!("[") >>
elem: ty >>
@@ -257,6 +262,19 @@
(Ty::Array(Box::new(elem), len))
));
+ #[cfg(feature = "full")]
+ named!(ty_array -> Ty, do_parse!(
+ punct!("[") >>
+ elem: ty >>
+ punct!(";") >>
+ len: alt!(
+ terminated!(const_expr, punct!("]"))
+ |
+ terminated!(expr, punct!("]")) => { ConstExpr::Other }
+ ) >>
+ (Ty::Array(Box::new(elem), len))
+ ));
+
named!(ty_ptr -> Ty, do_parse!(
punct!("*") >>
mutability: alt!(