Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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/ui/repr/16-bit-repr-c-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//@ [msp430] needs-llvm-components: msp430
//@ [msp430] compile-flags: --target=msp430-none-elf --crate-type=rlib
//@ ignore-backends: gcc
#![feature(no_core, lang_items, intrinsics, staged_api, rustc_attrs)]
#![feature(no_core, intrinsics, staged_api, rustc_attrs)]
#![no_core]
#![crate_type = "lib"]
#![stable(feature = "intrinsics_for_test", since = "3.3.3")]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/repr/repr-c-dead-variants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(no_core, rustc_attrs, lang_items)]
#![feature(no_core, rustc_attrs)]
#![allow(dead_code)]
#![crate_type = "lib"]
#![no_std]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/repr/repr_align_greater_usize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// We should fail to compute alignment for types aligned higher than usize::MAX.
// We can't handle alignments that require all 32 bits, so this only affects 16-bit.

#![feature(lang_items, no_core)]
#![feature(no_core)]
#![no_core]
#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/sanitizer/cfg-kasan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//@ ignore-backends: gcc

#![crate_type = "rlib"]
#![feature(cfg_sanitize, no_core, lang_items)]
#![feature(cfg_sanitize, no_core)]
#![no_core]

extern crate minicore;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/sanitizer/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//@[thread]compile-flags: -Zsanitizer=thread
//@ ignore-backends: gcc

#![feature(cfg_sanitize, no_core, lang_items)]
#![feature(cfg_sanitize, no_core)]
#![crate_type="lib"]
#![no_core]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/static/static_sized_requirement.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ add-core-stubs
//@ check-pass

#![feature(no_core, lang_items)]
#![feature(no_core)]
#![no_core]
#![crate_type = "lib"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
//@ compile-flags: --crate-type=lib
//@ compile-flags: --target=aarch64-unknown-none-softfloat
//@ needs-llvm-components: aarch64
#![feature(no_core, lang_items)]
//@ add-core-stubs
#![feature(no_core)]
#![no_core]
#![deny(aarch64_softfloat_neon)]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

#[target_feature(enable = "neon")]
//~^ERROR: enabling the `neon` target feature on the current target is unsound
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: enabling the `neon` target feature on the current target is unsound due to ABI issues
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:17:18
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:12:18
|
LL | #[target_feature(enable = "neon")]
| ^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #134375 <https://github.com/rust-lang/rust/issues/134375>
note: the lint level is defined here
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:6:9
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:7:9
|
LL | #![deny(aarch64_softfloat_neon)]
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -16,15 +16,15 @@ error: aborting due to 1 previous error

Future incompatibility report: Future breakage diagnostic:
error: enabling the `neon` target feature on the current target is unsound due to ABI issues
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:17:18
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:12:18
|
LL | #[target_feature(enable = "neon")]
| ^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #134375 <https://github.com/rust-lang/rust/issues/134375>
note: the lint level is defined here
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:6:9
--> $DIR/abi-incompatible-target-feature-attribute-fcw.rs:7:9
|
LL | #![deny(aarch64_softfloat_neon)]
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: target feature `d` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
--> $DIR/abi-incompatible-target-feature-attribute.rs:22:90
--> $DIR/abi-incompatible-target-feature-attribute.rs:17:90
|
LL | #[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@
//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf
//@[riscv] needs-llvm-components: riscv
//@ ignore-backends: gcc
#![feature(no_core, lang_items, riscv_target_feature, x87_target_feature)]
//@ add-core-stubs
#![feature(no_core, riscv_target_feature, x87_target_feature)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}
extern crate minicore;
use minicore::*;

#[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
//~^ERROR: cannot be enabled with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: target feature `soft-float` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
--> $DIR/abi-incompatible-target-feature-attribute.rs:22:32
--> $DIR/abi-incompatible-target-feature-attribute.rs:17:32
|
LL | #[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
| ^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@
//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=+soft-float
//@[x86] needs-llvm-components: x86
//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf -Ctarget-feature=+d
// FIXME(#147881): *disable* the feature again for minicore as otherwise that will fail to build.
//@[riscv] core-stubs-compile-flags: -Ctarget-feature=-d
//@[riscv] needs-llvm-components: riscv
//@ ignore-backends: gcc
//@ add-core-stubs

#![feature(no_core, lang_items, riscv_target_feature)]
#![feature(no_core, riscv_target_feature)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}
#[lang = "freeze"]
pub trait Freeze {}
extern crate minicore;
use minicore::*;

//~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly
//~? WARN unstable feature specified for `-Ctarget-feature`
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@
//@ compile-flags: -Ctarget-feature=-x87
//@ build-pass
//@ ignore-backends: gcc
#![feature(no_core, lang_items)]
//@ add-core-stubs
#![feature(no_core)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

//~? WARN unstable feature specified for `-Ctarget-feature`: `x87`
13 changes: 4 additions & 9 deletions tests/ui/target-feature/abi-required-target-feature-attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
//@ needs-llvm-components: x86
//@ build-pass
//@ ignore-backends: gcc
#![feature(no_core, lang_items, x87_target_feature)]
//@ add-core-stubs
#![feature(no_core, x87_target_feature)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

#[target_feature(enable = "x87")]
pub unsafe fn my_fun() {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,13 @@
// Remove some LLVM warnings that only show up sometimes.
//@ normalize-stderr: "\n[^\n]*(target-abi|lp64f)[^\n]*" -> ""
//@ ignore-backends: gcc
//@ add-core-stubs

#![feature(no_core, lang_items)]
#![feature(no_core)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}
extern crate minicore;
use minicore::*;

//~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly
//[x86,riscv]~? WARN unstable feature specified for `-Ctarget-feature`
19 changes: 4 additions & 15 deletions tests/ui/target-feature/feature-hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@
//@ [aarch64-sve2] compile-flags: -Ctarget-feature=-neon,+sve2 --target=aarch64-unknown-linux-gnu
//@ [aarch64-sve2] needs-llvm-components: aarch64
//@ build-pass
//@ add-core-stubs
#![no_core]
#![crate_type = "rlib"]
#![feature(intrinsics, rustc_attrs, no_core, lang_items, staged_api)]
#![feature(intrinsics, rustc_attrs, no_core, staged_api)]
#![stable(feature = "test", since = "1.0.0")]

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

// Supporting minimal rust core code
#[lang = "pointee_sized"]
trait PointeeSized {}

#[lang = "meta_sized"]
trait MetaSized: PointeeSized {}

#[lang = "sized"]
trait Sized: MetaSized {}

#[lang = "copy"]
trait Copy {}

impl Copy for bool {}
extern crate minicore;
use minicore::*;

#[stable(feature = "test", since = "1.0.0")]
#[rustc_const_stable(feature = "test", since = "1.0.0")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
//@ needs-llvm-components: riscv
//@ ignore-backends: gcc
#![feature(no_core, lang_items, riscv_target_feature)]
//@ add-core-stubs
#![feature(no_core, riscv_target_feature)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

#[target_feature(enable = "d")]
//~^ERROR: cannot be enabled with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: target feature `d` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
--> $DIR/forbidden-hardfloat-target-feature-attribute-e-d.rs:17:18
--> $DIR/forbidden-hardfloat-target-feature-attribute-e-d.rs:12:18
|
LL | #[target_feature(enable = "d")]
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
//@ compile-flags: --target=riscv64gc-unknown-linux-gnu --crate-type=lib
//@ needs-llvm-components: riscv
//@ ignore-backends: gcc
#![feature(no_core, lang_items, riscv_target_feature)]
//@ add-core-stubs
#![feature(no_core, riscv_target_feature)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}
extern crate minicore;
use minicore::*;

#[target_feature(enable = "zdinx")]
//~^ERROR: cannot be enabled with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: target feature `zfinx` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
--> $DIR/forbidden-hardfloat-target-feature-attribute-f-zfinx.rs:17:18
--> $DIR/forbidden-hardfloat-target-feature-attribute-f-zfinx.rs:12:18
|
LL | #[target_feature(enable = "zdinx")]
| ^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
//@ needs-llvm-components: x86
//@ check-pass
#![feature(no_core, lang_items)]
//@ add-core-stubs
#![feature(no_core)]
#![no_core]
#![allow(unexpected_cfgs)]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

// The compile_error macro does not exist, so if the `cfg` evaluates to `true` this
// complains about the missing macro rather than showing the error... but that's good enough.
Expand Down
13 changes: 4 additions & 9 deletions tests/ui/target-feature/forbidden-target-feature-attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
//@ needs-llvm-components: riscv
//@ ignore-backends: gcc
#![feature(no_core, lang_items)]
//@ add-core-stubs
#![feature(no_core)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}
extern crate minicore;
use minicore::*;

#[target_feature(enable = "forced-atomics")]
//~^ERROR: cannot be enabled with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: target feature `forced-atomics` cannot be enabled with `#[target_feature]`: unsound because it changes the ABI of atomic operations
--> $DIR/forbidden-target-feature-attribute.rs:17:18
--> $DIR/forbidden-target-feature-attribute.rs:12:18
|
LL | #[target_feature(enable = "forced-atomics")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading
Loading