Commit Graph

20 Commits

Author SHA1 Message Date
Noratrieb
f157ce994e Add --print target-spec-json-schema
This schema is helpful for people writing custom target spec JSON. It
can provide autocomplete in the editor, and also serves as documentation
when there are documentation comments on the structs, as `schemars` will
put them in the schema.
2025-09-12 20:53:28 +02:00
Jens Reidel
d1a146bbbb tests: Skip supported-crate-types test on musl hosts
This test depends on the target-specific behavior of crt-static for musl
targets. However, running the testsuite on a musl host requires
setting `crt-static` to `false`, as it wouldn't otherwise be possible to
build rustc. This in turn will enable `-Ctarget-feature=-crt-static` for
all tests, mismatching the expected `+crt-static` for the musl target
tested in this testcase.

Since this test specifically tests the default value of `crt-static` for
the musl target, ignoring it entirely makes more sense than manually
setting `-Ctarget-feature=+crt-static` here, but both would be valid
approaches.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 19:05:32 +02:00
Kivooeo
b28806da23 cleaned up some tests 2025-07-05 00:45:24 +05:00
Kivooeo
986f1c9b69 moved tests 2025-07-01 18:21:05 +05:00
Jubilee Young
7b29a5d282 Revert overeager warning for misuse of --print native-static-libs
In a PR to emit warnings on misuse of `--print native-static-libs`,
we did not consider the matter of composing parts of build systems.
If you are not directly invoking rustc, it can be difficult to know
when you will in fact compile a staticlib, so making sure everyone
uses `--print native-static-lib` correctly can be just a nuisance.

This reverts the following commits:
- f66787a08d
- 72a9219e82
- 98bb597c05
- c59b70841c

Next cycle we can reland a slightly more narrowly focused variant or one
that focuses on `--emit` instead of `--print native-static-libs`.
But in its current state, I am not sure the warning is very useful.
2025-06-16 12:43:36 -07:00
xizheyin
72a9219e82 check all crate-type to find staticlib
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-02 22:57:14 +08:00
xizheyin
c59b70841c Emit warning while outputs is not exe and prints linkage info
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-02 22:08:58 +08:00
Vadim Petrochenkov
93bee0789a UI tests: migrate remaining compile time error-patterns to line annotations
when possible.
2025-04-13 21:48:53 +03:00
Vadim Petrochenkov
4916d44b59 Fix up tests on wasm and msvc, and rebase conflicts
Can be fixed properly later by adding a new flag for non-exhaustive line annotation checking
2025-04-03 11:08:55 +03:00
Vadim Petrochenkov
4d64990690 compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
Takayuki Maeda
eb23a597c8 Rollup merge of #139184 - Urgau:crate-root-lint-levels, r=jieyouxu
Add unstable `--print=crate-root-lint-levels`

This PR implements `--print=crate-root-lint-levels` from MCP 833 https://github.com/rust-lang/compiler-team/issues/833.

Tracking issue: https://github.com/rust-lang/rust/issues/139180

Best reviewed commit by commit.
2025-04-02 22:52:45 +09:00
Urgau
df18de57a5 Add unstable --print=crate-root-lint-levels 2025-04-01 18:29:39 +02:00
Vadim Petrochenkov
8d5109aa6e compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
Jieyou Xu
f2cde8eeb4 Adjust rustc-print-info-issue-138612.rs
- Document test intent to check for `-Whelp` suggestion if
  `--print=lints` was specified.
- Move this test under `tests/ui/print-request/` and rename it to
  `print-lints-help.rs` to better reflect what it is checking.
2025-03-23 19:08:56 +08:00
Jieyou Xu
0e7dbab1fc Implement supported-crate-types print request
As an unstable print request.
2025-03-23 19:08:54 +08:00
Jieyou Xu
ab7fb0d483 Add a centralized test for print request stability gating
I can't find any dedicated tests that actually exercises the stability
gating (via `-Z unstable-options`) of print requests, so here's a
dedicated one.

I coalesced `tests/ui/feature-gates/feature-gate-print-check-cfg.rs`
into this test, because AFAICT that print request is not feature gated,
but only `-Z unstable-options`-gated just like other unstable print
requests.
2025-03-16 21:56:01 +08:00
Zalathar
835fbcbcab Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
Mads Marquart
431c500c60 Print env var in --print=deployment-target
The deployment target environment variable is OS-specific, and if you're
in a place where you're asking `rustc` for the deployment target, you're
likely to also wanna know the environment variable.
2024-11-22 20:46:05 +01:00
Noratrieb
ba481518da Add --print host-triple
People often parse `-vV` output to get to the host triple, which is
annoying to do. It's easier to just get it directly.
2024-11-02 21:29:59 +01:00
Nilstrieb
77d0b4ddfb move deployment-target tests to print-request 2024-11-02 21:29:59 +01:00