Skip to content

Commit 71d89c1

Browse files
committed
use minicore for target-feature tests
1 parent a41214f commit 71d89c1

27 files changed

+87
-184
lines changed

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: target feature `soft-float` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
2-
--> $DIR/abi-incompatible-target-feature-attribute.rs:22:32
2+
--> $DIR/abi-incompatible-target-feature-attribute.rs:17:32
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-flag-enable.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,13 @@
88
//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf -Ctarget-feature=+d
99
//@[riscv] needs-llvm-components: riscv
1010
//@ ignore-backends: gcc
11+
//@ add-core-stubs
1112

12-
#![feature(no_core, lang_items, riscv_target_feature)]
13+
#![feature(no_core, riscv_target_feature)]
1314
#![no_core]
1415

15-
#[lang = "pointee_sized"]
16-
pub trait PointeeSized {}
17-
18-
#[lang = "meta_sized"]
19-
pub trait MetaSized: PointeeSized {}
20-
21-
#[lang = "sized"]
22-
pub trait Sized {}
23-
#[lang = "freeze"]
24-
pub trait Freeze {}
16+
extern crate minicore;
17+
use minicore::*;
2518

2619
//~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly
2720
//~? WARN unstable feature specified for `-Ctarget-feature`

tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
//@ compile-flags: -Ctarget-feature=-x87
77
//@ build-pass
88
//@ ignore-backends: gcc
9-
#![feature(no_core, lang_items)]
9+
//@ add-core-stubs
10+
#![feature(no_core)]
1011
#![no_core]
1112

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

2116
//~? WARN unstable feature specified for `-Ctarget-feature`: `x87`

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
//@ needs-llvm-components: x86
55
//@ build-pass
66
//@ ignore-backends: gcc
7-
#![feature(no_core, lang_items, x87_target_feature)]
7+
//@ add-core-stubs
8+
#![feature(no_core, x87_target_feature)]
89
#![no_core]
910

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

1914
#[target_feature(enable = "x87")]
2015
pub unsafe fn my_fun() {}

tests/ui/target-feature/abi-required-target-feature-flag-disable.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@
1717
// Remove some LLVM warnings that only show up sometimes.
1818
//@ normalize-stderr: "\n[^\n]*(target-abi|lp64f)[^\n]*" -> ""
1919
//@ ignore-backends: gcc
20+
//@ add-core-stubs
2021

21-
#![feature(no_core, lang_items)]
22+
#![feature(no_core)]
2223
#![no_core]
2324

24-
#[lang = "pointee_sized"]
25-
pub trait PointeeSized {}
26-
27-
#[lang = "meta_sized"]
28-
pub trait MetaSized: PointeeSized {}
29-
30-
#[lang = "sized"]
31-
pub trait Sized {}
25+
extern crate minicore;
26+
use minicore::*;
3227

3328
//~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly
3429
//[x86,riscv]~? WARN unstable feature specified for `-Ctarget-feature`

tests/ui/target-feature/feature-hierarchy.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,16 @@
44
//@ [aarch64-sve2] compile-flags: -Ctarget-feature=-neon,+sve2 --target=aarch64-unknown-linux-gnu
55
//@ [aarch64-sve2] needs-llvm-components: aarch64
66
//@ build-pass
7+
//@ add-core-stubs
78
#![no_core]
89
#![crate_type = "rlib"]
9-
#![feature(intrinsics, rustc_attrs, no_core, lang_items, staged_api)]
10+
#![feature(intrinsics, rustc_attrs, no_core, staged_api)]
1011
#![stable(feature = "test", since = "1.0.0")]
1112

1213
// Tests vetting "feature hierarchies" in the cases where we impose them.
1314

14-
// Supporting minimal rust core code
15-
#[lang = "pointee_sized"]
16-
trait PointeeSized {}
17-
18-
#[lang = "meta_sized"]
19-
trait MetaSized: PointeeSized {}
20-
21-
#[lang = "sized"]
22-
trait Sized: MetaSized {}
23-
24-
#[lang = "copy"]
25-
trait Copy {}
26-
27-
impl Copy for bool {}
15+
extern crate minicore;
16+
use minicore::*;
2817

2918
#[stable(feature = "test", since = "1.0.0")]
3019
#[rustc_const_stable(feature = "test", since = "1.0.0")]

0 commit comments

Comments
 (0)