From f8a5fa3c394bfad0894371a0c482db84b0bb06a3 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Thu, 14 Feb 2019 15:59:33 -0800 Subject: [PATCH] Use anchored import paths Not sure how this was compiling before? --- src/ir/mod.rs | 10 +++++----- src/module/functions/local_function/emit.rs | 16 ++++++++-------- src/module/functions/local_function/mod.rs | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ir/mod.rs b/src/ir/mod.rs index fbbc897f..78c1febd 100644 --- a/src/ir/mod.rs +++ b/src/ir/mod.rs @@ -732,7 +732,7 @@ pub enum ExtendedLoad { impl LoadKind { /// Returns the number of bytes loaded pub fn width(&self) -> u32 { - use LoadKind::*; + use self::LoadKind::*; match self { I32_8 { .. } | I64_8 { .. } => 1, I32_16 { .. } | I64_16 { .. } => 2, @@ -744,7 +744,7 @@ impl LoadKind { /// Returns if this is an atomic load pub fn atomic(&self) -> bool { - use LoadKind::*; + use self::LoadKind::*; match self { I32_8 { kind } | I32_16 { kind } @@ -786,7 +786,7 @@ pub enum StoreKind { impl StoreKind { /// Returns the number of bytes stored pub fn width(&self) -> u32 { - use StoreKind::*; + use self::StoreKind::*; match self { I32_8 { .. } | I64_8 { .. } => 1, I32_16 { .. } | I64_16 { .. } => 2, @@ -798,7 +798,7 @@ impl StoreKind { /// Returns whether this is an atomic store pub fn atomic(&self) -> bool { - use StoreKind::*; + use self::StoreKind::*; match self { I32 { atomic } @@ -851,7 +851,7 @@ pub enum AtomicWidth { impl AtomicWidth { /// Returns the size, in bytes, of this atomic operation pub fn bytes(&self) -> u32 { - use AtomicWidth::*; + use self::AtomicWidth::*; match self { I32_8 | I64_8 => 1, I32_16 | I64_16 => 2, diff --git a/src/module/functions/local_function/emit.rs b/src/module/functions/local_function/emit.rs index 02aa8c5c..bfa5f129 100644 --- a/src/module/functions/local_function/emit.rs +++ b/src/module/functions/local_function/emit.rs @@ -136,7 +136,7 @@ impl Emit<'_, '_> { } Binop(e) => { - use BinaryOp::*; + use crate::ir::BinaryOp::*; self.visit(e.lhs); self.visit(e.rhs); @@ -229,7 +229,7 @@ impl Emit<'_, '_> { } Unop(e) => { - use UnaryOp::*; + use crate::ir::UnaryOp::*; self.visit(e.expr); let opcode = match e.op { @@ -381,8 +381,8 @@ impl Emit<'_, '_> { } Load(e) => { - use ExtendedLoad::*; - use LoadKind::*; + use crate::ir::ExtendedLoad::*; + use crate::ir::LoadKind::*; self.visit(e.address); match e.kind { I32 { atomic: false } => self.encoder.byte(0x28), // i32.load @@ -422,7 +422,7 @@ impl Emit<'_, '_> { } Store(e) => { - use StoreKind::*; + use crate::ir::StoreKind::*; self.visit(e.address); self.visit(e.value); match e.kind { @@ -448,8 +448,8 @@ impl Emit<'_, '_> { } AtomicRmw(e) => { - use AtomicOp::*; - use AtomicWidth::*; + use crate::ir::AtomicOp::*; + use crate::ir::AtomicWidth::*; self.visit(e.address); self.visit(e.value); @@ -509,7 +509,7 @@ impl Emit<'_, '_> { } Cmpxchg(e) => { - use AtomicWidth::*; + use crate::ir::AtomicWidth::*; self.visit(e.address); self.visit(e.expected); diff --git a/src/module/functions/local_function/mod.rs b/src/module/functions/local_function/mod.rs index b8892904..74575ae9 100644 --- a/src/module/functions/local_function/mod.rs +++ b/src/module/functions/local_function/mod.rs @@ -324,8 +324,8 @@ impl DotExpr<'_, '_> { } fn validate_instruction(ctx: &mut FunctionContext, inst: Operator) -> Result<()> { - use ExtendedLoad::*; - use ValType::*; + use crate::ir::ExtendedLoad::*; + use crate::ValType::*; let const_ = |ctx: &mut FunctionContext, ty, value| { let expr = ctx.func.alloc(Const { value });