about summary refs log tree commit diff
path: root/compiler/rustc_index_macros
AgeCommit message (Collapse)AuthorLines
2025-09-02Revert introduction of `[workspace.dependencies]`.Nicholas Nethercote-2/+2
This was done in #145740 and #145947. It is causing problems for people using r-a on anything that uses the rustc-dev rustup package, e.g. Miri, clippy. This repository has lots of submodules and subtrees and various different projects are carved out of pieces of it. It seems like `[workspace.dependencies]` will just be more trouble than it's worth.
2025-08-28Add `proc-macro2` and `quote` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-07-31Tidy up `Cargo.toml` files.Nicholas Nethercote-1/+6
- Add some missing `tidy-alphabetical-*` markers. - Remove some unnecessary blank lines.
2025-04-12In `rustc_mir_tranform`, iterate over index newtypes instead of intsYotam Ofek-0/+7
2025-03-11Add `unreachable_pub` to `RUSTC_LINT_FLAGS` for `compiler/` crates.Nicholas Nethercote-1/+1
And fix the new errors in the handful of crates that didn't have a `#![warn(unreachable_pub)]`.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-4/+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-08Add `unreachable_pub` to the default lints for `compiler/` crates.Nicholas Nethercote-1/+1
And fix the new errors in the handful of crates that didn't have a `#![warn(unreachable_pub)]`.
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
2024-12-19update `rustc_index_macros` feature handlingonur-ozkan-1/+0
It seems that cargo can't conditionally propagate features when `default-features` is set to `false`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-22Auto merge of #130867 - michirakara:steps_between, r=dtolnaybors-1/+1
distinguish overflow and unimplemented in Step::steps_between
2024-11-21distinguish overflow and unimplemented in Step::steps_betweenmichirakara-1/+1
2024-10-14Remove `'apostrophes'` from `rustc_parse_format`Lieselotte-1/+1
2024-06-30Remove usage of specialization from newtype_index!bjorn3-8/+1
2024-06-16rustc_span: Minor improvementsVadim Petrochenkov-0/+15
Introduce `{IndexNewtype,SyntaxContext}::from_u16` for convenience because small indices are sometimes encoded as `u16`. Use `SpanData::span` instead of `Span::new` where appropriate. Add a clarifying comment about decoding span parents.
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-2/+1
I found these by setting the `unused_crate_dependencies` lint temporarily to `Warn`.
2024-04-03rustc_index: Add a `ZERO` constant to index typesVadim Petrochenkov-0/+3
It is commonly used.
2024-03-19Remove `SpecOptionPartialEq`clubby789-35/+1
2024-02-08Step all bootstrap cfgs forwardMark Rousskov-7/+7
This also takes care of other bootstrap-related changes.
2024-01-19Restrict access to the private field of newtype indexesOli Scherer-5/+5
2024-01-15Rollup merge of #119963 - clubby789:spec-allow-internal-unstable, ↵Matthias Krüger-0/+3
r=compiler-errors Fix `allow_internal_unstable` for `(min_)specialization` Fixes #119950 Blocked on #119949 (comment doesn't make sense until that merges) I'd like to follow this up and look for more instances of not properly checking spans for features but I wanted to fix the motivating issue.
2024-01-14Rollup merge of #119960 - cjgillot:inline-dg, r=WaffleLapkinGuillaume Gomez-0/+1
Inline 2 functions that appear in dep-graph profiles. Those functions are small enough not to deserve a dedicated symbol.
2024-01-14`allow_internal_unstable(min_specialization)` on `newtype_index`clubby789-0/+3
2024-01-14Inline 2 functions that appear in dep-graph profiles.Camille GILLOT-0/+1
2024-01-14Add note on SpecOptionPartialEq to `newtype_index`clubby789-0/+3
2023-11-27Put backticks around some attributes in doc comments.Nicholas Nethercote-6/+6
Without backticks they cause some "unresolved link to `foo`" warnings.
2023-11-22Document `newtype_index` attributes.Nicholas Nethercote-2/+13
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-3/+3
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-22Replace `custom_encodable` with `encodable`.Nicholas Nethercote-3/+3
By default, `newtype_index!` types get a default `Encodable`/`Decodable` impl. You can opt out of this with `custom_encodable`. Opting out is the opposite to how Rust normally works with autogenerated (derived) impls. This commit inverts the behaviour, replacing `custom_encodable` with `encodable` which opts into the default `Encodable`/`Decodable` impl. Only 23 of the 59 `newtype_index!` occurrences need `encodable`. Even better, there were eight crates with a dependency on `rustc_serialize` just from unused default `Encodable`/`Decodable` impls. This commit removes that dependency from those eight crates.
2023-11-18Begin nightly-ifying rustc_type_irMichael Goulet-0/+371