diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-03-30 18:22:43 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-08-01 11:49:03 +0200 |
| commit | c4af588f72c317a015f6e26bb7d25ae288096b91 (patch) | |
| tree | 0b9ac69541826462afacc3f2719017e11d66cfe7 /example/mini_core.rs | |
| parent | 2f0093b8c2f44f560dd51b26ac1c6bb902513ec7 (diff) | |
| download | rust-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.rs | 15 |
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; |
