Philipp Krones
d2b08432db
Merge remote-tracking branch 'upstream/master' into rustup
2023-09-07 21:43:06 +02:00
Caio
b3136a874d
[clippy
] Use symbols intended for arithmetic_side_effects
2023-09-01 10:28:55 +02:00
bors
5cc5f27899
Auto merge of #11385 - markhuang1212:master, r=blyxyas
...
skip float_cmp check if lhs is a custom type
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: [`float_cmp`]: allow float eq comparison when lhs is a custom type that implements PartialEq<f32/f64>
If the lhs of a comparison is not float, it means there is a user implemented PartialEq, and the caller is invoking that custom version of `==`, instead of the default floating point equal comparison.
People may wrap f32 with a struct (say `MyF32`) and implement its PartialEq that will do the `is_close()` check, so that `MyF32` can be compared with either f32 or `MyF32`.
2023-08-28 18:27:53 +00:00
Meng Huang
e43c234168
allow float_cmp when lhs is a custom type
2023-08-25 19:48:25 +08:00
Caio
d802ab28de
Dogfood
2023-08-24 13:34:36 -03:00
Caio
2faa43c8b4
[arithmetic_side_effects] Fix #11393
2023-08-24 13:22:27 -03:00
Philipp Krones
f730a2655a
Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyup
2023-08-11 14:05:13 +02:00
Philipp Krones
17b9c42572
Merge remote-tracking branch 'upstream/master' into rustup
2023-08-10 21:15:24 +02:00
Manish Goregaokar
d628046244
Update clippy_lints/src/operators/mod.rs
...
Co-authored-by: Catherine Flores <catherine.3.flores@gmail.com>
2023-08-06 17:19:43 +00:00
Morten Lohne
3157b96a5b
Provide fallback code snippets, if the snippet is not available
2023-08-06 13:49:17 +02:00
Morten Lohne
0e064d5d04
Replace ConstEvalLateContext::new() with two calls to constant() to simplify the code, after PR suggestion
2023-08-06 13:48:28 +02:00
Morten Lohne
9646446923
Add lifetime parameter to 'Constant', after rebasing on upstream
2023-08-06 13:29:50 +02:00
Morten Lohne
1d61fc1b0a
Rename 'impossible_double_const_comparisons' -> 'impossible_comparisons' and 'ineffective_double_const_comparisons' -> 'redundant_comparisons', after discussion on Zulip
2023-08-05 21:28:08 +02:00
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
Philipp Krones
b0e64a9c09
Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyup
2023-07-31 23:53:53 +02:00
Caio
35d434d08e
[arithmetic_side_effects] Fix #11262
2023-07-30 14:33:38 -03:00
Matthias Krüger
f54263af58
Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
...
Mark `map_or` as `#[must_use]`
I don't know what else to say.
r? libs
2023-07-30 14:25:08 +02:00
Maybe Waffle
0c93e30956
Mark map_or
as #[must_use]
2023-07-30 10:22:23 +00:00
Philipp Krones
d6d530fd0b
Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyup
2023-07-17 10:22:32 +02: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