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

Reject inclusive range without end expression #207

Merged
merged 1 commit into from
Sep 6, 2023
Merged

Reject inclusive range without end expression #207

merged 1 commit into from
Sep 6, 2023

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Sep 6, 2023

Inclusive range without end expression (..= and <start>..=) are strange, and rustc also rejects them (playground).

error[E0586]: inclusive range with no end
 --> src/main.rs:2:15
  |
2 |     for _ in 0..= {
  |               ^^^ help: use `..` instead
  |
  = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
$ cargo hack check --version-range 1.45..=
error: inclusive range `1.45..=` must have end expression; consider using `1.45..` or `1.45..=<end>`

@taiki-e taiki-e added the A-version Area: --rust-version, --version-range, --version-step label Sep 6, 2023
@taiki-e taiki-e merged commit 153d504 into main Sep 6, 2023
@taiki-e taiki-e deleted the version branch September 6, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-version Area: --rust-version, --version-range, --version-step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant