Skip to content

Commit 27a5f4f

Browse files
committed
Update Cranelift
Fixes rust-lang#1143
1 parent 86c5944 commit 27a5f4f

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/mini_core.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,22 @@ impl <T: PartialEq> PartialEq for Option<T> {
365365
}
366366
}
367367

368+
#[lang = "shl"]
369+
pub trait Shl<RHS = Self> {
370+
type Output;
371+
372+
#[must_use]
373+
fn shl(self, rhs: RHS) -> Self::Output;
374+
}
375+
376+
impl Shl for u128 {
377+
type Output = u128;
378+
379+
fn shl(self, rhs: u128) -> u128 {
380+
self << rhs
381+
}
382+
}
383+
368384
#[lang = "neg"]
369385
pub trait Neg {
370386
type Output;

example/mini_core_hello_world.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ fn main() {
264264
assert_eq!(f2 as i8, -128);
265265
assert_eq!(f2 as u8, 0);
266266

267+
let amount = 0;
268+
assert_eq!(1u128 << amount, 1);
269+
267270
static ANOTHER_STATIC: &u8 = &A_STATIC;
268271
assert_eq!(*ANOTHER_STATIC, 42);
269272

0 commit comments

Comments
 (0)