From 853e995c99be2c6d5c1e8c8ab2f3e9b3c136204f Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 21 Oct 2016 09:56:55 -0700 Subject: [PATCH] Implement From for Imm64. This makes it possible to use literal integers as arguments to InstBuilder methods. --- lib/cretonne/src/ir/immediates.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs index e8d4a20773..0395d13f26 100644 --- a/lib/cretonne/src/ir/immediates.rs +++ b/lib/cretonne/src/ir/immediates.rs @@ -28,6 +28,12 @@ impl Into for Imm64 { } } +impl From for Imm64 { + fn from(x: i64) -> Self { + Imm64(x) + } +} + impl Display for Imm64 { fn fmt(&self, f: &mut Formatter) -> fmt::Result { let x = self.0;