Skip to content

Commit 5dc60fb

Browse files
committed
compiletest: rename add-core-stubs to add-minicore
1 parent 6906167 commit 5dc60fb

File tree

275 files changed

+297
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+297
-299
lines changed

src/doc/rustc-dev-guide/src/tests/minicore.md

Lines changed: 7 additions & 7 deletions

src/tools/compiletest/src/directives.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub(crate) struct TestProps {
200200
pub no_auto_check_cfg: bool,
201201
/// Build and use `minicore` as `core` stub for `no_core` tests in cross-compilation scenarios
202202
/// that don't otherwise want/need `-Z build-std`.
203-
pub add_core_stubs: bool,
203+
pub add_minicore: bool,
204204
/// Add these flags to the build of `minicore`.
205205
pub core_stubs_compile_flags: Vec<String>,
206206
/// Whether line annotatins are required for the given error kind.
@@ -254,7 +254,7 @@ mod directives {
254254
pub const LLVM_COV_FLAGS: &'static str = "llvm-cov-flags";
255255
pub const FILECHECK_FLAGS: &'static str = "filecheck-flags";
256256
pub const NO_AUTO_CHECK_CFG: &'static str = "no-auto-check-cfg";
257-
pub const ADD_CORE_STUBS: &'static str = "add-core-stubs";
257+
pub const ADD_MINICORE: &'static str = "add-minicore";
258258
pub const CORE_STUBS_COMPILE_FLAGS: &'static str = "core-stubs-compile-flags";
259259
pub const DISABLE_GDB_PRETTY_PRINTERS: &'static str = "disable-gdb-pretty-printers";
260260
pub const COMPARE_OUTPUT_BY_LINES: &'static str = "compare-output-by-lines";
@@ -311,7 +311,7 @@ impl TestProps {
311311
llvm_cov_flags: vec![],
312312
filecheck_flags: vec![],
313313
no_auto_check_cfg: false,
314-
add_core_stubs: false,
314+
add_minicore: false,
315315
core_stubs_compile_flags: vec![],
316316
dont_require_annotations: Default::default(),
317317
disable_gdb_pretty_printers: false,
@@ -601,7 +601,7 @@ impl TestProps {
601601

602602
config.set_name_directive(ln, NO_AUTO_CHECK_CFG, &mut self.no_auto_check_cfg);
603603

604-
self.update_add_core_stubs(ln, config);
604+
self.update_add_minicore(ln, config);
605605

606606
if let Some(flags) =
607607
config.parse_name_value_directive(ln, CORE_STUBS_COMPILE_FLAGS)
@@ -753,12 +753,12 @@ impl TestProps {
753753
self.pass_mode
754754
}
755755

756-
fn update_add_core_stubs(&mut self, ln: &DirectiveLine<'_>, config: &Config) {
757-
let add_core_stubs = config.parse_name_directive(ln, directives::ADD_CORE_STUBS);
758-
if add_core_stubs {
756+
fn update_add_minicore(&mut self, ln: &DirectiveLine<'_>, config: &Config) {
757+
let add_minicore = config.parse_name_directive(ln, directives::ADD_MINICORE);
758+
if add_minicore {
759759
if !matches!(config.mode, TestMode::Ui | TestMode::Codegen | TestMode::Assembly) {
760760
panic!(
761-
"`add-core-stubs` is currently only supported for ui, codegen and assembly test modes"
761+
"`add-minicore` is currently only supported for ui, codegen and assembly test modes"
762762
);
763763
}
764764

@@ -767,10 +767,10 @@ impl TestProps {
767767
if self.local_pass_mode().is_some_and(|pm| pm == PassMode::Run) {
768768
// `minicore` can only be used with non-run modes, because it's `core` prelude stubs
769769
// and can't run.
770-
panic!("`add-core-stubs` cannot be used to run the test binary");
770+
panic!("`add-minicore` cannot be used to run the test binary");
771771
}
772772

773-
self.add_core_stubs = add_core_stubs;
773+
self.add_minicore = add_minicore;
774774
}
775775
}
776776
}

src/tools/compiletest/src/directives/directive_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// a best-effort approximation for diagnostics. Add new directives to this list when needed.
44
pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
55
// tidy-alphabetical-start
6-
"add-core-stubs",
6+
"add-minicore",
77
"assembly-output",
88
"aux-bin",
99
"aux-build",

src/tools/compiletest/src/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ impl<'test> TestCx<'test> {
13121312
input: Option<String>,
13131313
root_testpaths: &TestPaths,
13141314
) -> ProcRes {
1315-
if self.props.add_core_stubs {
1315+
if self.props.add_minicore {
13161316
let minicore_path = self.build_minicore();
13171317
rustc.arg("--extern");
13181318
rustc.arg(&format!("minicore={}", minicore_path));
@@ -1457,7 +1457,7 @@ impl<'test> TestCx<'test> {
14571457

14581458
aux_rustc.arg("-L").arg(&aux_dir);
14591459

1460-
if aux_props.add_core_stubs {
1460+
if aux_props.add_minicore {
14611461
let minicore_path = self.build_minicore();
14621462
aux_rustc.arg("--extern");
14631463
aux_rustc.arg(&format!("minicore={}", minicore_path));
@@ -1899,7 +1899,7 @@ impl<'test> TestCx<'test> {
18991899
// change the default.
19001900
//
19011901
// `minicore` requires `#![no_std]` and `#![no_core]`, which means no unwinding panics.
1902-
if self.props.add_core_stubs {
1902+
if self.props.add_minicore {
19031903
rustc.arg("-Cpanic=abort");
19041904
rustc.arg("-Cforce-unwind-tables=yes");
19051905
}

tests/assembly-llvm/aarch64-pointer-auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test that PAC instructions are emitted when branch-protection is specified.
22

3-
//@ add-core-stubs
3+
//@ add-minicore
44
//@ revisions: GCS PACRET PAUTHLR_NOP PAUTHLR
55
//@ assembly-output: emit-asm
66
//@ needs-llvm-components: aarch64

tests/assembly-llvm/asm/aarch64-el2vmsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ add-core-stubs
1+
//@ add-minicore
22
//@ assembly-output: emit-asm
33
//@ compile-flags: --target aarch64-unknown-linux-gnu
44
//@ needs-llvm-components: aarch64

tests/assembly-llvm/asm/aarch64-modifiers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ add-core-stubs
1+
//@ add-minicore
22
//@ assembly-output: emit-asm
33
//@ compile-flags: -Copt-level=3 -C panic=abort
44
//@ compile-flags: --target aarch64-unknown-linux-gnu

tests/assembly-llvm/asm/aarch64-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ add-core-stubs
1+
//@ add-minicore
22
//@ revisions: aarch64 arm64ec
33
//@ assembly-output: emit-asm
44
//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu

tests/assembly-llvm/asm/arm-modifiers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ add-core-stubs
1+
//@ add-minicore
22
//@ assembly-output: emit-asm
33
//@ compile-flags: -Copt-level=3 -C panic=abort
44
//@ compile-flags: --target armv7-unknown-linux-gnueabihf

tests/assembly-llvm/asm/arm-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ add-core-stubs
1+
//@ add-minicore
22
//@ revisions: base d32 neon
33
//@ assembly-output: emit-asm
44
//@ compile-flags: --target armv7-unknown-linux-gnueabihf

0 commit comments

Comments
 (0)