about summary refs log tree commit diff
path: root/tests/ui/proc-macro
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-17 21:53:25 +0200
committerGitHub <noreply@github.com>2025-04-17 21:53:25 +0200
commit026d56b0f6e2340b1363f3db1bc44f7cedbf7a72 (patch)
tree07ed593ba7061c8bbdba39294ef858ec819603ce /tests/ui/proc-macro
parent8b7a2897c87b875ef55d403efccac4b0cc354e16 (diff)
parent6c5a481f939d85b12f358b0be26dcf62aac568e0 (diff)
downloadrust-026d56b0f6e2340b1363f3db1bc44f7cedbf7a72.tar.gz
rust-026d56b0f6e2340b1363f3db1bc44f7cedbf7a72.zip
Rollup merge of #139967 - jieyouxu:auxiliary, r=wesleywiser
Introduce and use specialized `//@ ignore-auxiliary` for test support files instead of using `//@ ignore-test`

### Summary

Add a semantically meaningful directive for ignoring test *auxiliary* files. This is for auxiliary files that *participate* in actual tests but should not be built by `compiletest` (i.e. these files are involved through `mod xxx;` or `include!()` or `#[path = "xxx"]`, etc.).

### Motivation

A specialized directive like `//@ ignore-auxiliary` makes it way easier to audit disabled tests via `//@ ignore-test`.
  - These support files cannot use the canonical `auxiliary/` dir because they participate in module resolution or are included, or their relative paths can be important for test intention otherwise.

Follow-up to:
- #139705
- #139783
- #139740

See also discussions in:

- [#t-compiler > Directive name for non-test aux files?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Directive.20name.20for.20non-test.20aux.20files.3F/with/512773817)
- [#t-compiler > Handling disabled &#96;//@ ignore-test&#96; tests](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Handling.20disabled.20.60.2F.2F.40.20ignore-test.60.20tests/with/512005974)
- [#t-compiler/meetings > &#91;steering&#93; 2025-04-11 Dealing with disabled tests](https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bsteering.5D.202025-04-11.20Dealing.20with.20disabled.20tests/with/511717981)

### Remarks on remaining unconditionally disabled tests under `tests/`

After this PR, against commit 79a272c6402, only **14** remaining test files are disabled through `//@ ignore-test`:

<details>
<summary>Remaining `//@ ignore-test` files under `tests/`</summary>

```
tests/debuginfo/drop-locations.rs
4://@ ignore-test (broken, see #128971)

tests/rustdoc/macro-document-private-duplicate.rs
1://@ ignore-test (fails spuriously, see issue #89228)

tests/rustdoc/inline_cross/assoc-const-equality.rs
3://@ ignore-test (FIXME: #125092)

tests/ui/match/issue-27021.rs
7://@ ignore-test (#54987)

tests/ui/match/issue-26996.rs
7://@ ignore-test (#54987)

tests/ui/issues/issue-49298.rs
9://@ ignore-test (#54987)

tests/ui/issues/issue-59756.rs
2://@ ignore-test (rustfix needs multiple suggestions)

tests/ui/precondition-checks/write.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/read.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/write_bytes.rs
5://@ ignore-test (unimplemented)

tests/ui/explicit-tail-calls/drop-order.rs
2://@ ignore-test: tail calls are not implemented in rustc_codegen_ssa yet, so this causes 🧊

tests/ui/panics/panic-short-backtrace-windows-x86_64.rs
3://@ ignore-test (#92000)

tests/ui/json/json-bom-plus-crlf-multifile-aux.rs
3://@ ignore-test Not a test. Used by other tests

tests/ui/traits/next-solver/object-soundness-requires-generalization.rs
2://@ ignore-test (see #114196)
```
</details>

Of these, most are either **unimplemented**, or **spurious**, or **known-broken**. The outstanding one is `tests/ui/json/json-bom-plus-crlf-multifile-aux.rs` which I did not want to touch in *this* PR -- that aux file has load-bearing BOM and carriage returns and byte offset matters. I think those test files that require special encoding / BOM probably are better off as `run-make` tests. See #139968 for that aux file.

### Review advice

- Best reviewed commit-by-commit.
- The directive name diverged from the most voted `//@ auxiliary` because I think that's easy to confuse with `//@ aux-{crate,dir}`.

r? compiler
Diffstat (limited to 'tests/ui/proc-macro')
-rw-r--r--tests/ui/proc-macro/module.rs2
-rw-r--r--tests/ui/proc-macro/module_with_attrs.rs2
-rw-r--r--tests/ui/proc-macro/outer/inner.rs2
-rw-r--r--tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs2
-rw-r--r--tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs2
-rw-r--r--tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs2
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/ui/proc-macro/module.rs b/tests/ui/proc-macro/module.rs
index 210c05988bf..5878f1b7ddd 100644
--- a/tests/ui/proc-macro/module.rs
+++ b/tests/ui/proc-macro/module.rs
@@ -1 +1 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `./attributes-on-modules-fail.rs`)
diff --git a/tests/ui/proc-macro/module_with_attrs.rs b/tests/ui/proc-macro/module_with_attrs.rs
index 8a4ca92e44b..7e4ec978736 100644
--- a/tests/ui/proc-macro/module_with_attrs.rs
+++ b/tests/ui/proc-macro/module_with_attrs.rs
@@ -1,4 +1,4 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `../inner-attr-non-inline-mod.rs`)
 
 #![rustfmt::skip]
 #![print_attr]
diff --git a/tests/ui/proc-macro/outer/inner.rs b/tests/ui/proc-macro/outer/inner.rs
index 210c05988bf..d0f2087321f 100644
--- a/tests/ui/proc-macro/outer/inner.rs
+++ b/tests/ui/proc-macro/outer/inner.rs
@@ -1 +1 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `../attributes-on-modules-fail.rs`)
diff --git a/tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs b/tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs
index f89098f3a5e..a27176a38e2 100644
--- a/tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs
+++ b/tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs
@@ -1,4 +1,4 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`)
 
 #[derive(Print)]
 enum ProceduralMasqueradeDummyType {
diff --git a/tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs b/tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs
index f89098f3a5e..a27176a38e2 100644
--- a/tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs
+++ b/tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs
@@ -1,4 +1,4 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`)
 
 #[derive(Print)]
 enum ProceduralMasqueradeDummyType {
diff --git a/tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs b/tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs
index f89098f3a5e..765ee4be656 100644
--- a/tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs
+++ b/tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs
@@ -1,4 +1,4 @@
-//@ ignore-test (auxiliary, used by other tests)
+//@ ignore-auxiliary (used by `../../../pretty-print-hack/hide.rs`)
 
 #[derive(Print)]
 enum ProceduralMasqueradeDummyType {