Skip to content

Commit 89a1077

Browse files
committed
Add more core stubs to minicore
`f32`, `f64` and `asm!` macro.
1 parent e97ba53 commit 89a1077

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/auxiliary/minicore.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
//!
77
//! - `minicore` is **only** intended for `core` items, and the stubs should match the actual `core`
88
//! items.
9+
//! - Becareful of adding new features and things that are only available for a subset of targets.
910
//!
1011
//! # References
1112
//!
1213
//! This is partially adapted from `rustc_codegen_cranelift`:
1314
//! <https://github.com/rust-lang/rust/blob/c0b5cc9003f6464c11ae1c0662c6a7e06f6f5cab/compiler/rustc_codegen_cranelift/example/mini_core.rs>.
1415
// ignore-tidy-linelength
1516

16-
#![feature(no_core, lang_items, rustc_attrs)]
17+
#![feature(no_core, lang_items, rustc_attrs, decl_macro)]
1718
#![allow(unused, improper_ctypes_definitions, internal_features)]
19+
#![feature(asm_experimental_arch)]
1820
#![no_std]
1921
#![no_core]
2022

@@ -37,7 +39,9 @@ impl<T: ?Sized> LegacyReceiver for &mut T {}
3739
#[lang = "copy"]
3840
pub trait Copy: Sized {}
3941

40-
impl_marker_trait!(Copy => [ bool, char, isize, usize, i8, i16, i32, i64, u8, u16, u32, u64 ]);
42+
impl_marker_trait!(
43+
Copy => [ bool, char, isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64 ]
44+
);
4145
impl<'a, T: ?Sized> Copy for &'a T {}
4246
impl<T: ?Sized> Copy for *const T {}
4347
impl<T: ?Sized> Copy for *mut T {}
@@ -70,3 +74,8 @@ impl<T: Copy + ?Sized> Copy for ManuallyDrop<T> {}
7074
pub struct UnsafeCell<T: ?Sized> {
7175
value: T,
7276
}
77+
78+
#[rustc_builtin_macro]
79+
pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
80+
/* compiler built-in */
81+
}

0 commit comments

Comments
 (0)