From e1f6ac5df61bae6ad0180fec635b9bc435454b33 Mon Sep 17 00:00:00 2001 From: Minseong Jang Date: Tue, 22 Feb 2022 22:17:08 +0900 Subject: [PATCH] Remove `#[allow(dead_code)]` --- src/c/parse.rs | 1 - src/ir/interp.rs | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/c/parse.rs b/src/c/parse.rs index cc2ec9e..be67b7d 100644 --- a/src/c/parse.rs +++ b/src/c/parse.rs @@ -12,7 +12,6 @@ use crate::Translate; #[derive(Debug)] pub enum Error { ParseError(ParseError), - #[allow(dead_code)] Unsupported, } diff --git a/src/ir/interp.rs b/src/ir/interp.rs index 3efbaa1..966ced1 100644 --- a/src/ir/interp.rs +++ b/src/ir/interp.rs @@ -10,24 +10,17 @@ use itertools::izip; use crate::ir::*; use crate::*; -// TODO: delete `allow(dead_code)` -/// Even though `Undef`, `Int`, `Float` are constructed and actively used at run-time, -/// the rust compiler analyzes these elements are dead code. -/// For this reason, we add `allow(dead_code)` mark above these elements respectively. #[derive(Debug, PartialEq, Clone)] pub enum Value { - #[allow(dead_code)] Undef { dtype: Dtype, }, Unit, - #[allow(dead_code)] Int { value: u128, width: usize, is_signed: bool, }, - #[allow(dead_code)] Float { /// `value` may be `f32`, but it is possible to consider it as `f64`. /// @@ -358,8 +351,8 @@ impl RegisterMap { } } -#[derive(Default, Debug, PartialEq, Clone)] /// Bidirectional map between the name of a global variable and memory box id +#[derive(Default, Debug, PartialEq, Clone)] struct GlobalMap { /// Map name of a global variable to memory box id /// @@ -806,15 +799,10 @@ mod calculator { } } -// TODO: delete `allow(dead_code)` -/// Even though `Pointer` variant is constructed and actively used at run-time, -/// the rust compiler analyzes it is dead code. -/// For this reason, we add `allow(dead_code)` mark. #[derive(Debug, PartialEq, Eq, Hash, Clone)] enum Byte { Undef, Concrete(u8), - #[allow(dead_code)] Pointer { bid: Option, offset: isize,