diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-11 13:48:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-11 13:48:11 +0200 |
| commit | 57bb38b836cc3506f2e02c37b046321420ab0618 (patch) | |
| tree | aa04fc096df3eda77d0733faf9e55a03458c6328 /compiler/rustc_codegen_gcc/src/errors.rs | |
| parent | 407e568381bcddb322dc79653224a5602cd1e1cc (diff) | |
| parent | c558db34dc4ad66236d09ba7a2101a4c6b8cacd5 (diff) | |
| download | rust-57bb38b836cc3506f2e02c37b046321420ab0618.tar.gz rust-57bb38b836cc3506f2e02c37b046321420ab0618.zip | |
Rollup merge of #142297 - jieyouxu:needs-target-std, r=Kobzol
Implement `//@ needs-target-std` compiletest directive Closes rust-lang/rust#141863. Needed to unblock rust-lang/rust#139244 and rust-lang/rust#141856. ### Summary This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit]. ### Implementation limitation Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](https://github.com/rust-lang/rust/issues/142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`. ### Auxiliary changes This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang/rust#139244. --- r? bootstrap [^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
