about summary refs log tree commit diff
path: root/example/mini_core.rs
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-03-30 18:22:43 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2019-08-01 11:49:03 +0200
commitc4af588f72c317a015f6e26bb7d25ae288096b91 (patch)
tree0b9ac69541826462afacc3f2719017e11d66cfe7 /example/mini_core.rs
parent2f0093b8c2f44f560dd51b26ac1c6bb902513ec7 (diff)
downloadrust-c4af588f72c317a015f6e26bb7d25ae288096b91.tar.gz
rust-c4af588f72c317a015f6e26bb7d25ae288096b91.zip
Correctly align all allocs
Fixes #348
Diffstat (limited to 'example/mini_core.rs')
-rw-r--r--example/mini_core.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 68e056b905f..f57f1ff635d 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -186,6 +186,21 @@ impl Sub for i16 {
     }
 }
 
+#[lang = "rem"]
+pub trait Rem<RHS = Self> {
+    type Output;
+
+    fn rem(self, rhs: RHS) -> Self::Output;
+}
+
+impl Rem for usize {
+    type Output = Self;
+
+    fn rem(self, rhs: Self) -> Self {
+        self % rhs
+    }
+}
+
 #[lang = "bitor"]
 pub trait BitOr<RHS = Self> {
     type Output;