organize and extend forbidden target feature tests#140395
organize and extend forbidden target feature tests#140395bors merged 3 commits intorust-lang:masterfrom
Conversation
|
rustbot has assigned @petrochenkov. Use |
This comment has been minimized.
This comment has been minimized.
|
r=me with tidy fixed. |
|
Reminder, once the PR becomes ready for a review, use |
1b9008f to
240cc10
Compare
This comment has been minimized.
This comment has been minimized.
| | | ||
| = note: this feature is not stably supported; its behavior can change in the future | ||
|
|
||
| warning: both target-abi and the triple-implied ABI are invalid, ignoring and using feature-implied ABI |
There was a problem hiding this comment.
@heiher any idea what this warning is about? Does it come from LLVM?
For riscv it says
Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi)
which is a lot more clear. Is this trying to say the same thing?
There was a problem hiding this comment.
Yes, they are quite similar. The LoongArch backend attempts to compute the ABI based on the target-abi and triple-name. If there’s a conflict between the resulting ABI and the target features, the final ABI will be determined by the target features.
Fore more details:
There was a problem hiding this comment.
Okay. I find the LoongArch error quite unclear compared to the RISC-V error... but anyway it should be impossible to trigger this warning from rustc without also triggering "target feature d must be enabled to ensure that the ABI of the current target can be implemented correctly" so users will hopefully understand what the problem is.
|
So somehow on CI we get a bunch of extra warnings: I don't get those when running the test locally. Is that an LLVM version thing? Does |
Thank you for everything you've done. IIRC, when the LLVM backend doesn't support target features listed in Would it be possible to add a diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
index 02841b6690a..5b0d7b7b252 100644
--- a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
@@ -12,6 +12,7 @@
//@[riscv] needs-llvm-components: riscv
//@[loongarch] compile-flags: --target=loongarch64-unknown-none -Ctarget-feature=-d
//@[loongarch] needs-llvm-components: loongarch
+//@[loongarch] min-llvm-version: 20
// For now this is just a warning.
//@ build-passIt would also be useful for the warning: |
I'm surprised by this. I thought the warning should should only show up when the target feature is actually used, but I did a quick test and you are right. I hope these warnings do not show up on stable? We may have to come up with a better way to deal with target features that are not supported by all of the LLVM versions we support, the current approach feels fragile.
I don't think so, that warning appears consistently for all LLVM versions it seems (so it's not a problem). |
This comment has been minimized.
This comment has been minimized.
|
Oh I see what you mean, that RISCV error didn't yet show in LLVM 19. |
f78cc1b to
5b7e669
Compare
|
@bors r=petrochenkov |
…etrochenkov organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.
Rollup of 6 pull requests Successful merges: - rust-lang#139883 (crashes: more tests) - rust-lang#140312 (Improve pretty-printing of braces) - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6) - rust-lang#140432 (Update documentation for `fn target_config`) r? `@ghost` `@rustbot` modify labels: rollup
…etrochenkov organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc ``@heiher`` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.
Rollup of 14 pull requests Successful merges: - rust-lang#140380 (transmutability: uninit transition matches unit byte only) - rust-lang#140385 (Subtree update of `rust-analyzer`) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140430 (Improve test coverage of HIR pretty printing.) - rust-lang#140458 (Fix for async drop ice with partly dropped tuple) - rust-lang#140460 (Fix handling of LoongArch target features not supported by LLVM 19) - rust-lang#140465 (chore: edit and move tests) - rust-lang#140467 (Don't FCW assoc consts in patterns) - rust-lang#140468 (Minor tweaks to make some normalization (adjacent) code less confusing) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) - rust-lang#140486 (rustfmt: Also allow bool literals as first item of let chain) - rust-lang#140494 (Parser: Document restrictions) r? `@ghost` `@rustbot` modify labels: rollup
…etrochenkov organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc ```@heiher``` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.
organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help. try-job: `x86_64-gnu-llvm-*`
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
In my experience you can't suppress error output from LLVM, no, but that's just experience from a long time ago. No idea if they maybe changed things up for LLVM 20+ |
|
I don't know why there would be a behavior difference between Rust's and Ubuntu's LLVM here. How does rust intercept LLVM's stderr stream to produce these as warnings? |
So these CI runners use the Ubuntu LLVM? Maybe they applied some patches...?
Does it do that? I thought this is just LLVM printing directly to stderr. The warnings do not show up in rustc's warning count, for instance. |
Oh, I saw the |
|
My best guess is that with these warnings being emitted in the backend, there might be some kind of threading interaction? |
|
Well, I think I'll just try to normalize them away. |
e90dafa to
6873a46
Compare
|
@bors try |
organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help. try-job: `x86_64-gnu-llvm-20-*`
|
☀️ Try build successful - checks-actions |
|
@bors r=petrochenkov |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#138712 (resolve: Support imports of associated types and glob imports from traits) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140576 (Remove fragile equal-pointers-unequal tests.) - rust-lang#140582 (Update sysinfo to `0.35.0` in bootstrap and `tools/opt-dist`) - rust-lang#140595 (doc(std): fix typo lchown -> lchmod) - rust-lang#140597 (zkvm: remove schmerik as target maintainer) - rust-lang#140604 (yet another small borrowck cleanup ) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140395 - RalfJung:target-feature-tests, r=petrochenkov organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help. try-job: `x86_64-gnu-llvm-20-*`
In particular this adds some loongarch tests for #135015, Cc @heiher
Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.
try-job:
x86_64-gnu-llvm-20-*