]> git.lizzy.rs Git - rust.git/blobdiff - example/mini_core.rs
Pass command-line arguments to JITed function
[rust.git] / example / mini_core.rs
index 66314ab3e5d3e82863877a2c3bb424ece889fde8..b7277f5ee9f489867bedf15f32be363c47ccbd5a 100644 (file)
@@ -104,6 +104,14 @@ fn mul(self, rhs: Self) -> Self::Output {
     }
 }
 
+impl Mul for usize {
+    type Output = Self;
+
+    fn mul(self, rhs: Self) -> Self::Output {
+        self * rhs
+    }
+}
+
 #[lang = "add"]
 pub trait Add<RHS = Self> {
     type Output;
@@ -208,6 +216,15 @@ fn ne(&self, other: &usize) -> bool {
     }
 }
 
+impl PartialEq for isize {
+    fn eq(&self, other: &isize) -> bool {
+        (*self) == (*other)
+    }
+    fn ne(&self, other: &isize) -> bool {
+        (*self) != (*other)
+    }
+}
+
 impl PartialEq for char {
     fn eq(&self, other: &char) -> bool {
         (*self) == (*other)