Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message for invalid syntax in s![] #714

Merged
merged 1 commit into from
Sep 16, 2019
Merged

Conversation

bluss
Copy link
Member

@bluss bluss commented Sep 16, 2019

Invalid syntax, like for example empty s![] or clearly invalid
productions like s![;;] etc, end up in this new catch-all branch of
the macro and produce a clearer error message.

    error: Invalid syntax in s![], expected at least one index or range
      --> src/foo.rs:11:13
       |
    11 |     a.slice(s![]);
       |             ^^^^

Fixes #693

Invalid syntax, like for example empty `s![]` or clearly invalid
productions like `s![;;]` etc, end up in this new catch-all branch of
the macro and produce a clearer error message.

    error: Invalid syntax in s![], expected at least one index or range
      --> src/foo.rs:11:13
       |
    11 |     a.slice(s![]);
       |             ^^^^
@bluss bluss merged commit a9c4392 into master Sep 16, 2019
@bluss bluss deleted the s-compile-error branch September 16, 2019 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero-length slices with s![] causes recursion error
1 participant