Skip to content

Commit

Permalink
Merge pull request #714 from rust-ndarray/s-compile-error
Browse files Browse the repository at this point in the history
Add error message for invalid syntax in s![]
  • Loading branch information
bluss authored Sep 16, 2019
2 parents f607ff6 + 3829f52 commit a9c4392
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ macro_rules! s(
(@convert $r:expr, $s:expr) => {
<$crate::SliceOrIndex as ::std::convert::From<_>>::from($r).step_by($s as isize)
};
// Catch-all clause for syntax errors
(@parse $($t:tt)*) => { compile_error!("Invalid syntax in s![], expected at least one index or range") };
($($t:tt)*) => {
// The extra `*&` is a workaround for this compiler bug:
// https://github.com/rust-lang/rust/issues/23014
Expand Down

0 comments on commit a9c4392

Please sign in to comment.