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

Lint range_plus_one and range_minus_one (closes #329) #2116

Merged
merged 3 commits into from
Oct 8, 2017

Conversation

niklasf
Copy link
Contributor

@niklasf niklasf commented Oct 7, 2017

Attempting to implement the idea from #329.

@niklasf niklasf force-pushed the range-plus-minus-one branch from 7d66b9d to fb2c777 Compare October 7, 2017 15:38
@oli-obk
Copy link
Contributor

oli-obk commented Oct 8, 2017

Cool! Can you add some tests? We should also make this allow by default, since inclusive range syntax isn't stable yet

@niklasf niklasf force-pushed the range-plus-minus-one branch from fb2c777 to 9cceb58 Compare October 8, 2017 11:00
@niklasf
Copy link
Contributor Author

niklasf commented Oct 8, 2017

I've added some examples to tests/ui/range_plus_minus_one.rs. Do I have to do anything else, for example to get an .stderr file? ./tests/ui/update-all-references.sh tests/ui/ seems to immediately exit doing nothing.

Update: I retrieved the normalized stderr from Travis. Still curious what would have been the right way to get it.

@niklasf niklasf force-pushed the range-plus-minus-one branch from 9cceb58 to 16781a1 Compare October 8, 2017 12:15
@oli-obk
Copy link
Contributor

oli-obk commented Oct 8, 2017

You need to run cargo test first before running the script without any arguments

@oli-obk oli-obk merged commit 8ce9c24 into rust-lang:master Oct 8, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Oct 8, 2017

Thanks for the new lints. We'll turn it to warn by default once the syntax is stable

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.

2 participants