about summary refs log tree commit diff
path: root/compiler/rustc_session/src/options.rs
AgeCommit message (Collapse)AuthorLines
2024-11-22Rollup merge of #133159 - Zalathar:unstable-options-no-value, r=jieyouxuMichael Goulet-19/+29
Don't allow `-Zunstable-options` to take a value Passing an explicit boolean value (`-Zunstable-options=on`, `off` etc.) sometimes appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed. This is a result of `-Zunstable-options` being checked in multiple different places, in slightly different ways. Fixing the checks in `config::nightly_options` to understand boolean values would be non-trivial, so for now it's easier to make things consistent by forbidding values in the `-Z` parser. --- There were a few uses of this in tests, which happened to work because they were tests of unstable values.
2024-11-21Rollup merge of #130236 - yaahc:unstable-feature-usage, r=estebankMatthias KrΓΌger-1/+1
unstable feature usage metrics example output ``` test-lib on ξ‚  master [?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.80.1 ❯ cat src/lib.rs ───────┬─────────────────────────────────────────────────────── β”‚ File: src/lib.rs ───────┼─────────────────────────────────────────────────────── 1 β”‚ #![feature(unix_set_mark)] 2 β”‚ pub fn add(left: u64, right: u64) -> u64 { 3 β”‚ left + right 4 β”‚ } 5 β”‚ 6 β”‚ #[cfg(test)] 7 β”‚ mod tests { 8 β”‚ use super::*; 9 β”‚ 10 β”‚ #[test] 11 β”‚ fn it_works() { 12 β”‚ let result = add(2, 2); 13 β”‚ assert_eq!(result, 4); 14 β”‚ } 15 β”‚ } ───────┴─────────────────────────────────────────────────────── test-lib on ξ‚  master [?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.80.1 ❯ cargo +stage1 rustc -- -Zmetrics-dir=$PWD/metrics Compiling test-lib v0.1.0 (/home/yaahc/tmp/test-lib) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s test-lib on ξ‚  master [?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.80.1 ❯ cat metrics/unstable_feature_usage.json ───────┬───────────────────────────────────────────────────────────────────── β”‚ File: metrics/unstable_feature_usage.json ───────┼───────────────────────────────────────────────────────────────────── 1 β”‚ {"lib_features":[{"symbol":"unix_set_mark"}],"lang_features":[]} ``` related to https://github.com/rust-lang/rust/issues/129485
2024-11-20unstable feature usage metricsJane Losare-Lusby-1/+1
2024-11-18Don't allow `-Zunstable-options` to take a valueZalathar-1/+7
Passing an explicit boolean value (`on`, `off` etc.) appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed.
2024-11-18Rename `parse_no_flag` to `parse_no_value`Zalathar-18/+22
The old name and comment suggest that this parser is only used for options beginning with `no-`, which is mostly true but not entirely true.
2024-11-15Merge `-Zhir-stats` into `-Zinput-stats`Sam Estep-3/+1
2024-11-10Fix error message for direct usage of sess.opts.crate_typesbjorn3-1/+1
2024-11-06Rename option and add docMatt Weber-2/+2
2024-11-06Move additional source location info behind -Z optionMatt Weber-0/+2
2024-11-05Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwcoMatthias KrΓΌger-3/+6
rustc_codegen_llvm: Add a new 'pc' option to branch-protection Add a new 'pc' option to -Z branch-protection for aarch64 that enables the use of PC as a diversifier in PAC branch protection code. When the pauth-lr target feature is enabled in combination with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions (pacibsppc, retaasppc, etc) will be generated.
2024-11-04Rollup merge of #132355 - practicalrs:fix_117638, r=SparrowLiiMatthias KrΓΌger-3/+8
Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here https://github.com/rust-lang/rust/issues/117638 using the solution suggested in this comment https://github.com/rust-lang/rust/issues/117638#issuecomment-1800925067 Best regards, Michal
2024-11-03Rollup merge of #132522 - senekor:consistenst-codegen-help, r=compiler-errorsMatthias KrΓΌger-1/+1
make codegen help output more consistent The output of `rustc -C help` generally has one option per line. There was one exception because of a (presumably) forgotten line continuation escape.
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-2/+2
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-11-02make codegen help output more consistentRemo Senekowitsch-1/+1
The output of `rustc -C help` generally has one option per line. There was one exception because of a (presumably) forgotten line continuation escape.
2024-11-01Fix compiler panic with a large number of threadsMichal Piotrowski-3/+8
2024-10-31rustc_codegen_llvm: Add a new 'pc' option to branch-protectionKajetan Puchalski-3/+6
Add a new 'pc' option to -Z branch-protection for aarch64 that enables the use of PC as a diversifier in PAC branch protection code. When the pauth-lr target feature is enabled in combination with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions (pacibsppc, retaasppc, etc) will be generated.
2024-10-31Remove support for `-Zprofile` (gcov-style coverage instrumentation)Zalathar-5/+0
2024-10-20Limited -Zregparm support (no Rust calling conv) descriptionsAndrew Zhogin-1/+2
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2024-10-18rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972)Andrew Zhogin-0/+4
2024-10-15stabilize `-Znext-solver=coherence`lcnr-21/+10
2024-10-01improve shell help textJacob Kiesel-1/+2
2024-10-01disregard what we believe is supported in cargo for hash typeJacob Kiesel-5/+1
2024-10-01Fix options help textJacob Kiesel-1/+1
2024-10-01add unstable support for outputting file checksums for use in cargoJacob Kiesel-1/+21
2024-10-01Replace -Z default-hidden-visibility with -Z default-visibilityDavid Lattimore-4/+20
MCP: https://github.com/rust-lang/compiler-team/issues/782 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-15Rollup merge of #129897 - RalfJung:soft-float-ignored, r=UrgauMatthias KrΓΌger-1/+4
deprecate -Csoft-float because it is unsound (and not fixable) See https://github.com/rust-lang/rust/issues/129893 for details. The general sentiment there seems to be that this flag has no use and sound alternatives exist, so let's add this warning and see if anyone out there disagrees. Also show a different warning on targets where it does nothing (as documented since https://github.com/rust-lang/rust/pull/36261): it seems to correspond to `-mfloat-abi` in GCC/clang, which is an ARM-specific option. To be really sure it does nothing, only forward the flag to LLVM for eabihf targets. This should not change behavior but makes me sleep better ;)
2024-09-12Auto merge of #130249 - compiler-errors:sad-new-solver-coherence, r=lcnrbors-10/+21
Revert "Stabilize `-Znext-solver=coherence`" This is a clean revert of #121848, prepared by running: ``` $ git revert 17b322fa69eed7216dccc9f097eb68237cf62234 -m1 ``` Which effectively reverts: * a138a9261536ac2bdbb7c01a8aa9dc7d43299cae, 69fdd1457d367ce4de044e9784e58a38acf3d847, d93e047c9f1b33892a604273ab3931815f5604a1, 1a893ac648e03732aaa8b5371b602ab683970b0d see: https://rust-lang.zulipchat.com/#narrow/stream/364551-t-types.2Ftrait-system-refactor/topic/nalgebra.20hang Closes #130056 r? lcnr
2024-09-12Auto merge of #117465 - paulmenage:small-data-limit, r=compiler-errorsbors-0/+2
Add -Z small-data-threshold This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a `.sdata` or `.sbss` section. Support is indicated in the target options via the small-data-threshold-support target option, which can indicate either an LLVM argument or an LLVM module flag. To avoid duplicate specifications in a large number of targets, the default value for support is DefaultForArch, which is translated to a concrete value according to the target's architecture.
2024-09-11Revert 'Stabilize -Znext-solver=coherence'Michael Goulet-10/+21
2024-09-10Add -Z small-data-thresholdPaul Menage-0/+2
This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a .sdata or .sbss section. Support is indicated in the target options via the small-data-threshold-support target option, which can indicate either an LLVM argument or an LLVM module flag. To avoid duplicate specifications in a large number of targets, the default value for support is DefaultForArch, which is translated to a concrete value according to the target's architecture.
2024-09-09Remove needless returns detected by clippy in the compilerEduardo SΓ‘nchez MuΓ±oz-1/+1
2024-09-05stabilize `-Znext-solver=coherence`lcnr-21/+10
2024-09-03add rustc_lint_opt_deny_field_access to options that are documented to do ↡Ralf Jung-0/+3
nothing
2024-09-03deprecate -Csoft-float because it is unsound (and not fixable)Ralf Jung-1/+1
2024-09-03Add `warn(unreachable_pub)` to `rustc_session`.Nicholas Nethercote-69/+73
2024-08-30make `-Z mir-include-spans` a dedicated enumRΓ©my Rakic-2/+16
We want to allow setting this on the CLI, override it only in MIR passes, and disable it altogether in mir-opt tests. The default value is "only for NLL MIR dumps", which is considered off for all intents and purposes, except for `rustc_borrowck` when an NLL MIR dump is requested.
2024-08-29Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikicGuillaume Gomez-0/+2
Add `-Zlint-llvm-ir` This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR. r? compiler
2024-08-29Add `-Zlint-llvm-ir`DianQK-0/+2
2024-08-28fmt-debug optionKornel-0/+14
Allows disabling `fmt::Debug` derive and debug formatting.
2024-08-27Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwcoTrevor Gross-0/+2
Implement `-Z embed-source` (DWARFv5 source code embedding extension) Implement https://github.com/rust-lang/compiler-team/issues/764 MCP which adds an unstable flag that exposes LLVM's [DWARFv5 source code embedding](https://dwarfstd.org/issues/180201.1.html) support.
2024-08-11Rollup merge of #128762 - fmease:use-more-slice-pats, r=compiler-errorsMatthias KrΓΌger-10/+3
Use more slice patterns inside the compiler Nothing super noteworthy. Just replacing the common 'fragile' pattern of "length check followed by indexing or unwrap" with slice patterns for legibility and 'robustness'. r? ghost
2024-08-07Add -Zerror-metrics=PATH to save diagnostic metadata to diskJane Losare-Lusby-0/+2
2024-08-07Use more slice patterns inside the compilerLeΓ³n Orell Valerian Liehr-10/+3
2024-07-29Add `-Z embed-source=yes` to embed source code in DWARF debug infoMrmaxmeier-0/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-14/+15
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-14Auto merge of #127670 - compiler-errors:no-type-length-limit, r=jackh726bors-0/+2
Gate the type length limit check behind a nightly flag Effectively disables the type length limit by introducing a `-Zenforce-type-length-limit` which defaults to **`false`**, since making the length limit actually be enforced ended up having a worse fallout than expected. We still keep the code around, but the type length limit attr is now a noop (except for its usage in some diagnostics code?). r? `@lcnr` -- up to you to decide what team consensus we need here since this reverses an FCP decision. Reopens #125460 (if we decide to reopen it or keep it closed) Effectively reverses the decision FCP'd in #125507 Closes #127346
2024-07-12Gate the type length limit check behind a nightly flagMichael Goulet-0/+2
2024-07-12Rollup merge of #126502 - cuviper:dump-mir-exclude-alloc-bytes, r=estebankJubilee-0/+2
Ignore allocation bytes in some mir-opt tests This adds `rustc -Zdump-mir-exclude-alloc-bytes` to skip writing allocation bytes in MIR dumps, and applies it to tests that were failing on s390x due to its big-endian byte order. Fixes #126261
2024-07-02Rename the `asm-comments` compiler flag to `verbose-asm`Trevor Gross-2/+2
Since this codegen flag now only controls LLVM-generated comments rather than all assembly comments, make the name more accurate (and also match Clang).