Skip to content

Commit 4a4207a

Browse files
committed
use add-core-stubs / minicore for a few more tests
1 parent 4229b80 commit 4a4207a

21 files changed

+154
-164
lines changed

tests/assembly/asm/aarch64-types.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#![crate_type = "rlib"]
1212
#![no_core]
1313
#![allow(asm_sub_register, non_camel_case_types)]
14-
// FIXME(f16_f128): Only needed for FIXME in check! and check_reg!
15-
#![feature(auto_traits, lang_items)]
1614

1715
extern crate minicore;
1816
use minicore::*;
@@ -63,12 +61,6 @@ impl Copy for f16x8 {}
6361
impl Copy for f32x4 {}
6462
impl Copy for f64x2 {}
6563

66-
// FIXME(f16_f128): Only needed for FIXME in check! and check_reg!
67-
#[lang = "freeze"]
68-
unsafe auto trait Freeze {}
69-
#[lang = "unpin"]
70-
auto trait Unpin {}
71-
7264
extern "C" {
7365
fn extern_func();
7466
static extern_static: u8;

tests/auxiliary/minicore.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,20 @@
1414
//! <https://github.com/rust-lang/rust/blob/c0b5cc9003f6464c11ae1c0662c6a7e06f6f5cab/compiler/rustc_codegen_cranelift/example/mini_core.rs>.
1515
// ignore-tidy-linelength
1616

17-
#![feature(no_core, lang_items, rustc_attrs, decl_macro, naked_functions, f16, f128)]
17+
#![feature(
18+
no_core,
19+
lang_items,
20+
auto_traits,
21+
freeze_impls,
22+
negative_impls,
23+
rustc_attrs,
24+
decl_macro,
25+
naked_functions,
26+
f16,
27+
f128,
28+
asm_experimental_arch
29+
)]
1830
#![allow(unused, improper_ctypes_definitions, internal_features)]
19-
#![feature(asm_experimental_arch)]
2031
#![no_std]
2132
#![no_core]
2233

@@ -42,6 +53,12 @@ pub trait Copy: Sized {}
4253
#[lang = "bikeshed_guaranteed_no_drop"]
4354
pub trait BikeshedGuaranteedNoDrop {}
4455

56+
#[lang = "freeze"]
57+
pub unsafe auto trait Freeze {}
58+
59+
#[lang = "unpin"]
60+
pub auto trait Unpin {}
61+
4562
impl_marker_trait!(
4663
Copy => [
4764
bool, char,
@@ -83,6 +100,7 @@ impl<T: Copy + ?Sized> Copy for ManuallyDrop<T> {}
83100
pub struct UnsafeCell<T: ?Sized> {
84101
value: T,
85102
}
103+
impl<T: ?Sized> !Freeze for UnsafeCell<T> {}
86104

87105
#[rustc_builtin_macro]
88106
pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {

tests/codegen/abi-win64-zst.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ compile-flags: -Z merge-functions=disabled
2+
//@ add-core-stubs
23

34
//@ revisions: windows-gnu
45
//@[windows-gnu] compile-flags: --target x86_64-pc-windows-gnu
@@ -13,12 +14,12 @@
1314
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
1415
//@[linux] needs-llvm-components: x86
1516

16-
#![feature(no_core, lang_items, rustc_attrs, abi_vectorcall)]
17+
#![feature(no_core, rustc_attrs, abi_vectorcall)]
1718
#![no_core]
1819
#![crate_type = "lib"]
1920

20-
#[lang = "sized"]
21-
trait Sized {}
21+
extern crate minicore;
22+
use minicore::*;
2223

2324
// Make sure the argument is always passed when explicitly requesting a Windows ABI.
2425
// Our goal here is to match clang: <https://clang.godbolt.org/z/Wr4jMWq3P>.

tests/codegen/align-byval-alignment-mismatch.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ignore-tidy-linelength
2+
//@ add-core-stubs
23
//@ revisions:i686-linux x86_64-linux
34

45
//@[i686-linux] compile-flags: --target i686-unknown-linux-gnu -C panic=abort
@@ -16,18 +17,14 @@
1617
// on i686-unknown-linux-gnu, since the alignment needs to be increased, and should codegen
1718
// to a direct call on x86_64-unknown-linux-gnu, where byval alignment matches Rust alignment.
1819

19-
#![feature(no_core, lang_items)]
20+
#![feature(no_core)]
2021
#![crate_type = "lib"]
2122
#![no_std]
2223
#![no_core]
2324
#![allow(non_camel_case_types)]
2425

25-
#[lang = "sized"]
26-
trait Sized {}
27-
#[lang = "freeze"]
28-
trait Freeze {}
29-
#[lang = "copy"]
30-
trait Copy {}
26+
extern crate minicore;
27+
use minicore::*;
3128

3229
// This type has align 1 in Rust, but as a byval argument on i686-linux, it will have align 4.
3330
#[repr(C)]

tests/codegen/align-byval-vector.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions:x86-linux x86-darwin
23

34
//@[x86-linux] compile-flags: --target i686-unknown-linux-gnu
@@ -7,18 +8,14 @@
78

89
// Tests that aggregates containing vector types get their alignment increased to 16 on Darwin.
910

10-
#![feature(no_core, lang_items, repr_simd, simd_ffi)]
11+
#![feature(no_core, repr_simd, simd_ffi)]
1112
#![crate_type = "lib"]
1213
#![no_std]
1314
#![no_core]
1415
#![allow(non_camel_case_types)]
1516

16-
#[lang = "sized"]
17-
trait Sized {}
18-
#[lang = "freeze"]
19-
trait Freeze {}
20-
#[lang = "copy"]
21-
trait Copy {}
17+
extern crate minicore;
18+
use minicore::*;
2219

2320
#[repr(simd)]
2421
pub struct i32x4([i32; 4]);

tests/codegen/align-byval.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ignore-tidy-linelength
2+
//@ add-core-stubs
23
//@ revisions:m68k x86_64-linux x86_64-windows i686-linux i686-windows
34

45
//@[m68k] compile-flags: --target m68k-unknown-linux-gnu
@@ -16,20 +17,13 @@
1617
// The only targets that use `byval` are m68k, x86-64, and x86.
1718
// Note also that Windows mandates a by-ref ABI here, so it does not use byval.
1819

19-
#![feature(no_core, lang_items)]
20+
#![feature(no_core)]
2021
#![crate_type = "lib"]
2122
#![no_std]
2223
#![no_core]
2324

24-
#[lang = "sized"]
25-
trait Sized {}
26-
#[lang = "freeze"]
27-
trait Freeze {}
28-
#[lang = "copy"]
29-
trait Copy {}
30-
31-
impl Copy for i32 {}
32-
impl Copy for i64 {}
25+
extern crate minicore;
26+
use minicore::*;
3327

3428
// This struct can be represented as a pair, so it exercises the OperandValue::Pair
3529
// codepath in `codegen_argument`.

tests/ui/abi/c-zst.aarch64-darwin.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ error: fn_abi_of(pass_zst) = FnAbi {
6060
conv: C,
6161
can_unwind: false,
6262
}
63-
--> $DIR/c-zst.rs:63:1
63+
--> $DIR/c-zst.rs:64:1
6464
|
6565
LL | extern "C" fn pass_zst(_: ()) {}
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/abi/c-zst.powerpc-linux.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ error: fn_abi_of(pass_zst) = FnAbi {
7171
conv: C,
7272
can_unwind: false,
7373
}
74-
--> $DIR/c-zst.rs:63:1
74+
--> $DIR/c-zst.rs:64:1
7575
|
7676
LL | extern "C" fn pass_zst(_: ()) {}
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/abi/c-zst.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
23
/*!
34
C doesn't have zero-sized types... except it does.
@@ -52,12 +53,12 @@ extern "C" fn(i32, (), i32);
5253
//@[x86_64-pc-windows-gnu] needs-llvm-components: x86
5354

5455

55-
#![feature(lang_items, no_core, rustc_attrs)]
56+
#![feature(no_core, rustc_attrs)]
5657
#![no_core]
5758
#![crate_type = "lib"]
5859

59-
#[lang = "sized"]
60-
trait Sized {}
60+
extern crate minicore;
61+
use minicore::*;
6162

6263
#[rustc_abi(debug)]
6364
extern "C" fn pass_zst(_: ()) {} //~ ERROR: fn_abi

tests/ui/abi/c-zst.s390x-linux.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ error: fn_abi_of(pass_zst) = FnAbi {
7171
conv: C,
7272
can_unwind: false,
7373
}
74-
--> $DIR/c-zst.rs:63:1
74+
--> $DIR/c-zst.rs:64:1
7575
|
7676
LL | extern "C" fn pass_zst(_: ()) {}
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)