31 Commits

Author SHA1 Message Date
Philipp Krones
f2b7e9ff52
Merge remote-tracking branch 'upstream/master' into rustup 2025-08-07 16:47:42 +02:00
Jana Dönszelmann
05e3a7a499 remove rustc_attr_data_structures 2025-07-31 14:19:27 +02:00
Philipp Krones
5c7418b38a Merge commit '1db89a1b1ca87f24bf22d0bad21d14b2d81b3e99' into clippy-subtree-update 2025-07-25 15:54:22 +02:00
Philipp Krones
c98e60a56e
Merge remote-tracking branch 'upstream/master' into rustup 2025-07-25 15:04:01 +02:00
bors
f4b827abeb Auto merge of #143745 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to `ui_test` bump and restructure.
2025-07-14 19:53:18 +00:00
Jonathan Brouwer
3187aa751a Fix clippy & rustdoc-json
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12 17:48:52 +02:00
Philipp Krones
4e614bf683 Merge commit 'cdbbf3afda0b1bf51568b368f629b1d828507f98' into clippy-subtree-update 2025-07-10 20:25:36 +02:00
Philipp Krones
9e0f749e08
Merge remote-tracking branch 'upstream/master' into rustup 2025-07-10 20:01:08 +02:00
Philipp Krones
cbd683fe31 Merge commit '4ef75291b5dd6739212f1f61666d19d4e086690d' into clippy-subtree-update 2025-06-13 11:24:45 +02:00
Philipp Krones
85655d4a09
Merge remote-tracking branch 'upstream/master' into rustup 2025-06-13 10:17:14 +02:00
Philipp Krones
384b53eee2 Merge remote-tracking branch 'upstream/master' into rustup 2025-05-31 14:09:03 +02:00
Michael Goulet
327967c351 Rename unpack to kind 2025-05-27 11:14:45 +00:00
Philipp Krones
7debaf6b44 Merge commit 'cadf98bb7d783e2ea3572446c3f80d3592ec5f86' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
Philipp Krones
910e640f9b
Merge remote-tracking branch 'upstream/master' into rustup 2025-05-21 14:50:06 +02:00
Samuel Tardieu
e16801e68c
Use symbols instead of &str when possible 2025-05-19 22:47:57 +02:00
Samuel Tardieu
e2b1de107f
Access items through rustc_session instead of rustc_lint_defs
Items such as the `declare_tool_lint!()` macro are publicly reexported
from `rustc_lint_defs` to `rustc_session`. Use the latter for
consistency.
2025-05-19 18:05:34 +02:00
Stuart Cook
a22efe773d Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin
make `rustc_attr_parsing` less dominant in the rustc crate graph

It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly.

Previous graph:
![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd)

Graph with this PR:
![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a)

The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*.

The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-19 13:24:54 +10:00
mejrs
035146e398 Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
Philipp Krones
93bd4d8931 Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
llogiq
17f2a87c0c
Add internal lint derive_deserialize_allowing_unknown (#14360)
Adds an internal lint to check for `#[derive(serde::Deserialize)]`
without
[`#[serde(deny_unknown_fields)]`](https://serde.rs/container-attrs.html#deny_unknown_fields).

Today, if you run Clippy with the following clippy.toml, Clippy will
produce a warning, but there will be no accompanying note:
```toml
# In the following configuration, "recommendation" should be "reason" or "replacement".
disallowed-macros = [
    { path = "std::panic", recommendation = "return a `std::result::Result::Error` instead" },
]
```
```sh
$ cargo clippy
    Checking a v0.1.0 (/home/smoelius/tmp/a)
warning: use of a disallowed macro `std::panic`
 --> src/lib.rs:2:5
  |
2 |     panic!();
  |     ^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
  = note: `#[warn(clippy::disallowed_macros)]` on by default
```
The underlying problem is: the enum that derives `serde::Deserialize`
([`DisallowedPathEnum`](81643e297c/clippy_config/src/types.rs (L47)))
does not have the attribute `#[serde(deny_unknown_fields)]`.

This lint identifies such problems by checking trait `impl`s. An
alternative I considered was to walk `clippy_config::conf::Conf`
directly. However, that would not catch the `DisallowedPathEnum` case
because it [is not used in `Conf`
directly](81643e297c/clippy_config/src/types.rs (L31)).

Just to be clear, no one asked for this. So I hope the maintainers do
not mind.

changelog: none
2025-05-13 15:36:57 +00:00
Samuel Moelius
9f4ecea242 Add internal lint derive_deserialize_allowing_unknown 2025-05-13 10:48:41 -04:00
Alex Macleod
5aac708398 Replace Symbol::as_str usage in match expressions 2025-05-07 13:52:11 +00:00
Alex Macleod
737d3b3363 Remove some unused #![feature]s 2025-05-06 14:07:39 +00:00
Alex Macleod
94aa0d9a75 Update clippy_lints_internal to 2024 edition 2025-05-06 14:07:14 +00:00
Alex Macleod
f23772ce8c Move lookup_path and similar into clippy_utils::paths 2025-05-04 17:13:02 +00:00
Alex Macleod
b768fbe4bc Replace str path utils with new PathLookup type 2025-05-04 15:26:37 +00:00
Philipp Krones
dd5113daab Merge commit '03a5b6b976ac121f4233775c49a4bce026065b47' into clippy-subtree-update 2025-05-01 10:22:55 +02:00
Alex Macleod
7b337f6e25 Replace some Symbol::as_str usage 2025-04-25 01:03:03 +00:00
Philipp Krones
ff428d91c2 Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
Alex Macleod
b52bd96713 Replace interning of string literals with preinterned symbols 2025-04-18 22:44:16 +00:00
Jason Newcomb
5b4b463d49 Move internal lints to their own crate 2025-04-12 17:53:36 -04:00