Jason Newcomb
0dd5c4ddeb
Fix used_underscore_items lint uses of foreign functions ( #14205 )
...
Fixed #14156
changelog: none
2025-02-15 02:46:49 +00:00
WeiTheShinobi
b167895a19
Fix used_underscore_items lint uses of foreign functions
2025-02-13 01:06:32 +08:00
Philipp Krones
f549562b81
Merge remote-tracking branch 'upstream/master' into rustup
2025-02-06 14:31:01 +01:00
Nicholas Nethercote
d30f045fce
Convert two rustc_middle::lint functions to Span methods.
...
`rustc_middle` is a huge crate and it's always good to move stuff out of
it. There are lots of similar methods already on `Span`, so these two
functions, `in_external_macro` and `is_from_async_await`, fit right in.
The diff is big because `in_external_macro` is used a lot by clippy
lints.
2025-02-02 13:57:34 +11:00
Samuel Tardieu
7848488e26
Use a better message for toplevel_ref_arg lint
...
A `ref` pattern applied to an argument is not ignored. It creates a
reference as expected, but still requires the function to take ownership
of the argument given to it.
2025-02-01 14:23:31 +01:00
Philipp Krones
9da9ddb7db
Merge commit ' 51d49c1ae2' into clippy-subtree-update
2025-01-28 19:33:54 +01:00
Timo
88d83b6e55
short_circuit_statement: handle macros and parenthesis better (#14047 )
...
- The lint no longer triggers if one of the operands in the boolean
expression comes from a macro expansion.
- Parenthesis are now removed inside the generated block if they are no
longer necessary.
- Error markers have been added.
changelog: [`short_circuit_statement`]: better handling of macros and
better looking suggestions
2025-01-22 02:54:49 +00:00
Samuel Tardieu
7f162fa9af
short_circuit_statement: handle macros and parenthesis better
...
- The lint no longer triggers if the expression comes from macro
expansion
- Parenthesis are now removed inside the generated block if they are no
longer necessary.
2025-01-21 09:12:38 +01:00
Samuel Tardieu
3a7f50f6d3
Apply unnecessary_semicolon to Clippy sources
2025-01-19 15:34:07 +01:00
Philipp Krones
d58b911e01
Merge commit ' ff4a26d442' into clippy-subtree-update
2024-11-28 19:38:59 +01:00
xFrednet
78d0a2aaac
Update version attributes for 1.83 lints
2024-11-21 13:50:31 +00:00
Samuel Tardieu
ca963b653e
Simplify instances of Option::map_or(true, …) in Clippy sources
2024-11-16 00:12:41 +01:00
Philipp Krones
b61fcbee76
Merge commit ' 7901289135' into clippy-subtree-update
2024-09-24 11:58:04 +02:00
Philipp Krones
3ab1da8bab
Formatting
2024-09-22 20:52:15 +02:00
WeiTheShinobi
d40e04a1cb
used_underscore_items will not lint exteranl item
2024-08-26 00:52:52 +08:00
WeiTheShinobi
b615c82180
Add new lint: used_underscore_items
2024-08-21 19:57:41 +08:00
Philipp Krones
4e6851e50b
Merge commit ' 37f4fbb929' into clippy-subtree-update
2024-07-25 18:29:17 +02:00
Philipp Krones
c1fd25d0aa
Merge commit ' b794b8e08c' into clippy-subtree-update
2024-07-11 15:44:03 +02:00
Jason Newcomb
36a14e3a12
misc:
...
* Delay macro checks.
* Use `span_lint_hir`.
2024-07-07 22:05:26 -04:00
Jason Newcomb
d8fb164a7c
Rename any_parent_is_automatically_derived to in_automatically_derived. Only check for the attribute on an impl block.
2024-07-06 00:24:48 -04:00
Jules Bertholet
876d5f00a0
Rename BindingAnnotation to BindingMode
2024-04-17 09:34:39 -04:00
Matthias Krüger
4daaf19138
Rollup merge of #122807 - danielhuang:fix-1, r=davidtwco
...
Add consistency with phrases "meantime" and "mean time"
"mean time" is used in a few places while "meantime" is used everywhere else; this would make usage consistent throughout the codebase.
2024-04-08 14:31:10 +02:00
Philipp Krones
0ae4a048c6
Merge commit ' 9725c4a162' into clippy-subtree-update
2024-04-04 19:52:55 +02:00
Dan
ca92c0a7a4
update messages
2024-04-03 19:03:12 -04:00
Jules Bertholet
11b28d44bd
Implement mut ref/mut ref mut
2024-03-27 09:53:23 -04:00
Guillaume Gomez
1e30c2915b
Rollup merge of #122513 - petrochenkov:somehir4, r=fmease
...
hir: Remove `opt_local_def_id_to_hir_id` and `opt_hir_node_by_def_id`
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`.
Follow up to https://github.com/rust-lang/rust/pull/120943 .
2024-03-15 17:24:09 +01:00
Vadim Petrochenkov
f55a04928f
hir: Remove opt_local_def_id_to_hir_id and opt_hir_node_by_def_id
...
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
2024-03-14 22:34:24 +03:00
Guillaume Gomez
0e2897fd4f
Rename hir::StmtKind::Local into hir::StmtKind::Let
2024-03-14 12:42:04 +01:00
Philipp Krones
c9a43b18f1
Merge commit ' f0cdee4a3f' into clippy-subtree-sync
2023-12-01 18:21:58 +01:00
Philipp Krones
6246f0446a
Merge commit ' edb720b199' into clippyup
2023-11-16 19:13:24 +01:00
bors
2d9af160af
Auto merge of #117507 - nnethercote:rustc_span, r=Nilstrieb
...
`rustc_span` cleanups
Just some things I found while looking over this crate.
r? `@oli-obk`
2023-11-03 14:57:40 +00:00
Philipp Krones
77c1e3aaa1
Merge commit ' 09ac14c901' into clippyup
2023-11-02 17:35:56 +01:00
Nicholas Nethercote
e1ec2d5cc9
Minimize pub usage in source_map.rs.
...
Most notably, this commit changes the `pub use crate::*;` in that file
to `use crate::*;`. This requires a lot of `use` items in other crates
to be adjusted, because everything defined within `rustc_span::*` was
also available via `rustc_span::source_map::*`, which is bizarre.
The commit also removes `SourceMap::span_to_relative_line_string`, which
is unused.
2023-11-02 19:35:00 +11:00
Philipp Krones
772296c50e
Merge commit ' 7671c283a5' into clippyup
2023-09-25 11:28:58 +02:00
Philipp Krones
b76b0aeb63
Merge commit ' 435a8ad86c' into clippyup
2023-05-20 15:39:26 +02:00
Philipp Krones
8df896c076
Merge commit ' d5e2a7aca5' into clippyup
2023-03-24 14:26:19 +01:00
Camille GILLOT
92c4f1e2d9
Take a LocalDefId in hir::Visitor::visit_fn.
2023-01-28 09:51:50 +00:00
Philipp Krones
1c422524c7
Merge commit ' 4bdfb0741d' into clippyup
2022-12-17 14:12:54 +01:00
Philipp Krones
d75b25faab
Merge commit ' ac0e10aa68' into clippyup
2022-10-06 09:44:38 +02:00
Cameron Steffen
e5f30f4dfa
clippy: BindingAnnotation change
2022-09-02 13:03:11 -05:00
Philipp Krones
7d4daaa8fa
Merge commit ' fdb84cbfd2' into clippyup
2022-07-18 09:39:37 +02:00
Andrea Nall
3388787615
Add test for and fix rust-lang/rust-clippy#9131
...
This lint seems to have been broken by #98446
2022-07-07 19:30:37 +00:00
Philipp Krones
09f5df5087
Merge commit ' 0cb0f76368' into clippyup
2022-06-30 10:50:09 +02:00
flip1995
f8f9d01c2a
Merge commit ' d7b5cbf065' into clippyup
2022-06-16 17:39:06 +02:00
Philipp Krones
f067783461
Merge commit ' d9ddce8a22' into clippyup
2022-06-04 13:34:07 +02:00
xFrednet
4587b6628d
Merge 'rust-clippy/master' into clippyup
2022-05-21 13:24:00 +02:00
flip1995
611d039814
Merge commit ' 57b3c4b90f' into clippyup
2022-02-10 18:40:06 +01:00
Cameron Steffen
82f613ee3b
Remove a span from hir::ExprKind::MethodCall
2022-01-21 07:48:10 -06:00
flip1995
ddad101b8a
Merge commit ' 8d14c94b5c' into clippyup
2022-01-17 13:29:07 +01:00
flip1995
fb0142ae41
Merge commit ' 97a5daa659' into clippyup
2022-01-13 13:18:19 +01:00