about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-04-18 21:19:50 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-04-18 21:20:11 +0200
commit8f9a32aaf844174b26d7a39839c19c8f1c8d8cd0 (patch)
treea35977706d25d00f0103ab994f610d840dd2260d /example
parent22d3c0d70a023f3f1641b4b70e4b48949dcface3 (diff)
Merge commit 'db1a31c243a649e1fe20f5466ba181da5be35c14' into subtree-update_cg_gcc_2025-04-18
Diffstat (limited to 'example')
-rw-r--r--example/mini_core.rs48
1 files changed, 48 insertions, 0 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 5544aee9eaf..c554a87b825 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -51,6 +51,10 @@ impl<T: ?Sized> LegacyReceiver for &T {}
 impl<T: ?Sized> LegacyReceiver for &mut T {}
 impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
 
+#[lang = "receiver"]
+trait Receiver {
+}
+
 #[lang = "copy"]
 pub trait Copy {}
 
@@ -134,6 +138,14 @@ impl Mul for u8 {
     }
 }
 
+impl Mul for i32 {
+    type Output = Self;
+
+    fn mul(self, rhs: Self) -> Self::Output {
+        self * rhs
+    }
+}
+
 impl Mul for usize {
     type Output = Self;
 
@@ -142,6 +154,14 @@ impl Mul for usize {
     }
 }
 
+impl Mul for isize {
+    type Output = Self;
+
+    fn mul(self, rhs: Self) -> Self::Output {
+        self * rhs
+    }
+}
+
 #[lang = "add"]
 pub trait Add<RHS = Self> {
     type Output;
@@ -165,6 +185,14 @@ impl Add for i8 {
     }
 }
 
+impl Add for i32 {
+    type Output = Self;
+
+    fn add(self, rhs: Self) -> Self {
+        self + rhs
+    }
+}
+
 impl Add for usize {
     type Output = Self;
 
@@ -196,6 +224,14 @@ impl Sub for usize {
     }
 }
 
+impl Sub for isize {
+    type Output = Self;
+
+    fn sub(self, rhs: Self) -> Self {
+        self - rhs
+    }
+}
+
 impl Sub for u8 {
     type Output = Self;
 
@@ -220,6 +256,14 @@ impl Sub for i16 {
     }
 }
 
+impl Sub for i32 {
+    type Output = Self;
+
+    fn sub(self, rhs: Self) -> Self {
+        self - rhs
+    }
+}
+
 #[lang = "rem"]
 pub trait Rem<RHS = Self> {
     type Output;
@@ -628,6 +672,10 @@ pub mod libc {
         pub fn memcpy(dst: *mut u8, src: *const u8, size: usize);
         pub fn memmove(dst: *mut u8, src: *const u8, size: usize);
         pub fn strncpy(dst: *mut u8, src: *const u8, size: usize);
+        pub fn fflush(stream: *mut i32) -> i32;
+        pub fn exit(status: i32);
+
+        pub static stdout: *mut i32;
     }
 }