about summary refs log tree commit diff
path: root/compiler/rustc_ast_ir
AgeCommit message (Collapse)AuthorLines
2025-08-27turn pointer width into an integer in target.jsonWaffle Lapkin-2/+2
2025-07-31Tidy up `Cargo.toml` files.Nicholas Nethercote-2/+4
- Add some missing `tidy-alphabetical-*` markers. - Remove some unnecessary blank lines.
2025-07-31Deduplicate `IntTy`/`UintTy`/`FloatTy`.Nicholas Nethercote-0/+212
There are identical definitions in `rustc_type_ir` and `rustc_ast`. This commit removes them and places a single definition in `rustc_ast_ir`. This requires adding `rust_span` as a dependency of `rustc_ast_ir`, but means a bunch of silly conversion functions can be removed. The one annoying wrinkle is that the old version had differences in their `Debug` impls, e.g. one printed `u32` while the other printed `U32`. Some compiler error messages rely on the former (yuk), and some clippy output depends on the latter. So the commit also changes clippy to not rely on `Debug` and just implement what it needs itself.
2025-03-20Use `-Wunused_crate_dependencies` for compiler crates.Nicholas Nethercote-2/+0
It's very useful. There are some false positives involving integration tests in `rustc_pattern_analysis` and `rustc_serialize`. There is also a false positive involving `rustc_driver_impl`'s `rustc_randomized_layouts` feature. And I removed a `rustc_span` mention in a doc comment in `rustc_log` because it wasn't integral to the comment but caused a dev-dependency.
2025-03-15Use {Decodable,Encodable}_NoContext in type_irMichael Goulet-4/+13
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-3/+1
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 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-0/+3
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-19Make fewer crates depend on rustc_ast_irMichael Goulet-0/+7
2024-10-07Add sugar for &pin (const|mut) typesEric Holk-0/+7
2024-08-16Add `warn(unreachable_pub)` to several crates.Nicholas Nethercote-0/+1
It requires no additonal changes to these crates, but will prevent unnecessary `pub`s in the future.
2024-07-15Use dep: for crate dependenciesMichael Goulet-4/+4
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-1/+3
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-10Remove some unused crate dependencies.Nicholas Nethercote-1/+0
I found these by setting the `unused_crate_dependencies` lint temporarily to `Warn`.
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-2/+1
2024-04-10introduce `Mutability::ptr_str`Kalle Wachsmuth-0/+8
2024-03-08Fix typo in `VisitorResult`Jason Newcomb-1/+1
2024-03-05Move visitor utils to `rustc_ast_ir`Jason Newcomb-0/+85
2024-02-27Split rustc_type_ir to avoid rustc_ast from depending on itOli Scherer-0/+90