|
1 | 1 | // ignore-tidy-linelength
|
2 |
| -// //@ revisions: i686_apple_darwin |
3 |
| -// //@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin |
4 |
| -// //@ [i686_apple_darwin] needs-llvm-components: x86 |
| 2 | +//@ add-core-stubs |
| 3 | +//@ revisions: i686_apple_darwin |
| 4 | +//@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin |
| 5 | +//@ [i686_apple_darwin] needs-llvm-components: x86 |
5 | 6 | //@ revisions: x86_64_apple_darwin
|
6 | 7 | //@ [x86_64_apple_darwin] compile-flags: --target x86_64-apple-darwin
|
7 | 8 | //@ [x86_64_apple_darwin] needs-llvm-components: x86
|
8 | 9 | //@ revisions: aarch64_apple_darwin
|
9 | 10 | //@ [aarch64_apple_darwin] compile-flags: --target aarch64-apple-darwin
|
10 | 11 | //@ [aarch64_apple_darwin] needs-llvm-components: aarch64
|
11 |
| -// //@ revisions: i386_apple_ios |
12 |
| -// //@ [i386_apple_ios] compile-flags: --target i386-apple-ios |
13 |
| -// //@ [i386_apple_ios] needs-llvm-components: x86 |
14 |
| -// //@ revisions: x86_64_apple_ios |
15 |
| -// //@ [x86_64_apple_ios] compile-flags: --target x86_64-apple-ios |
16 |
| -// //@ [x86_64_apple_ios] needs-llvm-components: x86 |
17 |
| -// //@ revisions: armv7s_apple_ios |
18 |
| -// //@ [armv7s_apple_ios] compile-flags: --target armv7s-apple-ios |
19 |
| -// //@ [armv7s_apple_ios] needs-llvm-components: arm |
20 |
| -// //@ revisions: aarch64_apple_ios |
21 |
| -// //@ [aarch64_apple_ios] compile-flags: --target aarch64-apple-ios |
22 |
| -// //@ [aarch64_apple_ios] needs-llvm-components: aarch64 |
23 |
| -// //@ revisions: aarch64_apple_ios_sim |
24 |
| -// //@ [aarch64_apple_ios_sim] compile-flags: --target aarch64-apple-ios-sim |
25 |
| -// //@ [aarch64_apple_ios_sim] needs-llvm-components: aarch64 |
| 12 | +//@ revisions: i386_apple_ios |
| 13 | +//@ [i386_apple_ios] compile-flags: --target i386-apple-ios |
| 14 | +//@ [i386_apple_ios] needs-llvm-components: x86 |
| 15 | +//@ revisions: x86_64_apple_ios |
| 16 | +//@ [x86_64_apple_ios] compile-flags: --target x86_64-apple-ios |
| 17 | +//@ [x86_64_apple_ios] needs-llvm-components: x86 |
| 18 | +//@ revisions: armv7s_apple_ios |
| 19 | +//@ [armv7s_apple_ios] compile-flags: --target armv7s-apple-ios |
| 20 | +//@ [armv7s_apple_ios] needs-llvm-components: arm |
| 21 | +//@ revisions: aarch64_apple_ios |
| 22 | +//@ [aarch64_apple_ios] compile-flags: --target aarch64-apple-ios |
| 23 | +//@ [aarch64_apple_ios] needs-llvm-components: aarch64 |
| 24 | +//@ revisions: aarch64_apple_ios_sim |
| 25 | +//@ [aarch64_apple_ios_sim] compile-flags: --target aarch64-apple-ios-sim |
| 26 | +//@ [aarch64_apple_ios_sim] needs-llvm-components: aarch64 |
26 | 27 |
|
27 | 28 | #![crate_type = "lib"]
|
28 |
| -#![feature(darwin_objc)] |
29 |
| -#![no_std] |
| 29 | +#![feature(no_core, lang_items, rustc_attrs)] |
| 30 | +#![no_core] |
30 | 31 |
|
31 |
| -use core::os::darwin::objc; |
| 32 | +extern crate minicore; |
| 33 | +use minicore::*; |
32 | 34 |
|
33 | 35 | #[no_mangle]
|
34 |
| -pub fn get_class() -> objc::Class { |
35 |
| - objc::class!("MyClass") |
| 36 | +pub fn get_class() -> *mut () { |
| 37 | + unsafe extern "C" { |
| 38 | + #[rustc_objc_class = "MyClass"] |
| 39 | + safe static VAL: *mut (); |
| 40 | + } |
| 41 | + VAL |
36 | 42 | }
|
37 | 43 |
|
38 | 44 | #[no_mangle]
|
39 |
| -pub fn get_selector() -> objc::SEL { |
40 |
| - objc::selector!("myMethod") |
| 45 | +pub fn get_selector() -> *mut () { |
| 46 | + unsafe extern "C" { |
| 47 | + #[rustc_objc_selector = "myMethod"] |
| 48 | + safe static VAL: *mut (); |
| 49 | + } |
| 50 | + VAL |
41 | 51 | }
|
42 | 52 |
|
43 | 53 | // i686_apple_darwin: %struct._objc_module = type { i32, i32, ptr, ptr }
|
|
0 commit comments