Morten Lohne
b5ef66f442
Optimize by doing a cheap check for double binary expression first
2023-08-05 21:28:08 +02:00
Morten Lohne
08e1333fa6
Add missing variable decl to doc comment
2023-08-05 21:28:08 +02:00
Morten Lohne
e16a2ac0c6
Add descriptions for 'impossible_double_const_comparisons' and 'ineffective_double_const_comparisons'
2023-08-05 21:28:08 +02:00
Morten Lohne
046d3df35e
New lints: impossible_double_const_comparisons
and ineffective_double_const_comparisons
2023-08-05 21:28:08 +02:00
Caio
35d434d08e
[arithmetic_side_effects] Fix #11262
2023-07-30 14:33:38 -03:00
Philipp Krones
415fdb2d1a
Merge remote-tracking branch 'upstream/master' into rustup
2023-07-14 13:36:16 +02:00
bors
7ccf5d404b
Auto merge of #11095 - Alexendoo:rustfmt-imports, r=Manishearth
...
Add `imports_granularity = "Module"` to rustfmt.toml
This lets rustfmt split/merge imports, `Module` seems to be the most common style in clippy
https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=#imports_granularity
changelog: none
Almost all the updates other than the config file change are from `cargo dev fmt` or blessed tests, the exceptions being
- `tests/ui/single_component_path_imports.rs`
- `tests/ui/single_component_path_imports_nested_first.rs`
- `tests/ui/single_component_path_imports_self_after.rs`
- `tests/ui/single_component_path_imports_self_before.rs`
- `tests/ui/unsafe_removed_from_name.rs` (added a test with merged imports as a drive by)
- `tests/ui/wildcard_imports.rs`
- `tests/ui/wildcard_imports_2021.rs`
2023-07-13 12:54:52 +00:00
Alex Macleod
2811effe34
Add imports_granularity = "Module"
to rustfmt.toml
2023-07-13 12:44:57 +00:00
y21
c5fc61ca94
[arithmetic_side_effect
]: allow different rhs type
2023-07-13 00:24:10 +02:00
Philipp Krones
cb3ecf7b79
Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup
2023-07-02 14:59:02 +02:00
Catherine
efac83813d
Make eq_op
suggest .is_nan()
2023-06-30 11:43:02 -05:00
Philipp Krones
8010c3462d
Merge remote-tracking branch 'upstream/master' into rustup
2023-06-30 16:09:06 +02:00
Caio
0e1caa765e
Fix #10792
2023-06-17 17:03:31 -03:00
Urgau
edb3266b91
Drop uplifted clippy:cmp_nan
2023-06-10 11:13:01 +02:00
Philipp Krones
b76b0aeb63
Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyup
2023-05-20 15:39:26 +02:00
Jason Newcomb
5351170744
Slightly refactor constant evaluation and add detection for empty macro expansion and cfg
ed statements.
2023-05-18 15:43:33 -04:00
Caio
493b2ae8dc
Rename integer_arithmetic
2023-05-14 08:37:12 -03:00
Caio
891fffef0c
Consider referenced allowed or hard-coded types
2023-05-13 23:24:33 -03:00
Philipp Krones
7e9abb311d
Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyup
2023-05-05 17:45:49 +02:00
Philipp Krones
a1b75c5108
Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyup
2023-04-23 13:28:56 +02:00
Philipp Krones
583c97e9bb
Merge remote-tracking branch 'upstream/master' into rustup
2023-04-23 03:39:03 -07:00
Caio
0b16f80c40
[arithmetic_side_effects] Cache symbols
2023-04-20 14:59:02 -03:00
Caio
3db7352b81
[arithmetic_side_effects] Fix #10590
2023-04-19 10:58:00 -03:00
bors
f1a552ccec
Auto merge of #10203 - c410-f3r:macro-lint, r=giraffate
...
Suppress the triggering of some lints in derived structures
Fixes #10185
Fixes #10417
For `integer_arithmetic`, `arithmetic_side_effects` and `shadow_reuse`.
* ~~Not sure how to test these use-cases so feel free to point any method or any related PR.~~
---
changelog: FP: [`integer_arithmetic`], [`arithmetic_side_effects`]: No longer lint inside proc macros
[#10203 ](https://github.com/rust-lang/rust-clippy/pull/10203 )
<!-- changelog_checked -->
2023-04-19 12:56:19 +00:00
Caio
d6390625dc
Address comments
2023-04-15 16:05:46 -03:00
bluthej
6409556926
Standardize lint formulation
2023-04-12 13:48:03 +02:00
Philipp Krones
6b95029f17
Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyup
2023-04-11 15:31:08 +02:00
Caio
cd0009eb30
Suppress the triggering of some lints in derived structures
2023-04-09 08:16:20 -03:00
Caio
05650b7215
[arithmetic_side_effects] Fix #10583
2023-04-02 07:50:25 -03:00
Philipp Krones
cf8a67d9ad
Merge commit '3c06e0b1ce003912f8fe0536d3a7fe22558e38cf' into clippyup
2023-03-10 10:53:50 +01:00
Philipp Krones
baa997caf6
Merge remote-tracking branch 'upstream/master' into rustup
2023-03-10 10:22:18 +01:00
bors
0966f59c78
Auto merge of #108474 - Jarcho:clippyup, r=Manishearth
...
Update Clippy
Seems like `@flip1995` so this is a couple days late.
r? `@Manishearth`
2023-02-26 18:45:47 +00:00
Nilstrieb
0f3446b371
Remove from_fn
lang item
...
It was probably a leftover from the old `?` desugaring but anyways, it's
unused now except for clippy, which can just use a diagnostics item.
2023-02-26 09:15:54 +00:00
Jason Newcomb
0413fb35ba
Merge commit '149392b0baa4730c68f3c3eadf5c6ed7b16b85a4' into clippyup
2023-02-25 19:28:50 -05:00
Caio
c43937316a
[arithmetic_side_effects] Fix #10252
2023-02-12 17:34:07 -03:00
Caio
1ed8ed3435
Address comment
2023-02-12 16:27:30 -03:00
Caio
e70a7a68bd
[arithmetic_side_effects] Evaluate integers originated from constant declarations
2023-02-12 16:19:51 -03:00
Camille GILLOT
92c4f1e2d9
Take a LocalDefId in hir::Visitor::visit_fn.
2023-01-28 09:51:50 +00:00
Philipp Krones
d21616737b
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
2023-01-12 19:48:13 +01:00
Philipp Krones
4ccafea92d
Merge commit '4f3ab69ea0a0908260944443c739426cc384ae1a' into clippyup
2022-12-29 14:28:34 +01:00
Philipp Krones
1c422524c7
Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyup
2022-12-17 14:12:54 +01:00
Philipp Krones
46c5a5d234
Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyup
2022-11-21 20:51:52 +01:00
Cameron Steffen
16566e97fd
Use LanguageItems::require less
2022-10-29 16:04:10 -05:00
Nicholas Nethercote
efca32e23a
Rename some OwnerId
fields.
...
spastorino noticed some silly expressions like `item_id.def_id.def_id`.
This commit renames several `def_id: OwnerId` fields as `owner_id`, so
those expressions become `item_id.owner_id.def_id`.
`item_id.owner_id.local_def_id` would be even clearer, but the use of
`def_id` for values of type `LocalDefId` is *very* widespread, so I left
that alone.
2022-10-29 20:28:38 +11:00
flip1995
cd0bb7de01
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
2022-10-23 15:18:45 +02:00
lcnr
059e52b96b
rustc_hir_typeck: fix clippy
2022-10-20 17:53:14 +02:00
Cameron Steffen
6819e85501
Change InferCtxtBuilder from enter to build
2022-10-07 07:10:40 -05:00
Philipp Krones
d75b25faab
Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup
2022-10-06 09:44:38 +02:00
lcnr
e5ce6d18df
rustc_typeck to rustc_hir_analysis
2022-09-27 10:37:23 +02:00
Takayuki Maeda
ea75178219
separate definitions and HIR
owners
...
fix a ui test
use `into`
fix clippy ui test
fix a run-make-fulldeps test
implement `IntoQueryParam<DefId>` for `OwnerId`
use `OwnerId` for more queries
change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-24 23:21:19 +09:00