Georg Brandl
a91c618fed
Fix reverse_range_loop not taking sign into account ( fixes #409 )
...
Adds a Display impl for Constant, because that might come in handy
elsewhere as well.
2015-10-26 08:05:01 +01:00
Pyriphlegethon
c5ab8d62e3
Fix tests
2015-09-30 18:00:14 +02:00
Nathan Weston
8a5b4f19fd
Check for mutable borrow of counter variable
2015-09-15 09:41:25 -04:00
Nathan Weston
f87dd31f30
New lint: loop with explicit counter variable ( fixes #159 )
...
Avoiding false positives here turns out to be fairly complicated.
2015-09-15 09:41:25 -04:00
llogiq
5c5d103405
added fp test against negative .step_by(_)
2015-09-15 09:12:58 +02:00
swgillespie
bc7d252856
use the constant folder to generalize the lint a little bit and clean up the code. Add additional tests for things that should not be linted
2015-09-14 22:20:56 -07:00
swgillespie
82c524b774
implement empty range lint as described in #330
2015-09-14 17:19:05 -07:00
inrustwetrust
efd553c8a9
Don't show the explicit_iter_loop lint for arrays with more than 32 elements
...
The IntoIterator trait is currently not implemented for arrays with more than
32 elements, so for longer arrays, the iter() or iter_mut() methods must be
used.
2015-09-06 13:36:21 +02:00
Manish Goregaokar
73c34e12b3
Only handle ranges starting with 0 for needless_range_loop ( fixes #279 )
2015-09-02 16:11:54 +05:30
Georg Brandl
0217fb81ee
loops: fix false positives with explicit_iter_loop and references ( fixes #261 )
2015-08-31 08:29:40 +02:00
Georg Brandl
16df79a054
new lint: using collect() to just exhaust an iterator
...
Should use a for loop instead.
2015-08-30 13:10:59 +02:00
Georg Brandl
ffed5b0b23
loops: use a whitelist for the "x.iter() -> &x" lint ( fixes #236 )
2015-08-25 18:28:05 +02:00
Georg Brandl
e9a41e2374
new lint: lint when iterating over any Iterator::next() result ( fixes #182 )
2015-08-17 07:28:40 +02:00
Georg Brandl
9578403638
new lint: looping over x.iter() or x.iter_mut() ( fixes #157 )
2015-08-13 16:31:16 +02:00
Georg Brandl
f6090909d3
new lint: using for i in 0..x { .. vec[i] .. }
instead of iterator ( fixes #3 )
2015-08-13 06:34:08 +02:00