summary refs log tree commit diff
path: root/compiler/rustc_interface/src/tests.rs
AgeCommit message (Collapse)AuthorLines
2024-12-19coverage: Add a synthetic test for when all spans are discardedZalathar-1/+5
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-06Rollup merge of #130777 - azhogin:azhogin/reg-struct-return, r=workingjubileeMatthias Krüger-0/+1
rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973) Command line flag `-Zreg-struct-return` for X86 (32-bit) for rust-for-linux. This flag enables the same behavior as the `abi_return_struct_as_int` target spec key. - Tracking issue: https://github.com/rust-lang/rust/issues/116973
2024-12-04Rollup merge of #133847 - nnethercote:rm-Z-show-span, r=compiler-errorsMatthias Krüger-1/+0
Remove `-Zshow-span`. It's very old (added in #12087). It's strange, and it's not clear what its use cases are. It only works with the crate root file because it runs before expansion. I suspect it won't be missed. r? `@estebank`
2024-12-04Remove `-Zshow-span`.Nicholas Nethercote-1/+0
It's very old (added in #12087). It's strange, and it's not clear what its use cases are. It only works with the crate root file because it runs before expansion. I suspect it won't be missed.
2024-12-03Auto merge of #104342 - mweber15:add_file_location_to_more_types, r=wesleywiserbors-0/+1
Require `type_map::stub` callers to supply file information This change attaches file information (`DIFile` reference and line number) to struct debug info nodes. Before: ``` ; foo.ll ... !5 = !DIFile(filename: "<unknown>", directory: "") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !5, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "4cb373851db92e732c4cb5651b886dd0") ... ``` After: ``` ; foo.ll ... !3 = !DIFile(filename: "foo.rs", directory: "/home/matt/src/rust98678", checksumkind: CSK_SHA1, checksum: "bcb9f08512c8f3b8181ef4726012bc6807bc9be4") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !3, line: 3, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "9e5968c7af39c148acb253912b7f409f") ... ``` Fixes #98678 r? `@wesleywiser`
2024-12-02rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973)Andrew Zhogin-0/+1
2024-11-29Rename `-Zparse-only`.Nicholas Nethercote-1/+1
I was surprised to find that running with `-Zparse-only` only parses the crate root file. Other files aren't parsed because that happens later during expansion. This commit renames the option and updates the help message to make this clearer.
2024-11-26Remove -Zfuel.Camille GILLOT-2/+0
2024-11-15Merge `-Zhir-stats` into `-Zinput-stats`Sam Estep-1/+0
2024-11-08Use a method to apply `RustcOptGroup` to `getopts::Options`Zalathar-1/+1
2024-11-06Rename option and add docMatt Weber-1/+1
2024-11-06Move additional source location info behind -Z optionMatt Weber-0/+1
2024-11-05Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwcoMatthias Krüger-1/+1
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-10-31rustc_codegen_llvm: Add a new 'pc' option to branch-protectionKajetan Puchalski-1/+1
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-2/+0
2024-10-18rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972)Andrew Zhogin-0/+1
2024-10-15stabilize `-Znext-solver=coherence`lcnr-1/+1
2024-10-01add unstable support for outputting file checksums for use in cargoJacob Kiesel-0/+2
2024-10-01Replace -Z default-hidden-visibility with -Z default-visibilityDavid Lattimore-1/+1
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-10/+10
2024-09-12Auto merge of #130249 - compiler-errors:sad-new-solver-coherence, r=lcnrbors-1/+1
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-11Revert 'Stabilize -Znext-solver=coherence'Michael Goulet-1/+1
2024-09-10Add -Z small-data-thresholdPaul Menage-0/+1
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-05stabilize `-Znext-solver=coherence`lcnr-1/+1
2024-08-30make `-Z mir-include-spans` a dedicated enumRémy Rakic-4/+5
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/+1
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/+1
2024-08-28fmt-debug optionKornel-5/+6
Allows disabling `fmt::Debug` derive and debug formatting.
2024-08-27Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwcoTrevor Gross-0/+1
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-08Split `ColorConfig` off of `HumanReadableErrorType`Esteban Küber-1/+2
The previous setup tied two unrelated things together. Splitting these two is a better model.
2024-07-29Add `-Z embed-source=yes` to embed source code in DWARF debug infoMrmaxmeier-0/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-21/+16
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-12Rollup merge of #126502 - cuviper:dump-mir-exclude-alloc-bytes, r=estebankJubilee-0/+1
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-1/+1
Since this codegen flag now only controls LLVM-generated comments rather than all assembly comments, make the name more accurate (and also match Clang).
2024-06-28Reduce merge conflicts from rustfmt's wrappingKornel-7/+15
2024-06-27Updated diagnostic messagesFlorian Schmiderer-1/+2
2024-06-26Add `-Zdump-mir-exclude-alloc-bytes`Josh Stone-0/+1
2024-06-25Updated code for changes to RFC, added additional error handling, addedFlorian Schmiderer-3/+6
tests
2024-06-25Support for -Z patchable-function-entryMatthew Maurer-0/+1
`-Z patchable-function-entry` works like `-fpatchable-function-entry` on clang/gcc. The arguments are total nop count and function offset. See MCP rust-lang/compiler-team#704
2024-06-23compiler(nfc): -Cforce-frame-pointers is a FramePointerJubilee Young-3/+3
2024-06-18Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwcobors-1/+1
Replace all `&DiagCtxt` with a `DiagCtxtHandle<'_>` wrapper type r? `@davidtwco` This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle Basically I will add a field to the `DiagCtxtHandle` that refers back to the `InferCtxt`'s (and others) `Option<ErrorHandled>`, allowing us to immediately taint these contexts when emitting an error and not needing manual tainting anymore (which is easy to forget and we don't do in general anyway)
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-1/+1
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-17coverage: Add debugging flag `-Zcoverage-options=no-mir-spans`Zalathar-1/+1
When set, this flag skips the code that normally extracts coverage spans from MIR statements and terminators. That sometimes makes it easier to debug branch coverage and MC/DC coverage, because the coverage output is less noisy. For internal debugging only. If other code changes would make it hard to keep supporting this flag, remove it.
2024-05-29Rollup merge of #124655 - Darksonn:fixed-x18, r=lqd,estebankMatthias Krüger-0/+1
Add `-Zfixed-x18` This PR is a follow-up to #124323 that proposes a different implementation. Please read the description of that PR for motivation. See the equivalent flag in [the clang docs](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-ffixed-x18). MCP: https://github.com/rust-lang/compiler-team/issues/748 Fixes https://github.com/rust-lang/rust/issues/121970 r? rust-lang/compiler
2024-05-24remove proof tree formatter, make em shallowlcnr-4/+1
2024-05-03Rollup merge of #124480 - Enselic:on-broken-pipe, r=jieyouxuMichael Goulet-1/+2
Change `SIGPIPE` ui from `#[unix_sigpipe = "..."]` to `-Zon-broken-pipe=...` In the stabilization [attempt](https://github.com/rust-lang/rust/pull/120832) of `#[unix_sigpipe = "sig_dfl"]`, a concern was [raised ](https://github.com/rust-lang/rust/pull/120832#issuecomment-2007394609) related to using a language attribute for the feature: Long term, we want `fn lang_start()` to be definable by any crate, not just libstd. Having a special language attribute in that case becomes awkward. So as a first step towards the next stabilization attempt, this PR changes the `#[unix_sigpipe = "..."]` attribute to a compiler flag `-Zon-broken-pipe=...` to remove that concern, since now the language is not "contaminated" by this feature. Another point was [also raised](https://github.com/rust-lang/rust/pull/120832#issuecomment-1987023484), namely that the ui should not leak **how** it does things, but rather what the **end effect** is. The new flag uses the proposed naming. This is of course something that can be iterated on further before stabilization. Tracking issue: https://github.com/rust-lang/rust/issues/97889
2024-05-03Add -Zfixed-x18Alice Ryhl-0/+1
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
2024-05-02Change `SIGPIPE` ui from `#[unix_sigpipe = "..."]` to `-Zon-broken-pipe=...`Martin Nordholts-1/+2
In the stabilization attempt of `#[unix_sigpipe = "sig_dfl"]`, a concern was raised related to using a language attribute for the feature: Long term, we want `fn lang_start()` to be definable by any crate, not just libstd. Having a special language attribute in that case becomes awkward. So as a first step towards towards the next stabilization attempt, this PR changes the `#[unix_sigpipe = "..."]` attribute to a compiler flag `-Zon-broken-pipe=...` to remove that concern, since now the language is not "contaminated" by this feature. Another point was also raised, namely that the ui should not leak **how** it does things, but rather what the **end effect** is. The new flag uses the proposed naming. This is of course something that can be iterated on further before stabilization.
2024-04-29coverage: Replace boolean options with a `CoverageLevel` enumZalathar-7/+7