Commit Graph

82 Commits

Author SHA1 Message Date
Camille GILLOT ca0379d6cd Diagnose liveness on MIR. 2025-10-11 20:50:21 +00:00
Camille Gillot 96b70fc3a1 Always compile hir_id_validator.
Making this compilation conditional causes an unused crate dependency
warning.
2025-10-11 20:50:21 +00:00
Camille GILLOT e0a89c4b14 Simplify maybe_record_as_seed. 2025-08-04 23:00:45 +00:00
Oli Scherer 1b9d38dd08 Remove check_mod_loops query and run the checks per-body instead 2025-06-10 08:41:23 +00:00
bjorn3 9223704f4b Remove all unused feature gates from the compiler 2025-06-08 14:50:42 +00:00
Oli Scherer 02e2766cc3 Move naked fn checks to hir_typeck 2025-05-30 16:08:44 +00:00
Oli Scherer 685d1c9e29 Change a per-module query to just run on the items it internally filters for 2025-05-30 15:07:36 +00:00
Pietro Albini 2ce08ca5d6 update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
Bryanskiy 14535312b5 Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
Andrew Zhogin c366756a85 AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
est31 7493e1cdf6 Make #![feature(let_chains)] bootstrap conditional in compiler/ 2025-04-23 16:40:30 +02:00
Nicholas Nethercote 1830245a22 Remove recursion_limit increases.
These are no longer needed now that `Nonterminal` is gone.
2025-04-02 16:25:27 +11:00
bors 249cb84316 Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #137314 (change definitely unproductive cycles to error)
 - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`)
 - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr)
 - #138331 (Use `RUSTC_LINT_FLAGS` more)
 - #138345 (Some autodiff cleanups)
 - #138387 (intrinsics: remove unnecessary leading underscore from argument names)
 - #138390 (fix incorrect tracing log)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-12 17:27:43 +00:00
Nicholas Nethercote ff0a5fe975 Remove #![warn(unreachable_pub)] from all compiler/ crates.
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-11 13:14:21 +11:00
许杰友 Jieyou Xu (Joe) 063ef18fdc Revert "Use workspace lints for crates in compiler/ #138084"
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to
consider options that avoids breaking downstream usages of cargo on
distributed `rustc-src` artifacts, where such cargo invocations fail due
to inability to inherit `lints` from workspace root manifest's
`workspace.lints` (this is only valid for the source rust-lang/rust
workspace, but not really the distributed `rustc-src` artifacts).

This breakage was reported in
<https://github.com/rust-lang/rust/issues/138304>.

This reverts commit 48caf81484, reversing
changes made to c6662879b2.
2025-03-10 18:12:47 +08:00
Nicholas Nethercote 8a3e03392e Remove #![warn(unreachable_pub)] from all compiler/ crates.
(Except for `rustc_codegen_cranelift`.)

It's no longer necessary now that `unreachable_pub` is in the workspace
lints.
2025-03-08 08:41:43 +11:00
Nicholas Nethercote 293fe0a966 Increase recursion_limit in numerous crates.
This is temporarily needed for `x doc compiler` to work. They can be
removed once the `Nonterminal` is removed (#124141).
2025-03-07 14:51:07 +11:00
Michael Goulet 01ff36a6b9 Get rid of HIR const checker 2024-11-22 02:32:26 +00:00
Sam Estep 090c24fbbf Merge -Zhir-stats into -Zinput-stats 2024-11-15 12:46:40 -05:00
Nicholas Nethercote f77821203f Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
Nicholas Nethercote 75b164d836 Use tidy to sort crate attributes for all compiler crates.
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.

For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
  `allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
  sometimes the order is alphabetical, and sometimes there is no
  particular order.
- Sometimes the attributes of a particular kind aren't even grouped
  all together, e.g. there might be a `feature`, then an `allow`, then
  another `feature`.

This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.

Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
  because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
  ignored in `rustfmt.toml`).
2024-06-12 15:49:10 +10:00
Nicholas Nethercote 725292315e Remove #[macro_use] extern crate tracing from rustc_passes. 2024-05-23 18:02:17 +10:00
Nicholas Nethercote 99e036bd21 Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
Markus Reiter 33e68aadc9 Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
r0cky f41537981b Add proper cfgs for struct HirIdValidator used only with debug assertions 2024-03-06 22:54:22 +08:00
Markus Reiter 746a58d435 Use generic NonZero internally. 2024-02-15 08:09:42 +01:00
Zalathar cf1096eb72 Remove unnecessary #![feature(min_specialization)] 2024-02-10 12:26:14 +11:00
Nicholas Nethercote 0ac1195ee0 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
David Tolnay 97a720b39b Rebase slice_group_by stabilization PR 2024-01-25 22:20:59 -08:00
clubby789 fd29f74ff8 Remove unused features 2024-01-25 14:01:33 +00:00
Camille GILLOT 8bb74c0187 Pass DeadItem and lint as consistent group in dead-code. 2023-12-25 13:15:28 +00:00
Martin Nordholts e9b16cc2c5 rustc_passes: Enforce rustc::potential_query_instability lint
Stop allowing `rustc::potential_query_instability` in all of
`rustc_passes` and instead allow it on a case-by-case basis if it is
safe. In this case, all instances of the lint are safe to allow.
2023-12-12 13:57:52 +01:00
Nicholas Nethercote 57cd5e6551 Use rustc_fluent_macro::fluent_messages! directly.
Currently we always do this:
```
use rustc_fluent_macro::fluent_messages;
...
fluent_messages! { "./example.ftl" }
```
But there is no need, we can just do this everywhere:
```
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
```
which is shorter.
2023-11-26 08:38:40 +11:00
Nicholas Nethercote a733082be9 Avoid need for {D,Subd}iagnosticMessage imports.
The `fluent_messages!` macro produces uses of
`crate::{D,Subd}iagnosticMessage`, which means that every crate using
the macro must have this import:
```
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
```

This commit changes the macro to instead use
`rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the
imports.
2023-11-26 08:38:00 +11:00
Mark Rousskov db3e2bacb6 Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
Michael Howell c6e6ecb1af rustdoc: remove rust logo from non-Rust crates 2023-10-08 20:17:53 -07:00
Ralf Jung abe2148aee add rustc_abi debugging attribute 2023-08-27 11:55:49 +02:00
John Kåre Alsaker fff20a703d Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
clubby789 6a41cfe095 Migrate rustc_passes to translatable diagnostics 2023-04-26 11:40:21 +01:00
Nilstrieb b5d3d970fa Add rustc_fluent_macro to decouple fluent from rustc_macros
Fluent, with all the icu4x it brings in, takes quite some time to
compile. `fluent_messages!` is only needed in further downstream rustc
crates, but is blocking more upstream crates like `rustc_index`. By
splitting it out, we allow `rustc_macros` to be compiled earlier, which
speeds up `x check compiler` by about 5 seconds (and even more after the
needless dependency on `serde_json` is removed from
`rustc_data_structures`).
2023-04-18 18:56:22 +00:00
est31 7e2ecb3cd8 Simplify message paths
This makes it easier to open the messages file while developing on features.

The commit was the result of automatted changes:

for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done

for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-11 22:51:57 +01:00
David Wood d1fcf61117 errors: generate typed identifiers in each crate
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:53 +00:00
Charles Lew 3b6b6047b6 Lint against usages of struct_span_lint_hir. 2022-10-29 18:03:47 +08:00
rdvdev2 bde80f745b Add lint for diagnostic migration 2022-10-07 13:19:26 -06:00
Pietro Albini 3975d55d98 remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
est31 173eb6f407 Only enable the let_else feature on bootstrap
On later stages, the feature is already stable.

Result of running:

rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-15 21:06:45 +02:00
Nilstrieb d1ef8180f9 Revert let_chains stabilization
This reverts commit 3266460749.

This is the revert against master, the beta revert was already done in #100538.
2022-08-29 19:34:11 +02:00
Mark Rousskov 154a09dd91 Adjust cfgs 2022-08-12 16:28:15 -04:00
Caio 3266460749 Stabilize let_chains 2022-07-16 20:17:58 -03:00
David Wood 78b19a90b7 passes: migrate half of check_attr
Migrate half of the `rustc_passes::check_attr` diagnostics to using
diagnostic derives and being translatable.
2022-07-15 16:13:49 +01:00