about summary refs log tree commit diff
path: root/compiler/rustc_session/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-3/+0
2024-09-27Rollup merge of #129087 - slanterns:option_get_or_insert_default, r=dtolnayMatthias Krüger-1/+0
Stabilize `option_get_or_insert_default` Closes: https://github.com/rust-lang/rust/issues/82901. `@rustbot` label: +T-libs-api r? libs-api
2024-09-03Add `warn(unreachable_pub)` to `rustc_session`.Nicholas Nethercote-0/+1
2024-08-14stabilize `option_get_or_insert_default`Slanterns-1/+0
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-3/+5
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-02-20Stabilize `LazyCell` and `LazyLock` (`lazy_cell`)Peter Jaszkowiak-1/+0
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-2/+0
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-02-15Use generic `NonZero` internally.Markus Reiter-0/+1
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-03rustc_session: Address all `rustc::potential_query_instability` lintsMartin Nordholts-1/+0
Instead of allowing `rustc::potential_query_instability` on the whole crate we go over each lint and allow it individually if it is safe to do. Turns out all instances were safe to allow in this crate.
2023-11-30Remove unused features.Nicholas Nethercote-2/+0
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-3/+1
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-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
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-10-26Parse rustc version at compile timeDavid Tolnay-0/+3
2023-10-13Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillotbors-1/+0
Remove cgu_reuse_tracker from Session This removes a bit of global mutable state. It will now miss post-lto cgu reuse when ThinLTO determines that a cgu doesn't get changed, but there weren't any tests for this anyway and a test for it would be fragile to the exact implementation of ThinLTO in LLVM.
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-1/+0
This removes a bit of global mutable state
2023-10-08consistency check for self-contained linking components CLI optionsRémy Rakic-0/+1
emit an error if components are both enabled and disabled on the CLI
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-06-12Collect VTable stats & add `-Zprint-vtable-sizes`Maybe Waffle-1/+1
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
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-03-29Stabilize a portion of 'once_cell'Trevor Gross-1/+1
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-11Simplify message pathsest31-1/+1
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-02-22errors: generate typed identifiers in each crateDavid Wood-0/+5
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>
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-09-10translations(rustc_session): migrate output.rsLuis Cardoso-0/+2
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-0/+3
by module
2022-08-31Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-session, ↵Ralf Jung-0/+1
r=davidtwco translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1 ## Description This is the first PR for the migration of the module `rustc_session`. You can follow my progress [here](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883). The PR migrates the files `cgu_reuse_tracker` and `parse.rs` to use `SessionDiagnostic `.
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-26translations(rustc_session): migrate 80% of the file parse.rsLuis Cardoso-2/+0
This commit migrates around 80% of the parse file to use SsessionDiagnostic We still have to migrate struct_err and struct_warn.
2022-08-26translations(rustc_session): migrate the file cgu_reuse_trackerLuis Cardoso-0/+3
This commit migrates the errors that indicates an incorrect CGU type and the fatal error that indicates that a CGU has not been correctly recorded
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-01update cfg(bootstrap)sPietro Albini-1/+1
2022-06-15Use get_many_mut to reduce the cost of setup ping check cfg valuesUrgau-0/+1
2022-06-10lint: add diagnostic translation migration lintsDavid Wood-0/+1
Introduce allow-by-default lints for checking whether diagnostics are written in `SessionDiagnostic`/`AddSubdiagnostic` impls and whether diagnostics are translatable. These lints can be denied for modules once they are fully migrated to impls and translation. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-27Finish bumping stage0Mark Rousskov-1/+0
It looks like the last time had left some remaining cfg's -- which made me think that the stage0 bump was actually successful. This brings us to a released 1.62 beta though.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+0
2022-04-07Stabilize `derive_default_enum`Jacob Pratt-1/+1
2022-04-02ast_lowering: Stop wrapping `ident` matchers into groupsVadim Petrochenkov-0/+1
The lowered forms goes to metadata, for example during encoding of macro definitions
2022-03-27Make fatal DiagnosticBuilder yield neverMichael Goulet-0/+1
2022-03-24Use a let-chain in _session::output (nfc)Jubilee Young-0/+1
2022-02-26Auto merge of #93516 - nagisa:branch-protection, r=cjgillotbors-0/+1
No branch protection metadata unless enabled Even if we emit metadata disabling branch protection, this metadata may conflict with other modules (e.g. during LTO) that have different branch protection metadata set. This is an unstable flag and feature, so ideally the flag not being specified should act as if the feature wasn't implemented in the first place. Additionally this PR also ensures we emit an error if `-Zbranch-protection` is set on targets other than the supported aarch64. For now the error is being output from codegen, but ideally it should be moved to earlier in the pipeline before stabilization.
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-19Adopt let else in more placesest31-0/+1
2022-02-19No branch protection metadata unless enabledSimonas Kazlauskas-0/+1
Even if we emit metadata disabling branch protection, this metadata may conflict with other modules (e.g. during LTO) that have different branch protection metadata set. This is an unstable flag and feature, so ideally the flag not being specified should act as if the feature wasn't implemented in the first place. Additionally this PR also ensures we emit an error if `-Zbranch-protection` is set on targets other than the supported aarch64. For now the error is being output from codegen, but ideally it should be moved to earlier in the pipeline before stabilization.