Commit Graph

12239 Commits

Author SHA1 Message Date
dswij dc6f7dc6bf Add known problems to mut_range_bound docs 2021-09-08 11:00:27 +08:00
dswij 7515d9c6f7 Update test output for mut_range_bound 2021-09-08 10:41:37 +08:00
dswij 8fbf75e0f9 mut_range_bound to check for immediate break from loop 2021-09-08 10:41:37 +08:00
dswij 290fb8de66 Add additional test for broken loop in mut_range_bound 2021-09-08 10:41:37 +08:00
bors b7c25e1679 Auto merge of #7642 - mikerite:fix-7641, r=flip1995
Add `TAU` to `approx_constant`

changelog: [`approx_constant`]: Add `TAU`
2021-09-07 08:16:36 +00:00
Michael Wright a7a5a5d9b0 Add TAU to approx_constant 2021-09-07 05:50:04 +02:00
bors 17294b8161 Auto merge of #7634 - chansuke:update-eval-order-depends-docs, r=Manishearth
Fix documentation of eval_order_dependence

Fixes #7624.

changelog: fix documentation of eval_order_dependence
2021-09-06 07:51:55 +00:00
bors 7a0d7d8283 Auto merge of #7596 - lengyijun:option_needless_deref, r=llogiq
New lint: option_needless_deref

changelog: [`option_needless_deref`]
fix #7571
2021-09-05 18:11:56 +00:00
bors 051286d7ec Auto merge of #7638 - xFrednet:7569-avoid-indexing-in-clippy, r=Manishearth
Avoid slice indexing in Clippy (down with the ICEs)

While working on #7569 I got about 23 lint reports where we can avoid slice indexing by destructing the slice early. This is a preparation PR to avoid fixing them in the lint PR. (The implementation already takes about 300 lines without tests 😅). Either way, this should hopefully be easy to review 🙃

---

changelog: none
2021-09-05 17:01:50 +00:00
bors df7e63b381 Auto merge of #7627 - xFrednet:0000-updating-issue-templates-again, r=llogiq
Updating issue templates again for rustbot

It turns out that our current issue template can sometimes trigger a rustbot error message, as can be seen in [#7626](https://github.com/rust-lang/rust-clippy/issues/7626). I originally tested this in #7599, but it's apparently a bit inconsistent. This PR adds backticks to the commands, as correctly suggested by `@mikerite` in the comments. (Thank you!)

``@rustbot` label +S-blocked`

---

Now I also pushed a tiny link fix as well. 🙃

---

changelog: none
2021-09-05 14:53:33 +00:00
bors e5ae3f5491 Auto merge of #7629 - mikerite:fix-7623-2, r=xFrednet
Make `approx_const` MSRV aware

changelog: [`approx_const`]: Add MRSV checks for LOG10_2 and LOG2_10.

Fixes #7623
2021-09-05 13:17:02 +00:00
xFrednet 62b46125cb Avoid slice indexing in Clippy (down with the ICEs) 2021-09-05 14:50:13 +02:00
Michael Wright 19d8a3e53c Improve approx_constant output 2021-09-05 08:47:45 +02:00
Michael Wright 4ee9ec960e Add MSRV to approx_constant documentation 2021-09-05 08:44:37 +02:00
lyj 37af742bbb Update clippy_lints/src/needless_option_as_deref.rs
Co-authored-by: llogiq <bogusandre@gmail.com>
2021-09-05 08:33:04 +08:00
bors a8c269ad50 Auto merge of #7570 - HKalbasi:derivable-impls, r=camsteffen
Add the `derivable_impls` lint

Fix #7550

changelog: Add new derivable_impls lint. mem_replace_with_default now covers non constructor cases.
2021-09-04 21:40:04 +00:00
bors f7719279db Auto merge of #7584 - shepmaster:unnecessary_expect, r=camsteffen
Extend unnecessary_unwrap to look for expect in addition to unwrap

changelog: Extend ``[`unnecessary_unwrap`]`` to also check for `Option::expect` and `Result::expect`. Also give code suggestions in some cases.

Fixes #7581
2021-09-04 21:25:55 +00:00
hamidreza kalbasi 8221f9e795 add derivable impls lint 2021-09-05 01:25:59 +04:30
lengyijun 4184cc369a needless_option_as_deref 2021-09-04 22:18:23 +08:00
chansuke b2f01ef6f6 Fix documentation of eval_order_dependence 2021-09-04 21:07:25 +09:00
Fridtjof Stoldt 169aea615c Correct link in documentation for the file clippy_lints::utils::conf 2021-09-03 15:58:01 +02:00
xFrednet 9ebd012c78 Updating issue templates again for rustbot 2021-09-03 15:58:01 +02:00
Michael Wright a23af89447 Make approx_const MSRV aware
Fixes #7623.
2021-09-03 08:34:34 +02:00
Michael Wright 265b8ec622 Reorder approx_consts constant to match rust docs 2021-09-03 06:41:30 +02:00
Jake Goulding b4775435e8 Adjust the output of unnecessary_unwrap and provide a suggestion 2021-09-02 20:52:16 -04:00
Jake Goulding 03d3131cb4 Extend unnecessary_unwrap to look for expect in addition to unwrap
Closes #7581
2021-09-02 20:44:39 -04:00
bors a8c2c7b712 Auto merge of #7604 - flip1995:rustup, r=Manishearth
Rustup

I'll write some TODOs later. This time I'll need a review for this Rustup

r? `@ghost`  (for now)

changelog: none
2021-09-02 15:30:12 +00:00
flip1995 01b17af108 Fix fallout from re-applying patches 2021-09-02 13:04:47 +01:00
flip1995 fb6839db2d Bump nightly version -> 2021-09-02 2021-09-02 12:45:45 +01:00
xFrednet 8bf2940abb Fix matadata collection configuration formatting 2021-09-02 12:42:00 +01:00
Cameron Steffen c2bb313e7a Add higher docs and remove some unneeded fields 2021-09-02 12:41:30 +01:00
flip1995 c7c2036cb9 Fix remaining dogfood errors
Except for the missing docs ones
2021-09-02 12:40:52 +01:00
Cameron Steffen 588367b62e Fix dogfood 2021-09-02 12:39:54 +01:00
Cameron Steffen 5722a7dacd Fix manual_match with let-expressions 2021-09-02 12:38:59 +01:00
flip1995 61bb96738c Merge remote-tracking branch 'upstream/master' into rustup2 2021-09-02 12:38:17 +01:00
bors 849f0a144b Auto merge of #7619 - UnrealApex:patch-1, r=flip1995
Update README.md

Capitalized proper noun.
changelog:none
2021-09-02 08:11:57 +00:00
bors 95d91d64db Auto merge of #7617 - xFrednet:0000-link-diag-item-docs, r=giraffate
Reference new diagnostic item docs in our docs :)

The title says it all. The rustc dev guide now has some information about diagnostic items that are worthwhile linking to 🙃

---

changelog: none
2021-09-02 01:04:40 +00:00
Aaron 6a9549c358 Update README.md 2021-09-01 14:04:24 -07:00
xFrednet 0fa9bf4a40 Reference new diagnostic item docs in our docs :) 2021-09-01 21:55:08 +02:00
bors 87c375fa62 Auto merge of #7605 - xordi:issue-7548-fix, r=giraffate
Issue 7548 fix

Close #7548

changelog: [`bool_assert_comparison`] fixes should be emitted only in case they are comparing a value of a type that implements the `Not` trait with an output of type `bool` against a boolean literal.
2021-08-31 13:36:20 +00:00
xordi 83f1454ade Fix function and variable names 2021-08-31 09:06:14 +02:00
xordi aee4f1fc0c Fix CI errors 2021-08-31 08:56:53 +02:00
xordi abbcea86ff Add new ui tests 2021-08-31 08:56:53 +02:00
xordi f75d1b2bc5 Check for Not trait implementation 2021-08-31 08:56:53 +02:00
Cameron Steffen 78bf4acc3a Fix clippy for let-else 2021-08-30 20:18:41 -05:00
bors fd30241281 Auto merge of #7573 - Jarcho:option_if_let_else, r=giraffate
Fix `option_if_let_else`

fixes: #5822
fixes: #6737
fixes: #7567

The inference from #6137 still exists so I'm not sure if this should be moved from the nursery. Before doing that though I'd almost want to see this split into two lints. One suggesting `map_or` and the other suggesting `map_or_else`.

`map_or_else` tends to have longer expressions for both branches so it doesn't end up much shorter than a match expression in practice. It also seems most people find it harder to read. `map_or` at least has the terseness benefit of being on one line most of the time, especially when the `None` branch is just a literal or path expression.

changelog: `break` and `continue` statments local to the would-be closure are allowed in `option_if_let_else`
changelog: don't lint in const contexts  in `option_if_let_else`
changelog: don't lint when yield expressions are used  in `option_if_let_else`
changelog: don't lint when the captures made by the would-be closure conflict with the other branch  in `option_if_let_else`
changelog: don't lint when a field of a local is used when the type could be pontentially moved from  in `option_if_let_else`
changelog: in some cases, don't lint when scrutinee expression conflicts with the captures of the would-be closure  in `option_if_let_else`
2021-08-30 13:57:21 +00:00
lcnr fd8b150959 feature(const_generics) -> feature(const_param_types) 2021-08-30 11:00:21 +02:00
Ellen 0b526fd7fb rename const_evaluatable_checked to generic_const_exprs
2021-08-30 11:00:21 +02:00
inquisitivecrystal c8262ade90 Teach tools that macros are now HIR items 2021-08-28 00:24:39 -07:00
inquisitivecrystal 8c4056fd4a Treat macros as HIR items 2021-08-28 00:16:34 -07:00