Marcel Hellwig
f0a1cd5645
add uitests for cargo rust-version field
2022-06-28 08:04:10 +02:00
Marcel Hellwig
6384765665
parse Cargo.toml
file in ui-cargo tests
...
compiletest_rs is not meant to test full cargo projects, but instead
only files.
So we need to parse the `Cargo.toml` file ourself and set the
corresponding environment variable. In this case we just set
`CARGO_PKG_RUST_VERSION`, nothing more. But, of course, this can be
extended.
2022-06-28 08:03:48 +02:00
Marcel Hellwig
83511d1d9a
update README.md to reflect rust-version in cargo.toml
2022-06-28 08:03:44 +02:00
Marcel Hellwig
81737bf850
try reading rust-version from Cargo.toml
...
Cargo.toml can contain a field `rust-version`, that acts like a MSRV of
clippy.toml file: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
This will try to read that field and use it, if the clippy.toml config
has no `msrv` entry
2022-06-28 08:01:50 +02:00
Preston From
7bc40967a4
Run cargo dev fmt
2022-06-27 23:01:47 -06:00
Preston From
3cfd1e5233
Make messages more accurate, check lint enabled
2022-06-27 22:52:22 -06:00
bors
d85539571f
Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
...
Fix example `SELF_ASSIGNMENT`
changelog: Fix example in `SELF_ASSIGNMENT` docs
2022-06-27 17:33:31 +00:00
bors
fdd0e727e2
Auto merge of #8649 - ebobrow:imperative_find, r=flip1995
...
add [`manual_find`] lint for function return case
part of the implementation discussed in #7143
changelog: add [`manual_find`] lint for function return case
2022-06-27 17:15:25 +00:00
Jason Newcomb
c10101cf1c
Don't lint trivially_copy_pass_by_ref
when unsafe pointers are used
2022-06-27 13:14:27 -04:00
Jason Newcomb
2315f76f9d
Actually check lifetimes in trivially_copy_pass_by_ref
2022-06-27 13:14:25 -04:00
alexey semenyuk
c6a2221393
Fix example SELF_ASSIGNMENT
2022-06-27 18:21:09 +03:00
bors
eaa03ea911
Auto merge of #8972 - kyoto7250:use_retain, r=llogiq
...
feat(new lint): new lint `manual_retain`
close #8097
This PR is a new lint implementation.
This lint checks if the `retain` method is available.
Thank you in advance.
changelog: add new ``[`manual_retain`]`` lint
2022-06-27 13:58:26 +00:00
bors
889b3613ae
Auto merge of #8990 - tsoutsman:master, r=llogiq
...
Fix `let_undescore_lock` false-positive when binding without locking
Fixes #8486 .
changelog: Fix `let_undescore_lock` false-positive when binding without locking.
2022-06-27 13:38:50 +00:00
Klim Tsoutsman
65f700fa89
Fix let_undescore_lock
false-positive when binding without locking
...
Signed-off-by: Klim Tsoutsman <klimusha@gmail.com>
2022-06-27 20:35:26 +10:00
bors
6b762ee330
Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
...
STRING_ADD example
changelog: none
STRING_ADD example, how it should be
2022-06-27 06:08:00 +00:00
bors
57e7e1d7d8
Auto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate
...
Add `cargo dev deprecate`
changelog: none
I wrote this awhile ago when `regex` was still a dependency. Is it alright to add it back?
2022-06-27 00:32:22 +00:00
bors
88da5f2bb3
Auto merge of #8939 - Jarcho:transmute_ptr_to_ref_lt, r=giraffate
...
Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`
fixes #8924
changelog: Suggest casting the pointer for any type containing lifetimes in `transmute_ptr_to_ref`.
changelog: Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`.
2022-06-27 00:05:50 +00:00
kyoto7250
676af4530f
cargo dev update_lints
2022-06-27 08:21:09 +09:00
kyoto7250
3a9c0ef8a1
fix for git rebase
2022-06-27 08:11:58 +09:00
kyoto7250
dd3d0fdad3
rename use_retain => manual_retain
2022-06-27 08:11:58 +09:00
kyoto7250
4decfdec76
check msrv
2022-06-27 08:11:58 +09:00
kyoto7250
14212115c4
rewrite without if_chain macro
2022-06-27 08:11:58 +09:00
kyoto7250
fd629c0cde
check method
2022-06-27 08:11:58 +09:00
kyoto7250
3953c530f4
change lint type from style to perf
2022-06-27 08:11:58 +09:00
kyoto7250
e3afc72caa
remove needless return
2022-06-27 08:11:58 +09:00
kyoto7250
b20b8f10dd
Update clippy_lints/src/use_retain.rs
...
Co-authored-by: llogiq <bogusandre@gmail.com>
2022-06-27 08:11:58 +09:00
kyoto7250
5f2b8e67b3
feat(new lint): new lint use_retain
2022-06-27 08:11:58 +09:00
bors
9b150625a9
Auto merge of #9032 - kyoto7250:issue_9018, r=llogiq
...
enum_variant_names should ignore when all prefixes are _
close #9018
When Enum prefix is only an underscore, we should not issue warnings.
changelog: fix false positive in enum_variant_names
2022-06-26 16:11:06 +00:00
bors
ab58276146
Auto merge of #9055 - kyoto7250:update_nodejs_in_github_action, r=Manishearth
...
update node.js version in `remark.yml`
Optional chain (`?.`) is available in `node v14`, but node version in CI is `node v12`, so CI is failed now.
ref:
https://github.com/rust-lang/rust-clippy/runs/7059529735?check_suite_focus=true
optional chain:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining#browser_compatibility
Corresponding PR (maybe)
https://github.com/remarkjs/remark/pull/1007
changelog: None
2022-06-26 15:07:22 +00:00
kyoto7250
11bf291189
update node.js version
2022-06-26 20:19:32 +09:00
alexey semenyuk
16919143e4
STRING_ADD example
2022-06-26 08:36:50 +00:00
alexey semenyuk
4065702b1f
STRING_ADD example
2022-06-26 11:14:37 +03:00
kyoto7250
d827b834d9
use all instead of join
2022-06-26 16:11:04 +09:00
kyoto7250
bf317a83cf
treat argument as a slice.
...
Co-authored-by: llogiq <bogusandre@gmail.com>
2022-06-26 15:55:44 +09:00
bors
8789f4e88a
Auto merge of #8985 - botahamec:single-match-option, r=llogiq
...
Lint `[single_match]` on `Option` matches
fixes #8928
changelog: did some cleanup of the logic for ``[`single_match`]`` and ``[`single_match_else`]`` which fixes the bug where `Option` matches were not linted unless a wildcard was used for one of the arms.
2022-06-25 16:48:34 +00:00
xFrednet
3a31ef7456
Give clippy some Dogfood to make it happy =^.^=
2022-06-25 14:53:54 +02:00
xFrednet
4d41a97735
Add note to is_lint_allowed
about lint emission
2022-06-25 14:37:52 +02:00
xFrednet
6427ba4855
Fix #[expect]
for clippy::manual_non_exhaustive
2022-06-25 14:37:51 +02:00
xFrednet
525f5ee7ac
Update useless_attribute
docs and allow macro_use_imports
2022-06-25 14:37:51 +02:00
xFrednet
ae4900c9b8
Fix #[expect]
for clippy::macro_use_imports
2022-06-25 14:37:50 +02:00
xFrednet
79fc2716dc
Fix #[expect]
for unnecessary_unwrap
, panicking_unwrap
2022-06-25 14:21:24 +02:00
xFrednet
bdc6ece1b6
Fix #[expect]
for clippy::needless_return
2022-06-25 14:16:31 +02:00
xFrednet
54ad99b6e5
Fix #[expect]
for clippy::implicit_return
2022-06-25 14:16:31 +02:00
xFrednet
b2976980b5
Fix #[expect]
for clippy::boxed_local
2022-06-25 14:16:30 +02:00
xFrednet
b6ee6bba4c
Fix #[expect]
for clippy::nonminimal_bool
2022-06-25 14:16:30 +02:00
xFrednet
a3c7101f61
Fix #[expect]
for clippy::logic_bug
2022-06-25 14:16:30 +02:00
xFrednet
811d73a2b7
Test #[expect]
for redundant_clone
2022-06-25 14:16:29 +02:00
xFrednet
e7c55a478f
Fix #[expect]
for clippy::ptr_arg
2022-06-25 14:16:28 +02:00
Jason Newcomb
7cdaabc9b7
Suggest pointer::cast
when possible in transmute_ptr_to_ref
...
Defensively add a cast to any type with lifetimes.
2022-06-25 07:55:30 -04:00
bors
93ebd0e2db
Auto merge of #9015 - kyoto7250:issue_8493, r=Jarcho
...
ignore item in `thread_local!` macro
close #8493
This PR ignores `thread_local` macro in `declare_interior_mutable_const`.
changelog: ignore `thread_local!` macro in `declare_interior_mutable_const`
2022-06-25 02:40:30 +00:00