Skip to content

Commit

Permalink
Update Cranelift
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Mar 1, 2021
1 parent 86c5944 commit 27a5f4f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,22 @@ impl <T: PartialEq> PartialEq for Option<T> {
}
}

#[lang = "shl"]
pub trait Shl<RHS = Self> {
type Output;

#[must_use]
fn shl(self, rhs: RHS) -> Self::Output;
}

impl Shl for u128 {
type Output = u128;

fn shl(self, rhs: u128) -> u128 {
self << rhs
}
}

#[lang = "neg"]
pub trait Neg {
type Output;
Expand Down
3 changes: 3 additions & 0 deletions example/mini_core_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ fn main() {
assert_eq!(f2 as i8, -128);
assert_eq!(f2 as u8, 0);

let amount = 0;
assert_eq!(1u128 << amount, 1);

static ANOTHER_STATIC: &u8 = &A_STATIC;
assert_eq!(*ANOTHER_STATIC, 42);

Expand Down

0 comments on commit 27a5f4f

Please sign in to comment.