Implement From<i64> for Imm64.

This makes it possible to use literal integers as arguments to
InstBuilder methods.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-21 09:56:55 -07:00
parent 6aa3e4594a
commit 853e995c99

View File

@@ -28,6 +28,12 @@ impl Into<i64> for Imm64 {
} }
} }
impl From<i64> for Imm64 {
fn from(x: i64) -> Self {
Imm64(x)
}
}
impl Display for Imm64 { impl Display for Imm64 {
fn fmt(&self, f: &mut Formatter) -> fmt::Result { fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let x = self.0; let x = self.0;