Guillem Nieto
8494f57c82
Fix author lint
...
The author lint was generating invalid code as shown on issue:
https://github.com/rust-lang-nursery/rust-clippy/issues/2442
I've changed the generated code to properly track cast
expressions.
Unfortunatelly, I've had to rewrite the `visit_decl` method, to
avoid that last if of the chain will be added. After looking at the code,
this last line was being added because of the `let x: char` part, but not
because of the `0x45df as char` expression.
It seems that let statements should not generate code on the author
lint, but I'm not sure that this is true or if I'm breaking
something on other code generation parts.
Finally, I've added a test for the author lint, but I'm not sure that
this needs to be added to the testsuite.
2018-02-24 02:19:47 +01:00
Oliver Schneider
ff32d5f734
Fix #2427
2018-02-09 15:25:12 +01:00
Oliver Schneider
88970ec8cf
Remove rarely used type_size
helper function
2018-02-09 15:24:31 +01:00
Oliver Schneider
6f48e37d22
Merge pull request #2444 from phansch/fix_incorrect_useless_attribute_suggestion
...
Partly fix incorrect useless_attribute suggestion
2018-02-07 09:07:46 +01:00
Philipp Hansch
81f5969704
Partly fix incorrect useless_attribute suggestion
...
This fixes an incorrect suggestion from the `useless_attribute` lint
when using `cfg_attr`.
Additionally, it will not show a suggestion anymore, if the attribute
begins on a previous line, because it is much harder to construct the
span of multi-line `cfg_attr` attributes as they don't appear in the AST.
To fix it completely, one would have to parse upwards into the file,
and find the beginning of the `cfg_attr` attribute.
2018-02-06 22:35:11 +01:00
flip1995
63a7daf78c
Make decimal_literal_representation a restriction lint
2018-02-06 13:05:20 +01:00
Guillem Nieto
bcf2e41421
Fix ICE comparing ExprRange
...
`eq_expr` on hir::utils was throwing an ICE due to an invalid
LateContext being used. Due to this missusage, it was generating an ICE
with the code on the following issue:
https://github.com/rust-lang-nursery/rust-clippy/issues/2423
2018-02-06 01:06:32 +01:00
Oliver Schneider
503a63390d
Cleanup calls to layout_of
2018-02-05 11:28:09 +01:00
Oliver Schneider
7fddc6116e
Merge pull request #2415 from HMPerson1/fix-2356
...
Fix `ImplItem`s being ignored
2018-02-05 08:19:11 +01:00
messense
5226b664a1
Rustup to rustc 1.25.0-nightly ( 0c6091fbd
2018-02-04)
2018-02-05 12:16:17 +08:00
HMPerson1
3a4ea45821
Fix get_enclosing_block
2018-02-02 01:53:48 -05:00
Frederick Zhang
c5ee8b5dfb
set CodeSuggestion approximate to false. fixes #2429
2018-02-02 16:24:32 +11:00
Seiichi Uchida
e40bc64f4f
Rustup to rustc 1.25.0-nightly ( 7d6e5b9da
2018-01-27)
2018-01-28 16:28:48 +09:00
Michael Wright
daa39b3be1
Fix compilation
...
Fix the compilation broken by these two changes:
+ 2d56abfbeb (diff-7fceb7ede15b205bf5ad812c31d75384L1459)
+ ccf0d8399e (diff-64b696b0ef6ad44140e973801ed82b25L2771)
2018-01-27 15:03:17 +02:00
Devon Hollowood
0413b3f6cf
Add misaligned_transmute lint
2018-01-25 00:48:36 -08:00
Oliver Schneider
ea042657e5
Enable more patterns in the author lint
2018-01-24 13:04:06 +01:00
Oliver Schneider
8e7f76db9a
Merge pull request #2362 from flip1995/master
...
Lint for numeric literals that have a better representation
2018-01-23 15:54:35 +01:00
flip1995
600147926b
Apply requested changes
2018-01-23 15:29:31 +01:00
flip1995
23f90afa1b
Add configurable threshold, default: 4096
2018-01-23 12:34:40 +01:00
Oliver Schneider
70302595a4
Merge branch 'master' of github.com:Manishearth/rust-clippy into fold_any
2018-01-19 12:10:24 +01:00
Oliver Schneider
3c6064130b
Merge pull request #2367 from etaoins/inline-fn-without-body-lint
...
Lint for trait methods without bodies
2018-01-19 09:14:46 +01:00
Ryan Cumming
7467b83377
Suggest removing inline attributes
...
This adds a `suggest_remove_item` helper that will remove an item and
all trailing whitespace. This should handle both attributes on the same
line as the function and on a separate line; the function takes the
position of the original attribute.
2018-01-18 20:02:42 +11:00
Manish Goregaokar
552e950080
needless_pass_by_value: Whitelist RangeArgument ( fixes #2357 )
2018-01-18 14:30:53 +05:30
Phil Ellison
b73efad600
Add some reviewer comments
2018-01-17 21:06:16 +00:00
Phil Ellison
a64d19cc0e
Fix error span to play nicely with rustfix
2018-01-16 21:20:55 +00:00
Oliver Schneider
d011dae96d
Rustup
2018-01-15 12:08:17 +01:00
Phil Ellison
70a5535ffa
Address some review comments
2018-01-14 18:18:09 +00:00
Phil Ellison
528be23c07
Move get_arg_name into utils
2018-01-14 10:05:01 +00:00
Trevor Spiteri
a5d0569a20
Add "NaNs" and "GitLab" to doc-valid-idents
2018-01-02 13:51:35 +01:00
Oliver Schneider
8ddcb81a15
Rustup and lazy_static version mismatch fix
...
fixes #2274
2017-12-15 10:05:32 +01:00
Frederick Zhang
e91b01348e
fix usage of LayoutDetails
2017-11-21 16:51:36 +11:00
Johannes Hofmann
3efa07f959
Ignore identifier 'OpenStreetMap' for DOC_MARKDOWN lint
2017-11-18 19:13:07 +01:00
Oliver Schneider
c6a4eaeb0d
Rustup
2017-11-15 08:38:43 +01:00
Oliver Schneider
299f1270a6
Rustup
2017-11-10 08:58:54 +01:00
Oliver Schneider
ed589761e6
Merge pull request #2202 from topecongiro/format
...
Run `cargo fmt`
2017-11-06 08:35:52 +01:00
Matt Kraai
b778659c42
Fix compilation errors with rustc 1.23.0-nightly ( d762b1d6c
2017-11-04)
...
Fixes #2204
2017-11-05 04:19:11 -08:00
topecongiro
7a06d312fd
Cargo fmt
2017-11-05 04:55:56 +09:00
sinkuu
c102d50ece
&Self
2017-11-03 17:56:17 +09:00
sinkuu
be7c4b4862
Fix test
2017-11-03 17:36:38 +09:00
kennytm
44d3ea5308
Fix lint_without_lint_pass
2017-10-31 10:04:02 -07:00
Manish Goregaokar
f76225e388
Handle TyForeign
2017-10-29 05:21:25 -04:00
Alex Burka
24a2c14733
remove if_let_chain
2017-10-23 17:53:30 -04:00
Alex Burka
2153d1e560
manual fixups if_let_chain -> if_chain
2017-10-23 17:53:30 -04:00
Alex Burka
41840ae3c4
mechanically swap if_let_chain -> if_chain
2017-10-23 15:18:02 -04:00
HMPerson1
e5076d06db
Add lint for From<String>
2017-10-20 20:47:30 -04:00
Paul Florence
406931381b
Fixed some code in clippy to pass the new, removed formatting changes.
2017-10-20 10:17:41 -04:00
Oliver Schneider
343e438f9d
Merge pull request #2120 from sinkuu/implicit_hasher
...
Implicit hasher lint
2017-10-17 15:24:20 +02:00
sinkuu
c3332ca92e
Fix panic with fake Range
type
2017-10-13 21:51:57 +09:00
sinkuu
5a61d88fa1
Apply suggestions
2017-10-11 22:17:00 +09:00
Oliver Schneider
73a1dd8e7f
Merge pull request #2117 from sinkuu/improve_take_by_value
...
Improve needless_pass_by_value
2017-10-08 20:14:55 +02:00