Commit Graph

821 Commits

Author SHA1 Message Date
Enrico Schmitz
8380dd31da Fix wrong life time for all_ranges 2017-03-01 14:45:45 +01:00
Enrico Schmitz
38251dccb0 Array lengths are usize, so you need ConstInt::Usize(...) 2017-03-01 14:44:52 +01:00
Oliver Schneider
a1dc49c51b Remove unused import 2017-03-01 14:07:08 +01:00
Enrico Schmitz
f66e0aad84 Fix for rustc 1.17.0-nightly (be760566c 2017-02-28) 2017-03-01 13:24:19 +01:00
Oliver Schneider
d53b878af6 Merge branch 'master' into 1537-drop_copy 2017-02-27 12:36:34 +01:00
Oliver Schneider
07698d1574 Run rustfmt 2017-02-27 09:49:02 +01:00
Oliver Schneider
b9f183d31f rustup 2017-02-27 09:45:02 +01:00
Tristian Celestin
12af338150 Add space between colon and type annotation
Wrapped string in Rust don't require a backslash
2017-02-26 23:07:53 -05:00
Tristian Celestin
75e28610a7 Merged drop_forget_ref.rs with drop_forget_copy.rs.
Moved constant message strings out of declare_lint! macros.
2017-02-26 21:57:47 -05:00
Tristian Celestin
3075b01d8c Stored linter messages in constants.
Use is_copy() function instead of calling moves_by_default()
2017-02-26 17:57:56 -05:00
Tristian Celestin
aa037d1ef0 Merge branch 'master' into 1537-drop_copy 2017-02-25 23:11:21 -05:00
Tristian Celestin
b8defc6cc4 Warn on calls to std::mem::drop or std::mem::forget with a Copy type 2017-02-25 23:05:37 -05:00
sinkuu
5906639af5 Enable len_zero for slices 2017-02-25 12:26:33 +09:00
Oliver Schneider
19929790aa Merge pull request #1561 from Manishearth/zero_ptr
New zero_ptr lint.
2017-02-22 13:34:28 +01:00
sinkuu
1e26c44010 Suggest assert_ne for assert!(x != y) 2017-02-22 16:47:18 +09:00
Andre Bogus
3c04109fcc fix German keyboard fail 2017-02-21 17:28:17 +01:00
Oliver Schneider
d032b8967c Merge pull request #1491 from Manishearth/into_iter_on_ref
fix explicit_into_iter_loop on references
2017-02-21 14:55:52 +01:00
Oliver Schneider
27aa309b3d Merge pull request #1556 from sinkuu/take_by_value
Lint needless take-by-value
2017-02-21 13:07:25 +01:00
Oliver Schneider
42c451c122
update help message to match the suggestion 2017-02-21 12:04:48 +01:00
Oliver Schneider
21a0b16aee
adjust messages in tests 2017-02-21 12:04:29 +01:00
Oliver Schneider
c46178c518
rustfmt 2017-02-21 12:01:41 +01:00
Oliver Schneider
c1cf5a2cde
cleanup and create another helper function that we should use more often 2017-02-21 12:01:41 +01:00
Oliver Schneider
0bea3e76d4
fix explicit_into_iter_loop on references
fixes #1398
2017-02-21 12:01:41 +01:00
sinkuu
bf21c84629 Ensure deref_span is empty for Vec and String 2017-02-21 19:45:45 +09:00
sinkuu
cb86c57c5f Integrate suggestion spans 2017-02-21 19:03:50 +09:00
sinkuu
3516d45d7c Use multispan_sugg 2017-02-21 18:44:31 +09:00
Oliver Schneider
f07f793fa8 Merge pull request #1544 from bood/master
Add lint for unnecessary casts (cast to same type)
2017-02-21 09:16:07 +01:00
Andre Bogus
2f7babba82 New zero_ptr lint.
This fixes #1047. I did not bother to add a full suggestion,
because replacing with `std::ptr::null()` may still lead to
inference failures.
2017-02-21 04:36:59 +01:00
sinkuu
627d24c80f Fix suggestion for let <pat> 2017-02-21 00:27:12 +09:00
sinkuu
f1b0b774e7 Support non-moving usages at match
This `match` is not moving the `String`:

```rust
fn foo(x: Option<String>) -> i32 {
    match x {
        Some(_) => 1,
        None => 2,
    }
}
```

With this change, it will be linted and suggested to add `*` to deref it.

```rust
fn foo(x: &Option<String>) -> i32 {
    match *x {
        Some(_) => 1,
        None => 2,
    }
}
```
2017-02-20 16:45:37 +09:00
sinkuu
0a6bc6031a Rename lint to needless_take_by_value
And fixes false-positives for generics and `match`
2017-02-20 16:02:48 +09:00
Phil Ellison
2dd45b7317 Use span of impl/trait in len_without_is_empty error message, rather than the span of the len method 2017-02-19 15:14:30 +00:00
sinkuu
d2f73e7818 Add explanation 2017-02-19 18:07:37 +09:00
sinkuu
d81d961ba7 Lint needless take-by-value 2017-02-19 07:59:44 +09:00
Bood Qian
97d46232b4 Merge branch 'master' of github.com:Manishearth/rust-clippy 2017-02-18 11:12:13 +08:00
sinkuu
d2b9b7ece2 Fix language & if_let_chain usage 2017-02-18 10:14:25 +09:00
sinkuu
8cb2ec804d Support generic type 2017-02-18 10:14:25 +09:00
sinkuu
16e53c9868 Run update_lints.py 2017-02-18 10:14:20 +09:00
sinkuu
6bb426b0e3 Add should_assert_eq lint (fixes #641) 2017-02-18 10:13:56 +09:00
Oliver Schneider
9d8dc689c7 rustfmt again 2017-02-17 13:41:59 +01:00
Oliver Schneider
b1f766b37b fix dogfood tests 2017-02-17 13:23:19 +01:00
Andre Bogus
6c8a6c18ab deal with binary op short-circuit 2017-02-17 08:49:34 +01:00
Andre Bogus
505eb53d29 New never loop lint
This lint detects loops that unconditionally break or return.

Closes #257
2017-02-17 04:53:14 +01:00
Bood Qian
05a6945adc Rust fmt 2017-02-17 08:39:58 +08:00
Ben Boeckel
84509ca48a typos: coma -> comma 2017-02-16 11:23:28 -05:00
Bood Qian
2f00ea3a07 Suppress lint for unsuffixed number casts 2017-02-16 22:55:41 +08:00
Bood Qian
afce85e96d Add lint for unnecessary casts (cast to same type) 2017-02-15 22:20:20 +08:00
Oliver Schneider
40ea5e8c5d run util/update_lint 2017-02-13 11:40:27 +01:00
Oliver Schneider
2265babe6a
Merge remote-tracking branch 'origin/master' into clonedCollect 2017-02-13 11:40:02 +01:00
Oliver Schneider
b13d206a22 run rustfmt 2017-02-13 11:18:03 +01:00
Oliver Schneider
637a4590f6
Merge remote-tracking branch 'origin/master' 2017-02-13 11:15:12 +01:00
Martin Carton
9a7597d5af Merge pull request #1528 from Manishearth/mut-from-ref
New `mut_from_ref` lint
2017-02-12 16:01:15 +01:00
Andre Bogus
2a0bfdcd72 rustfmt 2017-02-12 14:11:18 +01:00
Andre Bogus
36b8554cf1 add notes for immutable inputs 2017-02-12 13:53:30 +01:00
f001
b3570db094 update via comments 2017-02-12 20:40:38 +08:00
f001
5a039f68f7 format adjust 2017-02-12 17:24:59 +08:00
f001
98aa0db0ac Add a lint for slice.iter().cloned().collect()
If one uses `slice.iter().cloned().collect()` to create a new `Vec`,
it should be `slice.to_owned()`.

Fix #1292
2017-02-12 17:03:09 +08:00
Bood Qian
9824c997fe Remove unnecessary ref 2017-02-12 09:16:37 +08:00
Bood Qian
1c381ec642 Move more into if_let_chain 2017-02-11 22:11:19 +08:00
Bood Qian
12c53752b8 Apply rustfmt 2017-02-11 21:47:26 +08:00
Bood Qian
64d2f8af8e Lint on panic! only 2017-02-11 21:42:42 +08:00
Bood Qian
a2d752807a Lint on Err(_) arm of a match 2017-02-11 14:57:50 +08:00
Owen Sanchez
8fb582ea1c rustfmt 2017-02-10 21:08:50 -07:00
Owen Sanchez
45a7012fd9 Search directly for the largest and smallest variants instead of sorting 2017-02-10 18:12:32 -07:00
Owen Sanchez
1938904fcd Change large_enum_variant to lint against size differences rather than size 2017-02-10 18:12:32 -07:00
Owen Sanchez
7e4b633417 Add some writes to a log file for debugging 2017-02-10 18:11:10 -07:00
Andre Bogus
bff4c30ac7 added test, fixed message & description, rustfmt 2017-02-11 00:32:12 +01:00
Andre Bogus
5650a599a8 New mut_from_ref lint
This fixes #1507.
2017-02-10 19:39:03 +01:00
Martin Carton
37a0e52a1e Merge pull request #1520 from Manishearth/rustup
rustup and compile-fail -> ui test move
2017-02-08 21:07:19 +01:00
Nathan Musoke
f2603ba2b2 doc-markdown: Allow LaTeX-related words
Add "TeX", "LaTeX", "BibTeX" and "BibLaTeX" to the default list of allowed
words.
2017-02-08 09:14:18 +13:00
Oliver Schneider
fd1351f6e3 rustup and compile-fail -> ui test move 2017-02-07 21:05:30 +01:00
Martin Carton
4ee839857b Merge pull request #1506 from bood/master
Lint for possible missing comma in an array #1177
2017-02-07 18:56:38 +01:00
Owen Sanchez
59e0ae75d0 Make rustfmt happy 2017-02-05 09:51:31 -07:00
Owen Sanchez
31919aff3b Revert changes from accidentally running rustfmt 2017-02-04 22:22:33 -07:00
Owen Sanchez
c922eb9db5 Suggest to use a wrapper in the wiki for the empty_enum lint 2017-02-04 22:09:54 -07:00
Owen Sanchez
1193f4fb68 Run update_lints.py 2017-02-04 21:54:21 -07:00
Owen Sanchez
49238ad1d2 Implement empty_enum lint and add a test 2017-02-04 21:52:44 -07:00
Owen Sanchez
e88e637b67 Add empty_enum lint (just a copy of large_enum_variant for now) 2017-02-04 21:07:54 -07:00
Bood Qian
4b4dc0a4d3 Fix lint name in comment too 2017-02-05 11:06:19 +08:00
Oliver Schneider
d198b99472 fix false negatives introduced in the rustup 2017-02-04 16:59:06 +01:00
Bood Qian
9ace6c7ffc Consider expression with macro for possible missing comma lint 2017-02-04 21:13:36 +08:00
Oliver Schneider
384eb82526 don't record elided lifetimes on trait objects 2017-02-04 13:18:51 +01:00
Bood Qian
97301434cd Fix abbreviations in document 2017-02-04 20:11:43 +08:00
Bood Qian
25fd8c6ba1 Shorten lint name for possible missing comma 2017-02-04 20:05:25 +08:00
Mrmaxmeier
d68f0797bf Rustup to nightly from 2017-01-31 2017-02-03 14:16:14 +01:00
Mrmaxmeier
2be75ef973 repeat_str feature has been stablilized 2017-02-03 14:16:14 +01:00
Mrmaxmeier
2216a890a6 TyCtxt::map is now called TyCtxt::hir 2017-02-03 14:16:07 +01:00
Bood Qian
33577ec3f7 Lint for possible missing comma in an array #1177 2017-02-03 19:10:30 +08:00
Martin Carton
b1be0d6457 Merge pull request #1492 from Manishearth/largeEnumVariant
large_enum_variants lint suggests to box variants above a configurable limit
2017-01-31 19:12:43 +01:00
Oliver Schneider
909ef37f08 Merge pull request #1490 from Manishearth/excl_range_pat_overlap
correctly check exclusive range patterns for overlap
2017-01-31 12:40:21 +01:00
Oliver Schneider
75f605ccf6 rustfmt 2017-01-31 11:26:18 +01:00
Oliver Schneider
9bda699c80 improve messages and add suggestions 2017-01-31 08:36:39 +01:00
Oliver Schneider
d9ec55e695 address nits 2017-01-31 08:08:54 +01:00
Ben Boeckel
2cdba9cd85 methods: fix the option_unwrap_used message
It had a hard linewrap in it rather than flowing naturally. This
confused the Vim error matching.
2017-01-30 10:44:52 -05:00
Oliver Schneider
82dd50d0e2 large_enum_variants lint suggests to box variants above a configurable limit 2017-01-30 13:17:56 +01:00
Oliver Schneider
aebdf74e16 correctly check exclusive range patterns for overlap 2017-01-30 12:30:16 +01:00
Pascal Hertleif
2ba03c8467 Make Travis' rustfmt happy 2017-01-28 14:17:37 +01:00
Pascal Hertleif
8cbf548f7e Add suggestions to EXPLICIT_[INTO_]ITER_LOOP
Also reduces the highlighted span to the expr containing the
`.[into_]iter()` call (so the suggestion is probably applicable by
rustfix.)

Fixes #1484
2017-01-28 14:02:49 +01:00
Tom Prince
a140c3c1bf Remove unused import. 2017-01-26 15:41:00 -07:00
Tom Prince
3e03b5d1a7 Fix #1476: Add support for exclusive pattern matches. 2017-01-26 15:32:34 -07:00
Oliver Schneider
26e8558d8a
remove rustc-serialize dependency and factor util::cargo out into a crate 2017-01-26 11:31:26 +01:00
mcarton
b784f0d736
Use span_suggestion in the precedence lint 2017-01-22 15:00:10 +01:00
Pascal Hertleif
b228434036 Rustfmtup to 0.7.1 2017-01-21 18:04:59 +01:00
Pascal Hertleif
6f103de164 Rustup to nightly from 2017-01-20
Adjust `multispan_sugg` to rust-lang/rust#38955
2017-01-21 17:20:01 +01:00
mcarton
426660f00c
Fix rustfmt 2017-01-20 19:09:04 +01:00
Mrmaxmeier
84c57ad221 rustup to rustc 1.16.0-nightly (c07a6ae77 2017-01-17) 2017-01-18 21:35:38 +01:00
Oliver Schneider
713da45906
apply rustfmt 2017-01-17 19:30:32 +01:00
Oliver Schneider
219da6d736 Merge pull request #1444 from Manishearth/or_else_method
Extend or_fun_call to also cover methods
2017-01-15 14:38:51 +01:00
sinkuu
cdfe002ee1 Use closure body span (fixes #1405) 2017-01-15 13:16:02 +09:00
Andre Bogus
94c97d2ec9 formatting 2017-01-15 01:12:16 +01:00
Andre Bogus
b764b2a7aa extend or_fun_call lint to cover methods 2017-01-15 00:31:20 +01:00
Andre Bogus
2fdb6e4d1a deprecate extend_from_slice lint 2017-01-14 14:39:41 +01:00
Oliver Schneider
d944d7df9a
rustup to 2017-01-12 2017-01-13 17:04:56 +01:00
Oliver Schneider
3cc5596466 Merge pull request #1433 from sinkuu/ref
Don't lint needless_borrow when matching `&&mut` by `&ref`
2017-01-10 17:29:19 +01:00
sinkuu
c9091b71a1 Don't lint when matching &&mut by &ref (Fix #1432) 2017-01-11 00:42:58 +09:00
Manish Goregaokar
87db342304 run rustfmt 2017-01-09 23:56:13 -08:00
Oliver Schneider
e066997046
FOR_KV_MAP can now lint on mutable maps due to values_mut() 2017-01-10 08:33:20 +01:00
sinkuu
a2bcce9dbf Move is_try to util
Removed unnecessary condition

Also changed lint span of `try` from surrounded expression to entire `try`
invocation. It turned out that compiletest misses errors for macro invocations.
2017-01-07 23:52:48 +09:00
sinkuu
ce6e037ac5 Implement unused_io_amount lint 2017-01-07 22:23:33 +09:00
Theemathas Chirananthavat
e4a4d0c361 Implement the forget_ref lint. 2017-01-05 17:41:01 -08:00
Theemathas Chirananthavat
f55d20ff46 Refactor drop_ref.rs to use the if_let_chain macro. 2017-01-05 17:41:01 -08:00
Oliver Schneider
f145fc44f8 Merge pull request #1414 from samueltardieu/no-short-circuit-if
Add a new "short_circuit_statement" lint (fixes #1194)
2017-01-05 10:41:14 +01:00
Manish Goregaokar
9a301fd508 Bump to 0.0.106; Fix false positive in wrong_self_convention (fix #1420) 2017-01-04 18:05:04 -08:00
Manish Goregaokar
ab42f02003 Rerun rustfmt 2017-01-04 15:53:16 -08:00
Manish Goregaokar
b101611a97 Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Dogfood fixes 2017-01-04 15:50:57 -08:00
Manish Goregaokar
d6dd65620e Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Fix self type 2017-01-04 15:50:54 -08:00
Manish Goregaokar
571369af1b Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Borrow and spelling fixes 2017-01-04 15:50:50 -08:00
Manish Goregaokar
0437327976 Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): More u128 fixes 2017-01-04 15:50:47 -08:00
Manish Goregaokar
e02fac4896 Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Recover patterns from arguments 2017-01-04 15:50:43 -08:00
Manish Goregaokar
a262e3bb0b Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Eliminate has_self util 2017-01-04 15:50:37 -08:00
Josh Holmer
5aea0b2062 Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): u128 fixes for rustup 2017-01-04 15:50:34 -08:00
Josh Holmer
64f5dbc9f8 Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Body fixes for rustup 2017-01-04 15:50:30 -08:00
Manish Goregaokar
f552f170db Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Fix various type errors for rustup 2017-01-04 15:50:18 -08:00
Samuel Tardieu
82b2f5663f Add a new "short_circuit_statement" lint (fixes #1194) 2016-12-31 01:17:39 +01:00
Manish Goregaokar
b8b54eb0d8 Fix suggestion span on new_without_default (fixes #1407) 2016-12-29 11:19:32 -08:00
Theemathas Chirananthavat
e1c540bfd1 Implement the double_parens lint. 2016-12-28 12:03:49 -08:00
Theemathas Chirananthavat
d76fa3dfd9 Add skeleton for double_parens lint. 2016-12-28 11:21:53 -08:00
Martin Carton
96d2483b09 Merge pull request #1400 from oli-obk/needed_needless_lifetime
support impl trait for needless lifetimes
2016-12-25 18:24:39 +01:00
Oliver Schneider
ba59ba3afc fix rustfmt 2016-12-25 17:49:39 +01:00
Martin Carton
7c480d0db7 Merge pull request #1394 from Manishearth/absurd_extreme_comparisons_false_positive
fix absurd extreme comparisons false positive
2016-12-25 17:47:42 +01:00
Oliver Schneider
93333f0d7b
support impl trait for needless lifetimes 2016-12-22 15:51:59 +01:00
Oliver Schneider
2f219b827e
fix an ice related to associated types
fixes #1341
2016-12-22 14:16:07 +01:00
Oliver Schneider
0b10a41ef3
fix absurd extreme comparisons false positive
fixes #1387
2016-12-21 16:49:53 +01:00
Oliver Schneider
7a1d85f1de Merge branch 'master' into allow_deprecated 2016-12-21 15:47:12 +01:00
Oliver Schneider
00a3bfb8eb
Don’t warn for types used in trait implementation 2016-12-21 15:42:20 +01:00
Oliver Schneider
90fc9c389f
split pub_enum_variant_names to new lint 2016-12-21 13:30:57 +01:00
Oliver Schneider
49e3419b87
shorten deprecated lints line length 2016-12-21 12:50:39 +01:00
Oliver Schneider
53fc09ec46
autogenerated functions are ignored by rustfmt 2016-12-21 12:40:56 +01:00
Oliver Schneider
009c6d95d7
manually fix the overlong lines 2016-12-21 12:30:41 +01:00
Oliver Schneider
47eead5ada
function definition style simplification 2016-12-21 12:14:54 +01:00
Oliver Schneider
ed9d71f2c9
remove nondeterminism by adjusting thresholds 2016-12-21 10:25:14 +01:00
Oliver Schneider
299d7be132
rustfmt fallout in doc comments 2016-12-21 10:00:13 +01:00
Oliver Schneider
44533f09aa
rustfmt round n 2016-12-21 09:45:24 +01:00
Oliver Schneider
4a4e1ea2c5
also run rustfmt on clippy-lints 2016-12-20 18:21:30 +01:00
mcarton
7dd3679ac3
Fix a couple warnings 2016-12-19 20:31:39 +01:00
Manish Goregaokar
d61c7fc747 Merge pull request #1355 from philipturnbull/deref-addrof
Lint usage of `*&` and `*&mut`
2016-12-19 03:35:45 -08:00
Oliver Schneider
5aded99033
don't lint on x = x + y inside an AddAssign impl
fixes #1302
2016-12-19 11:13:07 +01:00
Arnavion
3de6f9db20 Use inputs/output getters for rustc::ty::FnSig instead of the now non-existent fields. 2016-12-10 23:57:19 -08:00
Oliver Schneider
778ce4dfd3
update to the rust-PR that unblocks clippy 2016-12-07 13:13:40 +01:00
Oliver Schneider
c6e2967b9c
rustup to rustc 1.15.0-dev (3b248a184 2016-12-05) 2016-12-06 11:32:21 +01:00
mcarton
1ba8ed96cf
Fix dogfood 2016-12-02 22:33:16 +01:00
mcarton
65ff2df7e7
Fix copy lints 2016-12-02 22:23:24 +01:00
mcarton
fe15880beb Revert "down to for-loops not comparing as equal"
This reverts commit cf1fa94be1.
2016-12-02 20:54:05 +01:00
Oliver Schneider
8e1f6dce40 enum detection by style convention 2016-12-02 19:30:00 +01:00
Oliver Schneider
ff2487b30e permit more equalities 2016-12-02 19:23:30 +01:00
Oliver Schneider
cf1fa94be1 down to for-loops not comparing as equal 2016-12-02 19:19:52 +01:00
Oliver Schneider
16aab71688
enum glob use and copies left 2016-12-02 17:38:31 +01:00
Wim Looman
919feaaec5 Allow allow(deprecated) attribute on use items
fixes #1372
2016-12-01 22:36:35 +01:00
Oliver Schneider
59b0077565 WIP compiles and doesn't crash (much) but tests are failing 2016-12-01 22:31:56 +01:00
Oliver Schneider
31e482403c rustup to rustc 1.15.0-nightly (d5814b03e 2016-11-23) 2016-11-25 19:24:55 +01:00
Phil Turnbull
0ee6128e27 Convert DEREF_ADDROF to EarlyLintPass 2016-11-25 10:33:21 -05:00
Martin Carton
11ca07c8ad Merge pull request #1360 from Manishearth/rustup
Rustup to *rustc 1.15.0-nightly (3bf2be9ce 2016-11-22)* and bump to 0.0.102
2016-11-24 18:12:20 +01:00
Oliver Schneider
9717b9585d Merge pull request #1363 from hdhoang/patch-2
useless_format: fix typo
2016-11-24 11:20:52 +01:00
Hoàng Đức Hiếu
f5ccc2fe6f useless_format: fix typo 2016-11-24 16:10:22 +07:00
Hoàng Đức Hiếu
4215292793 let_if_seq: fix rewrite example 2016-11-24 16:09:09 +07:00
mcarton
c7e3cc1e27
Rustup to *rustc 1.15.0-nightly (3bf2be9ce 2016-11-22)* 2016-11-23 22:44:00 +01:00
mcarton
c35f82b823
Rustup to *rustc 1.15.0-nightly (7b3eeea22 2016-11-21)* 2016-11-23 21:31:55 +01:00
Phil Turnbull
a9f5b90f0f Lint usage of *& and *&mut
fixes #1316
2016-11-22 21:06:20 -05:00
Martin Carton
530083c3b9 Merge pull request #1349 from philipturnbull/extend-chars
Lint `.extend(s.chars())` (closes #792)
2016-11-22 18:21:30 +01:00
Phil Turnbull
8705f3d11c Remove mention of .push_str(s) being faster
For the `.push_str(str.chars())` case the compiler will inline `push_str` and
call `extend_from_slice` on the underlying vector, so this isn't actually
faster.
2016-11-20 17:28:14 -05:00
Phil Turnbull
e9f3911899 Suggest &s instead of s.as_str() 2016-11-20 11:19:36 -05:00
sinkuu
5d40965b50 Fix #1346 2016-11-20 10:15:40 +09:00
sinkuu
1973e94550 Allow explicit returns with cfg attributes 2016-11-20 10:02:41 +09:00
mcarton
be799bc085
Rustup to *rustc 1.15.0-nightly (ac635aa95 2016-11-18)* 2016-11-20 00:13:08 +01:00
Phil Turnbull
73a73638c0 Add lint for string.extend(string.chars())
fixes #792
2016-11-19 14:55:47 -05:00
Phil Turnbull
fa78b09fa7 Add lint for string.extend("str".chars())
fixes #792
2016-11-19 14:55:02 -05:00
Phil Turnbull
0ab7e6c598 Factor out lint_vec_extend 2016-11-19 14:44:32 -05:00
mcarton
7140eac484 Cleanup 2016-11-18 13:40:44 +01:00
Oliver Schneider
f39c6278e1
fix the inspector 2016-11-18 13:21:07 +01:00
mcarton
945c027768
Handle closure with single expression blocks 2016-11-17 19:44:18 +01:00
mcarton
19c5f5394b
Rustup to rustc 1.15.0-nightly (0ed951993 2016-11-14) 2016-11-16 23:05:26 +01:00
Sébastien Santoro
0e6807e86b Recognize quux as a metasyntactic variable
quux is another metasyntactic variable like foo and so
should be detected by the blacklisted names linter.
2016-11-11 05:57:29 +01:00
Oliver 'ker' Schneider
cfae1e9fda fix ice in len_zero lint when type has no inherent impls at all
fixes #1336
2016-11-10 17:06:39 +01:00
Oliver Schneider
a260e65ead Merge pull request #1312 from devonhollowood/get-unwrap
Implement `get_unwrap` lint
2016-11-09 09:49:20 +01:00
Devon Hollowood
e94a4d4666 Fix suggestion in get_unwrap lint 2016-11-02 11:48:16 -07:00
Oliver Schneider
a56af73fd8
mark cyclomatic complexity attribute as used
fixes #1315
2016-11-02 10:29:57 +01:00
Devon Hollowood
6a14dc7fd4 Remove false positives from get_unwrap lint
HashMap and BTreeMap don't implement `IndexMut`, so we shouldn't lint
for use of `get_mut().unwrap()` for those types.
2016-11-01 17:48:32 -07:00
Devon Hollowood
4e0d182d1d Clean up get_unwrap code 2016-11-01 17:48:18 -07:00
Devon Hollowood
c5e270a1aa Small fixes for get_unwrap lint 2016-11-01 01:08:38 -07:00
Devon Hollowood
cfc741405b Run update_lints.py 2016-10-31 23:43:19 -07:00
Devon Hollowood
0680ac3562 Add get_unwrap lint 2016-10-31 23:42:33 -07:00
Gibson Fahnestock
c40466e1c2 Add to docs for if_let_some_result 2016-10-31 22:55:22 +00:00
Oliver Schneider
053896b678 Merge pull request #1307 from Kha/partialeq_ne
Implement 'Re-implementing `PartialEq::ne`' lint
2016-10-31 09:06:14 -04:00
Sebastian Ullrich
9314965af0 inspector: fix printing non-local trait refs 2016-10-30 15:00:59 -04:00
Sebastian Ullrich
8664d03ec6 implement 'Re-implementing PartialEq::ne' lint
closes #86
2016-10-30 15:00:59 -04:00
Oliver Schneider
8b2e80b47b Merge pull request #1299 from Manishearth/clippy-toml
Search for `clippy.toml` recursively
2016-10-30 14:35:32 -04:00
Sebastian Ullrich
90f71be4e9 factor out is_automatically_derived util fn 2016-10-30 14:25:06 -04:00
d-dorazio
d213040381 Add lint for redundant pattern matching in iflet for Result/Option 2016-10-30 15:43:46 +01:00
Devon Hollowood
3a0d342a33 Fix false positive for wrong_self_convention 2016-10-27 01:11:34 -07:00
mcarton
d52af53e04
Search for clippy.toml recursively 2016-10-25 19:41:24 +02:00
Oliver Schneider
233459ea33
clean up docs for clippy_dump 2016-10-24 16:30:22 +02:00
Oliver Schneider
34deb72c36
properly name the docs 2016-10-24 15:43:37 +02:00
Oliver Schneider
ed50cb133d
dogfood 2016-10-24 15:16:21 +02:00
Oliver Schneider
6a6dfa59da
factor out decl dumping 2016-10-24 14:29:09 +02:00
Oliver Schneider
1248159f0d
add expression and pattern dump 2016-10-24 14:28:58 +02:00
Oliver Schneider
f29ab8c245
Merge branch 'master' of github.com:Manishearth/rust-clippy into deep_code_inspection 2016-10-24 10:39:19 +02:00
Arnavion
2315a817ce Changed signature of cargo::metadata according to review comment. 2016-10-23 12:24:16 -07:00
Arnavion
ebbd00b1ab Don't assume the first package in the result of cargo metadata is the current crate.
Instead find the one with the manifest path that matches the --manifest-path argument or the current directory.

Fixes #1247
2016-10-22 18:15:42 -07:00
mcarton
6960c506ef
Fix unused import warning 2016-10-22 16:16:38 +02:00
mcarton
1c3fce41b6
Rustup to *rustc 1.14.0-nightly (f09420685 2016-10-20)* 2016-10-22 15:57:19 +02:00
Oliver Schneider
a177d85681
rename inspection attribute to clippy_dump 2016-10-18 17:29:01 +02:00
Oliver Schneider
ff3efc759e
initial implementation of the code inspector lint 2016-10-18 16:57:39 +02:00
mcarton
4cf87a9d49
Remove the now stable #[feature(question_mark)] 2016-10-16 14:01:55 +02:00
d-dorazio
62831c6e29 Suggest nth(X) instead of skip(X).next() 2016-10-14 13:38:00 +02:00
Patrick Horlebein
4fbd8906e1 doc_markdown: Added "iOS" and "macOS" to the doc-valid-idents list 2016-10-12 15:32:44 +02:00
d-dorazio
a4d4a372e0 Avoid redundant multiple pattern suggested when one pattern is _ 2016-10-08 16:29:19 +02:00
mcarton
47c2271497
Fix FP with print_with_newline and final arguments 2016-10-06 22:30:03 +02:00
mcarton
fc09eb553e
Fix dogfood problem 2016-10-06 17:50:11 +02:00
mcarton
0475eae1fa
Rustup to *rustc 1.14.0-nightly (3210fd5c2 2016-10-05)* 2016-10-06 17:46:50 +02:00
Martin Carton
e851bc7404 Merge pull request #1257 from KitFreddura/master
If let some lint
2016-10-04 23:00:05 +02:00
mcarton
2b8500664c
Remove warning in the lastest nightly 2016-10-04 17:17:40 +02:00
mcarton
4f91d66905 Rustup to *rustc 1.14.0-nightly (144af3e97 2016-10-02)* 2016-10-03 21:25:27 +02:00
Manish Goregaokar
a4198c1108 Merge pull request #1255 from Manishearth/cov
Improve test coverage
2016-10-03 22:15:23 +05:30
Kit Freddura
c8aa35e150 replaced snippet_opt with snippet for more terse code 2016-10-02 14:38:31 -07:00
Kit Freddura
97e9299a10 fixed array bounds checking 2016-10-02 14:26:41 -07:00
Kit Freddura
3573114764 replaced pat_to_string with snippet 2016-10-02 14:15:24 -07:00
Kit Freddura
1188f59102 fixed struct elison 2016-10-02 13:53:10 -07:00
Kit Freddura
c18dc13f6e added file again 2016-10-02 13:48:52 -07:00
Kit Freddura
d152ca04bd updated zero_div_zero.rs 2016-10-02 13:44:23 -07:00
Kit Freddura
ab9435a6d4 ran update 2016-10-02 13:42:11 -07:00
Kit Freddura
1c15428339 removed formatting changes 2016-10-02 13:39:28 -07:00
Andre Bogus
8188c46429 Allow option_map_unwrap_or(_else)
This fixes #1192.
2016-10-02 21:23:26 +02:00
mcarton
d982b19a0e
Fix slightly wrong comment 2016-10-02 14:30:21 +02:00
mcarton
f03bac6c3a
Remove a useless method 2016-10-02 02:47:53 +02:00
mcarton
e50cfa7e77
Add a test for a shadow corner case 2016-10-02 02:38:54 +02:00
mcarton
9a3f53dee6
Partially hash let declaration in SpanlessHash
The hash never needs to be good but before it was simply doing nothing
for these.
2016-10-02 02:17:04 +02:00
mcarton
e036a8145a
Support ExprType (type ascription) comparison
*ish
2016-10-01 22:26:57 +02:00
mcarton
3e009b9424
Implement more hir typed node comparison 2016-10-01 22:19:20 +02:00
Martin Carton
8babb2d409 Merge pull request #1250 from elliottneilclark/explicit_into_iter
Add a lint to warn about un-necessary .into_iter()
2016-10-01 15:01:43 +02:00
Oliver Schneider
9c5d3f3b85 correctly traverse match expressions for diverging_sub_expr 2016-10-01 14:41:20 +02:00
Elliott Clark
4a34087c77 Run util/update_lints.py after adding explicit_into_iter_loop 2016-09-30 17:50:02 -07:00
Elliott Clark
5fa004313b Add a lint to warn about un-necessary .into_iter()
This should close #1094.
2016-09-30 17:42:43 -07:00
mcarton
4f3920307a
Rustup to *rustc 1.13.0-nightly (d0623cf7b 2016-09-26)* 2016-09-28 01:09:11 +02:00
mcarton
f74dcaac0c
Fix wrong suggestion in TRANSMUTE_PTR_TO_REF with lts 2016-09-19 17:59:12 +02:00
mcarton
5f1120b346
Fix markup in SINGLE_CHAR_PATTERN documentation 2016-09-18 18:27:08 +02:00
Takuma YOSHIOKA
7b6a60ca69
Fix typo in example codes of "matches" lints
Use `=>` for match arms (instead of wrong `->`).
2016-09-18 20:17:25 +09:00
mcarton
c8986b4676
Fix FP with WHILE_LET_ON_ITERATOR and refutable pats 2016-09-16 15:50:35 +02:00
mcarton
90c390ec2a
Fix typo
Who cares? Meh, consistency.
2016-09-16 15:45:19 +02:00
Martin Carton
dc84759ac5 Merge pull request #1224 from oli-obk/divergence
lint diverging expressions that are sub-expressions of others
2016-09-13 15:58:31 +02:00
Oliver Schneider
e6bfe4b514
also lint diverging methods 2016-09-13 12:41:37 +02:00
Oliver Schneider
a2257280ec
don't lint expressions referencing ! objects, just expressions creating them 2016-09-13 12:41:20 +02:00
Oliver Schneider
12a82b2007
also lint private modules for module_inception, as that is the main issue 2016-09-13 10:19:55 +02:00
Oliver Schneider
f469860dc2
lint diverging expressions that are sub-expressions of others 2016-09-12 14:24:11 +02:00
Oliver Schneider
03fa974855
Let the submodule #[allow] in module_inception 2016-09-12 10:30:42 +02:00
mcarton
ab6669a641
Rustup to *rustc 1.13.0-nightly (f1f40f850 2016-09-09)* 2016-09-10 19:13:49 +02:00
mcarton
b82f43f38e
Revert "Remove all union stuffs"
This reverts commit 888c34ad70.
This rustups to rustc 1.13.0-nightly (70598e04f 2016-09-03).
2016-09-04 17:45:36 +02:00
mcarton
b2de244cfd
Restrict len_without_is_empty to exported items 2016-09-02 15:30:06 +02:00
kennytm
5f09020e90 Added a lint_without_lint_pass lint.
Four lints were missing from LintPass, making them unavailable unless the
`clippy` lint group is explicitly enabled:

* `for_loop_over_result`
* `for_loop_over_option`
* `match_overlapping_arm`
* `filter_next`
2016-09-01 15:07:37 +08:00
mcarton
888c34ad70
Remove all union stuffs
The rustc's PR wasn't merged. Hopefully this commit can simply be reverted when it's time.
2016-08-31 18:22:36 +02:00
mcarton
01424f5622
Support unions here and there 2016-08-31 18:22:36 +02:00
mcarton
3f43996aa5
Rustup to *1.13.0-nightly (eac41469d 2016-08-30)* 2016-08-31 18:22:35 +02:00
mcarton
d87f137254
Add a builtin_type_shadow lint 2016-08-28 19:56:18 +02:00
mcarton
e922fa80ce
Fix FP in ZERO_PREFIXED_LITERAL and 0b/Oo 2016-08-28 18:00:09 +02:00
mcarton
189c5e5cfc
Rustup to rustc 1.13.0-nightly (a23064af5 2016-08-27) 2016-08-28 17:25:58 +02:00
mcarton
e338f6a4f0
Remove now useless attribute type_macros 2016-08-28 17:24:34 +02:00
Andre Bogus
06235b0310 refactored misc to reduce passes
related to #1062

Before: 960MB After: 956MB

So while this reduces code size somewhat, I don't see much memory
improvement here. Still, it's probably worthwile to consider reducing
our passes at least within modules.
2016-08-24 21:47:46 +02:00
mcarton
ddf84ea845
Fix typos 2016-08-24 14:37:09 +02:00
mcarton
be329ebdf7
Typo
TIL what `wether` means.
2016-08-23 19:51:42 +02:00
mcarton
9a2aadf872
Deny missing_docs_in_private_items in some modules 2016-08-23 19:39:36 +02:00
mcarton
8b12e28e43
in_macro check in MISSING_DOCS_IN_PRIVATE_ITEMS 2016-08-23 19:00:56 +02:00
mcarton
36d8ca04a1
Add a MISSING_DOCS_IN_PRIVATE_ITEMS lint 2016-08-23 18:28:39 +02:00
mcarton
507b626b36 Add zero_prefixed_literal lint 2016-08-23 18:15:12 +02:00
llogiq
cf2b0c8dd6 New cmp_null lint (fixes #1184) (#1186)
* new cmp_null lint (fixes #1184)

* adressed comments (still fails)

* fixed tests, dogfood, ran update_lints
2016-08-22 18:29:29 +02:00
Oliver Schneider
14d2cd0b0a
unused_import is a valid lint to be changed on use statements 2016-08-19 17:27:24 +02:00
Oliver Schneider
2d57902a27
don't lint if snippet is shortert than 1 character
This happens with various combinations of cfg attributes and macros expansion.
Not linting here is the safe route, as everything else might produce false positives.
2016-08-19 17:27:24 +02:00
Georg Brandl
ff919376a6 rustup 2016-08-18 21:24:35 +02:00
Oliver Schneider
40720a61e8
rustup for the ! type 2016-08-17 17:58:15 +02:00
mcarton
a34beedfe5 Add "DirectX" and "OpenGL" to doc_valid_idents 2016-08-17 15:46:33 +02:00
Oliver Schneider
3ab6ad59c4
disallow lint attributes on use and extern crate items 2016-08-17 11:36:04 +02:00
Georg Brandl
ffad9a8c8c Lint print!("...\n") (closes #455) 2016-08-16 20:52:48 +02:00
Oliver Schneider
b6f320a495
address nits and improve docs 2016-08-16 14:36:48 +02:00
Oliver Schneider
7ee4a9a659
lint modules that have the same name as their parent module 2016-08-16 14:29:21 +02:00
David Tolnay
95df2d1bf4
Update to rustc 1.12.0-nightly (1deb02ea6 2016-08-12) 2016-08-13 14:23:38 -07:00
scurest
b0a96def09 Add lint for reads and writes that depend on evaluation order 2016-08-11 06:01:40 -05:00
llogiq
ce3be22021 Merge pull request #1151 from oli-obk/clone_ref
add suggestions to clone_on_copy
2016-08-09 06:30:25 +02:00
llogiq
8ac99162ea Merge pull request #1152 from oli-obk/wrong_self_conv_fn_level
enable changing wrong_self_convention's lint level at the function level
2016-08-08 21:13:16 +02:00
Oliver Schneider
331afc3246
extern fns often need to adhere to a specific api -> don't suggest api-changes 2016-08-08 17:21:47 +02:00
Oliver Schneider
49f276ec6f
enable changing wrong_self_convention's lint level at the function level 2016-08-08 17:09:36 +02:00
Oliver Schneider
7e67f447ce
add suggestions to clone_on_copy
also:

* don't report clone_on_copy when reporting clone_on_double_ref
* don't suggest `((x))`
2016-08-08 16:43:45 +02:00
Georg Brandl
d1403d2d7c Remove "known problem" that only occurs without MIR.
Since clippy needs nightly, and nightly is MIR-by-default, we can
get rid of the warning.
2016-08-08 13:37:39 +02:00
Georg Brandl
c4dad550f7 Close code block in docstring 2016-08-08 13:34:21 +02:00
Georg Brandl
b91c1a509e Make lint descriptions short and to the point; always fitting the column "triggers on". 2016-08-07 08:09:26 +02:00
Georg Brandl
3b5ff0f813 Make the lint docstrings more consistent. 2016-08-07 08:06:19 +02:00
Georg Brandl
bc2ecc9623 INDEXING_SLICING should probably be a restriction lint. 2016-08-07 08:05:37 +02:00
Manish Goregaokar
74c7880597 Merge pull request #1145 from birkenfeld/issue-703-2
Lint literal suffixes not separated by underscores (idea also from #703)
2016-08-07 09:57:16 +05:30
Georg Brandl
fa0df69a97 Add a configurable threshold for enum variants before name lints trigger (fixes #1138) 2016-08-06 20:59:27 +02:00
Georg Brandl
2f8247ada5 Lint literal suffixes not separated by underscores (see #703) 2016-08-05 18:50:23 +02:00
Georg Brandl
ab58331f22 Lint inconsistent casing in hex literals (closes #703) 2016-08-05 18:30:49 +02:00
Andre Bogus
75b85a55ec added OAuth and TrueType to doc whitelist 2016-08-03 22:49:54 +02:00
Jakob Demler
d0fb8d765a No warning when file is opened with read truncate and write 2016-08-02 22:57:32 +02:00
Oliver Schneider
81c5757f44
lint on by ref patterns for references 2016-08-01 16:59:14 +02:00
mcarton
30ec2c4d92
Rustup to rustc 1.12.0-nightly (1225e122f 2016-07-30) 2016-07-31 19:22:07 +02:00
mcarton
a01d7c93e7
Add IPv4 and IPv6 to the valid doc idents list 2016-07-31 01:07:28 +02:00
mcarton
81b9b2ca85
s/``/``rust when relevant
It looks better on the wiki/the new documentation page.
2016-07-29 20:37:25 +02:00
Oliver Schneider
f7f9930b89
update lints 2016-07-20 17:34:58 +02:00
Oliver Schneider
100d381d2b
lint a += a + b (possible mis-refactoring of a = a + b) 2016-07-20 15:29:24 +02:00
Oliver Schneider
3ea9a249bc
get snippets inside the suggestions-closure 2016-07-20 13:29:01 +02:00
llogiq
a371558bdb Merge pull request #1093 from oli-obk/serde_specific_lint
lint on implementing `visit_string` without also implementing `visit_str`
2016-07-18 11:53:28 +02:00
Oliver Schneider
b4ee9115d8
"fallout" 2016-07-18 11:19:45 +02:00
Oliver Schneider
02c46f057f
add an internal lint that catches misordered paths 2016-07-18 11:19:33 +02:00
mcarton
5eced5dc55 Dogfood 2016-07-17 13:33:51 +02:00
Manish Goregaokar
3e13e24ed5
redundant closures don't allocate 2016-07-16 18:25:00 +05:30
mcarton
caa76e119b
Improve docs 2016-07-16 00:26:54 +02:00
Oliver Schneider
fc54a91916
add the path to the util::path module 2016-07-15 18:10:28 +02:00
Manish Goregaokar
b8c5e5a89c
Fix position of mut in toplevel-ref-arg (fixes #1100, again) 2016-07-15 19:02:41 +05:30
Manish Goregaokar
60f354880f
Suggest mutability and fix type in toplevel-ref-arg 2016-07-15 17:52:34 +05:30
mcarton
557baf253a
Format code for methods lints 2016-07-14 22:56:20 +02:00
llogiq
b1becf41e4 Merge pull request #1099 from Manishearth/fix
Some small fixes
2016-07-14 21:32:45 +02:00
mcarton
ea665c38f1
Fix FP with USELESS_VEC and non-copy types 2016-07-14 19:31:17 +02:00
mcarton
c1eb5828fa
Fix suggestion spans for NEEDLESS_RETURN 2016-07-14 18:32:48 +02:00
mcarton
3447bfccd9
Fix MANY_SINGLE_CHAR_NAMES's docs 2016-07-14 17:42:57 +02:00
Taylor Cramer
61d1a9b030 Check for comparison of -0.0 and 0.0 in PartialOrd for Constant 2016-07-13 09:55:16 -07:00
Taylor Cramer
0dd13b0db2 Change floating point constant to mem::transmute u64 comparison 2016-07-13 00:59:35 -07:00
Taylor Cramer
8907cbc0b8 Added sign check on Constant f64 PartialEq implementation 2016-07-13 00:43:33 -07:00
Oliver Schneider
319c66a2a4
lint on implementing visit_string without also implementing visit_str 2016-07-12 17:36:11 +02:00
Manish Goregaokar
e63b8342c3 Remove unnecessary feature 2016-07-12 20:21:45 +05:30
Manish Goregaokar
c1421c6e82
Don't warn when boxing large arrays 2016-07-12 18:49:34 +05:30
mcarton
3a201f43ec
Rustup to rustc 1.12.0-nightly (f93aaf84c 2016-07-09) 2016-07-10 15:42:02 +02:00
mcarton
efaed2ecfe
Link to known issues for MATCH_SAME_ARMS 2016-07-10 14:53:42 +02:00
mcarton
b8b6b7fee6
Try to explain MATCH_SAME_ARMS better 2016-07-10 14:46:39 +02:00
mcarton
eb75d4ee62
Fix suggestions for NEW_WITHOUT_DEFAULT 2016-07-10 14:20:38 +02:00
mcarton
3a7402a6d2
Fix FP with for loops and shadowed loop variable 2016-07-10 14:05:57 +02:00
llogiq
ad1cd99054 Merge pull request #1060 from Manishearth/sugg
Improve suggestions
2016-07-10 00:06:30 +02:00
Martin Pool
585a3b2565 Fix Markdown syntax in description of collapsible_if 2016-07-09 12:20:54 -07:00
mcarton
56d3bc7008
Handle /** and ~~~ in DOC_MARKDOWN 2016-07-08 18:24:47 +02:00
David Tolnay
33c767c510
Add "JavaScript" to doc-valid-idents 2016-07-06 21:27:29 -07:00
mcarton
bf513229b1
Address PR's comments 2016-07-06 15:49:49 +02:00
mcarton
02547b9392
Merge remote-tracking branch 'origin/master' into sugg 2016-07-06 14:54:10 +02:00
mcarton
3bd0acaa5c
Remove useless feature attribute
`iter_arith` has been stabilized in rustc 1.11.0.
2016-07-06 14:51:20 +02:00
mcarton
8aaaf198e3
Use utils::sugg in methods lints 2016-07-05 23:26:47 +02:00
mcarton
c5e91e70d0
Use sugg::Sugg in transmute links 2016-07-04 02:22:57 +02:00
mcarton
9b79b1022c
Fix suggestions for needless_bool 2016-07-04 01:43:47 +02:00
mcarton
7778f314f2
Merge branch 'master' into sugg 2016-07-04 00:51:19 +02:00
mcarton
2f259b8cd3
Use span_suggestion in entry lints 2016-07-03 23:27:44 +02:00
mcarton
ffa840d4f2
Use utils::sugg in match related lints
Also don't build suggestion when unnecessary.
2016-07-03 23:27:37 +02:00
James Lucas
10b545e30b Check for constant expression in useless_vec lint 2016-07-03 12:12:43 -07:00
Manish Goregaokar
31948c4815
Make #991 work with current rust 2016-07-03 13:55:23 +05:30
mcarton
0e3dcd1376
Improve NOT_UNSAFE_PTR_ARG_DEREF with functions 2016-07-03 13:29:04 +05:30
mcarton
7781f1d7c5 Add a new not_unsafe_ptr_arg_deref lint 2016-07-03 13:28:34 +05:30
mcarton
cc18556ae5
Use utils::sugg in swap lints 2016-07-02 17:31:22 +02:00
Martin Carton
d243d686fd Merge pull request #1054 from Manishearth/rustup
Rustup to ea0dc92972
2016-07-02 16:15:57 +02:00
Ben Boeckel
d35b94349c typo: use commas around "e.g." 2016-07-02 07:59:20 -04:00
mcarton
139b977d9d
Cleanup 2016-07-01 21:01:56 +02:00
mcarton
2a45a2ab6b
Use utils::sugg in FOR_KV_MAP 2016-07-01 20:55:45 +02:00
mcarton
f6c9490e65
Fix wrong suggestion with ... and for loops 2016-07-01 19:31:14 +02:00
mcarton
dbf6dc66d8
Add more sugggestion-building functions 2016-07-01 19:30:38 +02:00
mcarton
9bd7fa05e0
Improve NEEDLESS_RANGE_LOOP error reporting 2016-07-01 18:53:04 +02:00
mcarton
e613c8b492
Introduce multispan_sugg 2016-07-01 18:43:42 +02:00
mcarton
97f65b0296
Rustup to ea0dc92972 III 2016-07-01 17:49:18 +02:00
mcarton
d6182b365c
Merge remote-tracking branch 'origin/rustup' into sugg 2016-07-01 17:48:57 +02:00
mcarton
55b78ae478
Rustup to ea0dc92972 II 2016-07-01 17:44:17 +02:00
mcarton
3c4af49662
Rustup to ea0dc92972 2016-07-01 17:44:17 +02:00
mcarton
28bd591f05
Only build suggestion if necessary in USELESS_VEC 2016-07-01 17:12:49 +02:00
mcarton
98f18f0474
Move vec! unexpanding function to utils::higher 2016-07-01 17:12:49 +02:00
mcarton
4dff4df577
Move more functions to utils::higher 2016-07-01 17:12:49 +02:00
mcarton
92b04129fe
Move unsugar_range to utils::higher 2016-07-01 17:12:49 +02:00
mcarton
ebf72cb67f
Use util::sugg in TRANSMUTE_PTR_TO_REF 2016-07-01 17:12:48 +02:00
mcarton
169b63a84a
Improve TOPLEVEL_REF_ARG message 2016-07-01 17:12:48 +02:00
mcarton
7023988020
Use utils::sugg in TOPLEVEL_REF_ARG 2016-07-01 17:12:48 +02:00
mcarton
a3c505551f
Cleanup 2016-07-01 17:12:48 +02:00
mcarton
7a1fc9fce5
Use utils::sugg in MATCH_BOOL 2016-07-01 17:12:48 +02:00
mcarton
66808c1e77
Use utils::sugg in COLLAPSIBLE_IF 2016-07-01 17:12:48 +02:00
mcarton
2e8edde6e9
Use utils::sugg in FLOAT_CMP 2016-07-01 17:12:48 +02:00
mcarton
8d58a928e5
Use utils::sugg in ASSIGN_OPS 2016-07-01 17:12:48 +02:00
mcarton
9811dea237
Add a module to pretty-print suggestions 2016-07-01 17:12:48 +02:00
mcarton
580ae5a879
Use span_suggestion in FLOAT_CMP 2016-07-01 17:12:48 +02:00
Andre Bogus
b73180231a fixed doc nit 2016-06-30 06:33:21 +02:00
Andre Bogus
a12e8394d7 new lint: double_neg 2016-06-30 01:00:25 +02:00
mcarton
ea76ac5562
Make COLLAPSIBLE_IF consider if let 2016-06-29 17:09:39 +02:00
mcarton
f6ba217c1c
Small cleanup 2016-06-29 17:09:39 +02:00
mcarton
f37c9adbd9
Make CollapsibleIf an EarlyLintPass
It doesn't need any `hir` feature and `ast` is much more stable.
2016-06-29 17:09:39 +02:00
mcarton
7fa38f6787
Fix FP with mut_mut and for loops 2016-06-29 17:09:39 +02:00
Oliver Schneider
9ceb708727 Merge pull request #1053 from oli-obk/char_float_transmute
lint on unnecessary and plain wrong transmutes
2016-06-28 14:50:39 +02:00
Oliver Schneider
e06bc37477
lint on unnecessary and plain wrong transmutes 2016-06-28 14:08:08 +02:00
Manish Goregaokar
cdce78a4be
Add parentheses when necessary in transmute suggestion (fixes #1049) 2016-06-28 14:03:46 +05:30
llogiq
5aea20da7f Merge pull request #1046 from oli-obk/unify_span_lint_usage
use span_lint_and_then instead of adding to the `DiagnosticWrapper`
2016-06-27 17:20:03 +02:00
Oliver Schneider
799861d7e0
use span_lint_and_then instead of adding to the DiagnosticWrapper 2016-06-27 17:14:04 +02:00
Oliver Schneider
a469ee1061
lint transmuting references to pointers 2016-06-27 16:12:48 +02:00
Oliver Schneider
083c57867a
refactor transmute lints into a single match 2016-06-27 13:46:21 +02:00
Oliver 'ker' Schneider
8c5e617c9a don't lint on comparing *const f32s 2016-06-25 18:59:37 +02:00