Skip to content

Introduce and use specialized //@ ignore-auxiliary for test support files instead of using //@ ignore-test #139967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/codegen/remap_path_prefix/aux_mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test: this is not a test
//@ ignore-auxiliary (used by `./main.rs`)

#[inline]
pub fn some_aux_mod_function() -> i32 {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/borrowck/move-error-snippets-ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./move-error-snippets.rs`)

macro_rules! aaa {
($c:ident) => {{
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/codemap_tests/two_files_data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./two_files.rs`)

trait Foo { }

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/conditional-compilation/module_with_cfg.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./inner-cfg-non-inline-mod.rs`)

#![cfg_attr(all(), cfg(FALSE))]
2 changes: 1 addition & 1 deletion tests/ui/cross/cross-file-errors/underscore.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./main.rs`)
#![crate_type = "lib"]

macro_rules! underscore {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test not a test, auxiliary
//@ ignore-auxiliary (used by `../../macro-expanded-mod.rs`)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test not a test, auxiliary
//@ ignore-auxiliary (used by `../../macro-expanded-mod.rs`)

mod_decl!(bar);
2 changes: 1 addition & 1 deletion tests/ui/lint/expansion-time-include.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test auxiliary file for expansion-time.rs
//@ ignore-auxiliary (used by `./expansion-time.rs`)

1
2
2 changes: 1 addition & 1 deletion tests/ui/lint/known-tool-in-submodule/submodule.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test: not a test
//@ ignore-auxiliary (used by `./root.rs`)

#[allow(tool::lint)]
pub fn foo() {}
2 changes: 1 addition & 1 deletion tests/ui/lint/lint_pre_expansion_extern_module_aux.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test: not a test
//@ ignore-auxiliary (used by `./lint-pre-expansion-extern-module.rs`)

pub fn try() {}
4 changes: 1 addition & 3 deletions tests/ui/lint/unknown-lints/other.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//@ ignore-test (auxiliary)

// Companion to allow-in-other-module.rs
//@ ignore-auxiliary (used by `./allow-in-other-module.rs`)

// This should not warn.
#![allow(not_a_real_lint)]
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/macros/auxiliary/macro-include-items-expr.rs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: This directory already has compiletest-ignore-dir, so this aux file and tests/ui/macros/auxiliary/macro-include-items-item.rs has // ignore-test (note the lack of @) which are redundant and never ported during the // -> //@ migration.

Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
// ignore-test: this is not a test

1
2 changes: 0 additions & 2 deletions tests/ui/macros/auxiliary/macro-include-items-item.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
// ignore-test: this is not a test

fn foo() { bar() }
2 changes: 1 addition & 1 deletion tests/ui/macros/include-single-expr-helper-1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test auxiliary file for include-single-expr.rs
//@ ignore-auxiliary (used by `./include-single-expr.rs`)

0

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/include-single-expr-helper.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test auxiliary file for include-single-expr.rs
//@ ignore-auxiliary (used by `./include-single-expr.rs`)

0
10
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/issue-69838-dir/bar.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test -- this is an auxiliary file as part of another test.
//@ ignore-auxiliary (used by `../issue-69838-mods-relative-to-included-path.rs`)

pub fn i_am_in_bar() {}
2 changes: 1 addition & 1 deletion tests/ui/macros/issue-69838-dir/included.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test -- this is an auxiliary file as part of another test.
//@ ignore-auxiliary (used by `../issue-69838-mods-relative-to-included-path.rs`)

pub mod bar;
2 changes: 1 addition & 1 deletion tests/ui/macros/macro-expanded-include/foo/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `../test.rs`)

macro_rules! m {
() => { include!("file.txt"); }
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/missing_non_modrs_mod/foo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//
Copy link
Member Author

@jieyouxu jieyouxu Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: removing this extra // caused a .stderr line number shift in tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr.

//@ ignore-test this is just a helper for the real test in this dir
//@ ignore-auxiliary (used by `./missing_non_modrs_mod.rs`)

mod missing;
2 changes: 1 addition & 1 deletion tests/ui/missing_non_modrs_mod/foo_inline.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test this is just a helper for the real test in this dir
//@ ignore-auxiliary (used by `./missing_non_modrs_mod_inline.rs`)

mod inline {
mod missing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0583]: file not found for module `missing`
--> $DIR/foo.rs:4:1
--> $DIR/foo.rs:3:1
|
LL | mod missing;
| ^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/modules/mod_file_aux.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ run-pass
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: useless/misleading //@ run-pass in a few aux files that are //@ ignore-test (//@ ignore-auxiliary)

//@ ignore-test Not a test. Used by other tests
//@ ignore-auxiliary (used by `./mod_file_with_path_attr.rs` and `mod_file.rs`)

pub fn foo() -> isize { 10 }
2 changes: 1 addition & 1 deletion tests/ui/modules_and_files_visibility/mod_file_aux.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-test Not a test. Used by other tests
//@ ignore-auxiliary (used by `./mod_file_correct_spans.rs`)

pub fn foo() -> isize { 10 }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test not a test. aux file
//@ ignore-auxiliary (used by `./mod_file_disambig.rs`)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test not a test. aux file
//@ ignore-auxiliary (used by `../mod_file_disambig.rs`)
4 changes: 1 addition & 3 deletions tests/ui/non_modrs_mods/foors_mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//@ run-pass
//
//@ ignore-test: not a test, used by non_modrs_mods.rs
//@ ignore-auxiliary (used by `./non_modrs_mods.rs`)

pub mod inner_modrs_mod;
pub mod inner_foors_mod;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/non_modrs_mods_and_inline_mods/x.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test: not a test
//@ ignore-auxiliary (used by `./non_modrs_mods_and_inline_mods.rs`)

pub mod y {
pub mod z;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/non_modrs_mods_and_inline_mods/x/y/z/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test: not a test
//@ ignore-auxiliary (used by `../../../non_modrs_mods_and_inline_mods.rs`)
2 changes: 1 addition & 1 deletion tests/ui/numbers-arithmetic/saturating-float-casts-impl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./saturating-float-casts.rs` and `./saturating-float-casts-wasm.rs`)

// Tests saturating float->int casts. See u128-as-f32.rs for the opposite direction.
//
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/parser/circular_modules_hello.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test: this is an auxiliary file for circular-modules-main.rs
//@ ignore-auxiliary (used by `./circular-modules-main.rs`)

#[path = "circular_modules_main.rs"]
mod circular_modules_main;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test: this is an auxiliary file for circular-module-with-doc-comment-issue-97589.rs
//@ ignore-auxiliary (used by `./circular-module-with-doc-comment-issue-97589.rs`)

//! this comment caused the circular dependency checker to break

Expand Down
3 changes: 1 addition & 2 deletions tests/ui/parser/issues/issue-48508-aux.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-test Not a test. Used by issue-48508.rs
//@ ignore-auxiliary (used by `./issue-48508.rs`)

pub fn other() -> f64 {
let µ = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/module.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `./attributes-on-modules-fail.rs`)
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/module_with_attrs.rs
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/outer/inner.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `../attributes-on-modules-fail.rs`)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`)

#[derive(Print)]
enum ProceduralMasqueradeDummyType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`)

#[derive(Print)]
enum ProceduralMasqueradeDummyType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-test (auxiliary, used by other tests)
//@ ignore-auxiliary (used by `../../../pretty-print-hack/hide.rs`)

#[derive(Print)]
enum ProceduralMasqueradeDummyType {
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/runtime/backtrace-debuginfo-aux.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-test: not a test, used by backtrace-debuginfo.rs to test file!()
//@ ignore-auxiliary (used by `./backtrace-debuginfo.rs` to test `file!()`)

#[inline(never)]
pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
Expand Down