about summary refs log tree commit diff
path: root/compiler/rustc_target/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-09-19generate list of all variants with `target_spec_enum`Deadbeef-11/+12
This helps us avoid the hardcoded lists elsewhere.
2025-09-12Add --print target-spec-json-schemaNoratrieb-0/+2
This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.
2025-09-12Introduce `target_spec_enum` macro to avoid duplicationNoratrieb-0/+60
With this macro we only need to enumerate every variant once. This saves a lot of duplication already between the definition, the `FromStr` impl and the `ToJson` impl. It also enables us to do further things with it like JSON schema generation.
2025-06-08Remove all unused feature gates from the compilerbjorn3-2/+0
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-04refactor: Move Apple OSVersion (back) to rustc_targetMads Marquart-0/+1
Also convert OSVersion into a proper struct for better type-safety.
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)-0/+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-02-11compiler: remove rustc_target reexport of rustc_abi::HashStableContextJubilee Young-1/+1
The last public reexport of rustc_abi in rustc_target is finally gone.
2025-02-07compiler: remove rustc_target::abi entirelyJubilee Young-6/+0
2025-02-06compiler: make rustc_target have less weird reexportsJubilee Young-4/+1
rustc_target has had a lot of weird reexports for various reasons, but now we're at a point where we can actually start reducing their number. We remove weird shadowing-dependent behavior and import directly from rustc_abi instead of doing weird renaming imports. This is only incremental progress and does not entirely fix the crate.
2024-10-11compiler: Wire `{TyAnd,}Layout` into `rustc_abi`Jubilee Young-1/+10
This finally unites TyAndLayout, Layout, and LayoutS into the same crate, as one might imagine they would be placed. No functional changes.
2024-09-05update cfgsBoxy-1/+0
2024-09-03Add `warn(unreachable_pub)` to `rustc_target`.Nicholas Nethercote-0/+1
2024-08-10Update std and compilerNadrieril-1/+1
2024-06-06Improve naming and path operations in crate loaderNilstrieb-8/+4
Simplify the path operation with `join`, clarify some of the names.
2024-05-08Remove unused `step_trait` feature.Nicholas Nethercote-4/+5
Also sort the features.
2024-04-30Remove `extern crate tracing` from numerous crates.Nicholas Nethercote-3/+0
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-3/+0
2024-03-20step cfgsMark Rousskov-3/+1
2024-02-13Prefer `min_exhaustive_patterns` in compilerNadrieril-1/+2
2024-02-10Remove unnecessary `min_specialization` after bootstrapZalathar-1/+1
These crates all needed specialization for `newtype_index!`, which will no longer be necessary when the current nightly eventually becomes the next bootstrap compiler.
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
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-01-25Remove unused featuresclubby789-2/+0
2023-12-14Move rustc_codegen_ssa target features to rustc_targetUrgau-0/+1
2023-11-15Bump cfg(bootstrap)sMark Rousskov-2/+2
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+2
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-07-10i686-windows: pass arguments with requested alignment > 4 indirectlyErik Desjardins-0/+1
2023-05-29linker: Report linker flavors incompatible with the current targetVadim Petrochenkov-0/+1
Previously they would be reported as link time errors about unknown linker options
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-15/+8
2022-11-24make rustc_target usable outside of rustchkalbasi-7/+11
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
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-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-06-25rustc_target: Some more tests and fixes for linker argumentsVadim Petrochenkov-0/+1
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-06-03Use serde_json for target spec jsonbjorn3-0/+1
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-03-07Clarify `Layout` interning.Nicholas Nethercote-4/+5
`Layout` is another type that is sometimes interned, sometimes not, and we always use references to refer to it so we can't take any advantage of the uniqueness properties for hashing or equality checks. This commit renames `Layout` as `LayoutS`, and then introduces a new `Layout` that is a newtype around an `Interned<LayoutS>`. It also interns more layouts than before. Previously layouts within layouts (via the `variants` field) were never interned, but now they are. Hence the lifetime on the new `Layout` type. Unlike other interned types, these ones are in `rustc_target` instead of `rustc_middle`. This reflects the existing structure of the code, which does layout-specific stuff in `rustc_target` while `TyAndLayout` is generic over the `Ty`, allowing the type-specific stuff to occur in `rustc_middle`. The commit also adds a `HashStable` impl for `Interned`, which was needed. It hashes the contents, unlike the `Hash` impl which hashes the pointer.
2022-02-19Adopt let else in more placesest31-0/+1
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-2/+2
2021-10-02Remove various unused feature gatesbjorn3-1/+0
2021-08-25use undef for uninitialized bytes in constantsErik Desjardins-0/+2
2021-06-17Emit warnings for unused fields in custom targets.Adam Bratschi-Kaye-0/+3
2021-05-31Remove unused feature gatesbjorn3-2/+0