Skip to content

Commit f04e3df

Browse files
committed
Auto merge of #147812 - RalfJung:more-minicore, r=jieyouxu
use minicore for more tests r? `@jieyouxu` Unfortunately this doesn't work for all tests; minicore sometimes fails to build with errors like ``` rustc-LLVM ERROR: ILP32E cannot be used with the D ISA extension ``` and ``` error: the target features paca, pacg must all be either enabled or disabled together ``` These errors are meant to be triggered in the tests, but not in minicore. It seems like all ``@compile-flags`` are forwarded to minicore. Maybe we should exclude `-Ctarget-feature` from that? Or provide some way to set flags only for the current file, not minicore?
2 parents 4ddbb60 + eb1c62b commit f04e3df

37 files changed

+102
-196
lines changed

tests/ui/repr/16-bit-repr-c-enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//@ [msp430] needs-llvm-components: msp430
88
//@ [msp430] compile-flags: --target=msp430-none-elf --crate-type=rlib
99
//@ ignore-backends: gcc
10-
#![feature(no_core, lang_items, intrinsics, staged_api, rustc_attrs)]
10+
#![feature(no_core, intrinsics, staged_api, rustc_attrs)]
1111
#![no_core]
1212
#![crate_type = "lib"]
1313
#![stable(feature = "intrinsics_for_test", since = "3.3.3")]

tests/ui/repr/repr-c-dead-variants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(no_core, rustc_attrs, lang_items)]
1+
#![feature(no_core, rustc_attrs)]
22
#![allow(dead_code)]
33
#![crate_type = "lib"]
44
#![no_std]

tests/ui/repr/repr_align_greater_usize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// We should fail to compute alignment for types aligned higher than usize::MAX.
1010
// We can't handle alignments that require all 32 bits, so this only affects 16-bit.
1111

12-
#![feature(lang_items, no_core)]
12+
#![feature(no_core)]
1313
#![no_core]
1414
#![crate_type = "lib"]
1515

tests/ui/sanitizer/cfg-kasan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//@ ignore-backends: gcc
1717

1818
#![crate_type = "rlib"]
19-
#![feature(cfg_sanitize, no_core, lang_items)]
19+
#![feature(cfg_sanitize, no_core)]
2020
#![no_core]
2121

2222
extern crate minicore;

tests/ui/sanitizer/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//@[thread]compile-flags: -Zsanitizer=thread
2222
//@ ignore-backends: gcc
2323

24-
#![feature(cfg_sanitize, no_core, lang_items)]
24+
#![feature(cfg_sanitize, no_core)]
2525
#![crate_type="lib"]
2626
#![no_core]
2727

tests/ui/static/static_sized_requirement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ add-core-stubs
22
//@ check-pass
33

4-
#![feature(no_core, lang_items)]
4+
#![feature(no_core)]
55
#![no_core]
66
#![crate_type = "lib"]
77

tests/ui/target-feature/abi-incompatible-target-feature-attribute-fcw.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
//@ compile-flags: --crate-type=lib
22
//@ compile-flags: --target=aarch64-unknown-none-softfloat
33
//@ needs-llvm-components: aarch64
4-
#![feature(no_core, lang_items)]
4+
//@ add-core-stubs
5+
#![feature(no_core)]
56
#![no_core]
67
#![deny(aarch64_softfloat_neon)]
78

8-
#[lang = "pointee_sized"]
9-
pub trait PointeeSized {}
10-
11-
#[lang = "meta_sized"]
12-
pub trait MetaSized: PointeeSized {}
13-
14-
#[lang = "sized"]
15-
pub trait Sized: MetaSized {}
9+
extern crate minicore;
10+
use minicore::*;
1611

1712
#[target_feature(enable = "neon")]
1813
//~^ERROR: enabling the `neon` target feature on the current target is unsound

tests/ui/target-feature/abi-incompatible-target-feature-attribute-fcw.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: enabling the `neon` target feature on the current target is unsound due to ABI issues
2-
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:17:18
2+
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:12:18
33
|
44
LL | #[target_feature(enable = "neon")]
55
| ^^^^^^^^^^^^^^^
66
|
77
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88
= note: for more information, see issue #134375 <https://github.com/rust-lang/rust/issues/134375>
99
note: the lint level is defined here
10-
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:6:9
10+
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:7:9
1111
|
1212
LL | #![deny(aarch64_softfloat_neon)]
1313
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -16,15 +16,15 @@ error: aborting due to 1 previous error
1616

1717
Future incompatibility report: Future breakage diagnostic:
1818
error: enabling the `neon` target feature on the current target is unsound due to ABI issues
19-
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:17:18
19+
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:12:18
2020
|
2121
LL | #[target_feature(enable = "neon")]
2222
| ^^^^^^^^^^^^^^^
2323
|
2424
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2525
= note: for more information, see issue #134375 <https://github.com/rust-lang/rust/issues/134375>
2626
note: the lint level is defined here
27-
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:6:9
27+
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:7:9
2828
|
2929
LL | #![deny(aarch64_softfloat_neon)]
3030
| ^^^^^^^^^^^^^^^^^^^^^^

tests/ui/target-feature/abi-incompatible-target-feature-attribute.riscv.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: target feature `d` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
2-
--> $DIR/abi-incompatible-target-feature-attribute.rs:22:90
2+
--> $DIR/abi-incompatible-target-feature-attribute.rs:17:90
33
|
44
LL | #[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
55
| ^^^^^^^^^^^^

tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77
//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf
88
//@[riscv] needs-llvm-components: riscv
99
//@ ignore-backends: gcc
10-
#![feature(no_core, lang_items, riscv_target_feature, x87_target_feature)]
10+
//@ add-core-stubs
11+
#![feature(no_core, riscv_target_feature, x87_target_feature)]
1112
#![no_core]
1213

13-
#[lang = "pointee_sized"]
14-
pub trait PointeeSized {}
15-
16-
#[lang = "meta_sized"]
17-
pub trait MetaSized: PointeeSized {}
18-
19-
#[lang = "sized"]
20-
pub trait Sized {}
14+
extern crate minicore;
15+
use minicore::*;
2116

2217
#[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
2318
//~^ERROR: cannot be enabled with

0 commit comments

Comments
 (0)