Commit Graph

1427 Commits

Author SHA1 Message Date
bjorn3 62bd45d7be Move env/file_depinfo from ParseSess to Session 2026-03-12 15:35:27 +00:00
Philipp Krones 088022c7d4 Merge commit 'df995ede1b3e61f0e87081d9548e6cd2a3ec9095' into clippy-subtree-update 2026-02-24 12:00:51 +01:00
Philipp Krones c8fd55b457 Merge commit 'a62c6af53676bb15a40488ce2d632de558f001de' into clippy-subtree-update 2026-02-12 14:50:58 +01:00
Chris Denton 4e4651b045 Return ExitCode from rustc_driver::main
This makes rustc simply return an exit code from main rather than calling `std::process::exit` with an exit code. This means that drops run normally and the process exits cleanly.

Also instead of hard coding success and failure codes this uses `ExitCode::SUCCESS` and `ExitCode::FAILURE`, which in turn effectively uses `libc::EXIT_SUCCESS` and `libc::EXIT_FAILURE` (via std). These are `0` and `1` respectively for all currently supported host platforms so it doesn't actually change the exit code.
2026-01-23 21:04:27 +00:00
Philipp Krones 977eddef3f Merge commit '54482290b5f32e6c6b57cc9e0a17153f432b0036' into clippy-subtree-update 2026-01-22 19:02:54 +01:00
Jonathan Brouwer c591bc103a Remove all allows for diagnostic_outside_of_impl and untranslatable_diagnostic throughout the codebase
This PR was mostly made by search&replacing
2026-01-19 17:39:49 +01:00
Philipp Krones 099308af90 Merge commit '92b4b68683249c781c3acad742fc6e57c4140ad9' into clippy-subtree-update 2025-11-28 20:25:22 +01:00
Mads Marquart 2fc8d717c5 Simplify jemalloc setup
Using the new `override_allocator_on_supported_platforms` feature in
`tikv-jemalloc-sys v0.6.1` we can avoid the manual statics.
2025-11-23 10:44:13 +01:00
Jakub Beránek a200679d96 Revert "Rollup merge of #146627 - madsmtm:jemalloc-simplify, r=jdonszelmann"
This reverts commit 5dc3c19417, reversing
changes made to 11339a0ef5.
2025-11-13 10:29:26 +01:00
Mads Marquart a72893f708 Simplify jemalloc setup
Using the new `override_allocator_on_supported_platforms` feature in
`tikv-jemalloc-sys v0.6.1` we can avoid the manual statics.
2025-11-11 20:16:15 +01:00
Jakub Beránek ce0c449237 Generalize branch references to HEAD 2025-11-02 11:15:55 +01:00
Philipp Krones 8f61305722 Merge commit 'd9fb15c4b1ebe9e7dc419e07f53af681d7860cbe' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
Philipp Krones 9b0611ff7a Merge commit 'e9b70454e4c9584be3b22ddabd26b741aeb06c10' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
Philipp Krones 074ccaf3c0 Merge commit 'c5dbd1de07e0407b9687619a868384d6de06253f' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
Jakub Beránek dd0fa3d356 Add jemalloc feature to Clippy 2025-06-10 11:09:54 +02:00
Philipp Krones 7debaf6b44 Merge commit 'cadf98bb7d783e2ea3572446c3f80d3592ec5f86' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
Philipp Krones 93bd4d8931 Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
Philipp Krones ff428d91c2 Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
Alex Macleod 94ec23934c Allow drivers to supply a list of extra symbols to intern 2025-04-10 13:39:23 +00:00
bjorn3 abdee777c2 Some cleanups around EarlyDiagCtxt
All callers of EarlyDiagCtxt::early_error now emit a fatal error.
2025-02-02 16:06:43 +00:00
Bastian Kersting 27454db7d1 Insert null checks for pointer dereferences when debug assertions are enabled
Similar to how the alignment is already checked, this adds a check
for null pointer dereferences in debug mode. It is implemented similarly
to the alignment check as a MirPass.

This is related to a 2025H1 project goal for better UB checks in debug
mode: https://github.com/rust-lang/rust-project-goals/pull/177.
2025-01-31 11:13:34 +00:00
Philipp Krones 9da9ddb7db Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
bjorn3 d7b39401dd Remove RunCompiler
It has become nothing other than a wrapper around run_compiler.
2025-01-23 09:38:58 +00:00
bjorn3 1da4eb3f8b Remove the need to manually call set_using_internal_features 2025-01-23 09:38:58 +00:00
Philipp Krones 1cc50519d1 Merge commit '609cd310be44677ae31d452a17b0f8207e1abfe1' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
bjorn3 63e4979399 Remove all threading through of ErrorGuaranteed from the driver
It was inconsistently done (sometimes even within a single function) and
most of the rest of the compiler uses fatal errors instead, which need
to be caught using catch_with_exit_code anyway. Using fatal errors
instead of ErrorGuaranteed everywhere in the driver simplifies things a
bit.
2024-12-06 18:42:31 +00:00
Philipp Krones 277c4e4baf Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into clippy-subtree-update 2024-10-03 16:32:51 +02:00
Philipp Krones b61fcbee76 Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
John Kåre Alsaker 837d9045c5 Link std statically in rustc_driver 2024-08-11 04:16:53 +02:00
Philipp Krones 1ac76a2062 Merge commit 'cb806113e0f83a8f9b47d35b453b676543bcc40e' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
Mark Rousskov 5faea65d4d step cfg(bootstrap) 2024-07-28 14:46:29 -04:00
xFrednet 1b4c281fe7 RFC 2383: Stabilize lint_reasons in Clippy 🖇️ 2024-06-25 17:50:48 +02:00
Oli Scherer 4b7ae63fbf Use a dedicated type instead of a reference for the diagnostic context
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18 15:42:11 +00:00
Peter Jaszkowiak a456300af5 Stabilize LazyCell and LazyLock (lazy_cell) 2024-02-20 20:55:13 -07:00
The Miri Cronjob Bot 55b757ee3c Merge from rustc 2024-03-08 05:17:07 +00:00
Philipp Krones 7e83df4068 Merge commit '93f0a9a91f58c9b2153868f458402155fb6265bb' into clippy-subtree-update 2024-03-07 17:19:29 +01:00
beetrees 865ac89dbd Use rustc_driver::args::raw_args() in Clippy 2024-03-07 00:20:01 +00:00
Nicholas Nethercote b74b4b09d1 Rename all ParseSess variables/fields/lifetimes as psess.
Existing names for values of this type are `sess`, `parse_sess`,
`parse_session`, and `ps`. `sess` is particularly annoying because
that's also used for `Session` values, which are often co-located, and
it can be difficult to know which type a value named `sess` refers to.
(That annoyance is the main motivation for this change.) `psess` is nice
and short, which is good for a name used this much.

The commit also renames some `parse_sess_created` values as
`psess_created`.
2024-03-05 08:11:45 +11:00
Philipp Krones 7be6e2178e Merge commit '10136170fe9ed01e46aeb4f4479175b79eb0e3c7' into clippy-subtree-update 2024-02-27 15:50:17 +01:00
surechen d88ad9e6b7 By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking.
fixes #117448

For example unnecessary imports in std::prelude that can be eliminated:

```rust
use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
```
2024-02-18 16:38:11 +08:00
Matthias Krüger 8f00ffc901 Rollup merge of #120806 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-02-09 19:21:17 +01:00
Philipp Krones f3b3d23416 Merge commit '60cb29c5e4f9772685c9873752196725c946a849' into clippyup 2024-02-08 20:24:42 +01:00
Nicholas Nethercote 998c72293f Invert diagnostic lints.
That is, change `diagnostic_outside_of_impl` and
`untranslatable_diagnostic` from `allow` to `deny`, because more than
half of the compiler has be converted to use translated diagnostics.

This commit removes more `deny` attributes than it adds `allow`
attributes, which proves that this change is warranted.
2024-02-06 13:12:33 +11:00
Nicholas Nethercote d165a38de0 Rename many DiagCtxt and EarlyDiagCtxt locals. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote 42729d6b9a Rename EarlyErrorHandler as EarlyDiagCtxt. 2023-12-18 16:06:21 +11:00
Philipp Krones 3596d44988 Merge commit 'a859e5cc1ce100df22346a1005da30532d04de59' into clippyup 2023-12-16 14:12:50 +01:00
Nicholas Nethercote dc702e358d Rename *note_without_error as *note.
Because the variant name in `Level` is `Note`, and the `without_error`
suffix is omitted in similar cases like `struct_allow` and
`struct_help`.
2023-12-02 08:58:25 +11:00
Philipp Krones 6246f0446a Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyup 2023-11-16 19:13:24 +01:00
Philipp Krones 77c1e3aaa1 Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyup 2023-11-02 17:35:56 +01:00
bors d9148904e0 Auto merge of #116818 - Nilstrieb:stop-submitting-bug-reports, r=wesleywiser
Stop telling people to submit bugs for internal feature ICEs

This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported.

I thought about several ways to do this but now used the explicit threading of an `Arc<AtomicBool>` through `Session`. This is not exactly incremental-safe, but this is fine, as this is set during macro expansion, which is pre-incremental, and also only affects the output of ICEs, at which point incremental correctness doesn't matter much anyways.

See [MCP 620.](https://github.com/rust-lang/compiler-team/issues/596)

![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
2023-10-26 02:08:07 +00:00