Remove #[allow(dead_code)]

This commit is contained in:
Minseong Jang
2022-02-22 22:17:08 +09:00
parent 23fab484f3
commit e1f6ac5df6
2 changed files with 1 additions and 14 deletions

View File

@@ -12,7 +12,6 @@ use crate::Translate;
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
ParseError(ParseError), ParseError(ParseError),
#[allow(dead_code)]
Unsupported, Unsupported,
} }

View File

@@ -10,24 +10,17 @@ use itertools::izip;
use crate::ir::*; use crate::ir::*;
use crate::*; 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)] #[derive(Debug, PartialEq, Clone)]
pub enum Value { pub enum Value {
#[allow(dead_code)]
Undef { Undef {
dtype: Dtype, dtype: Dtype,
}, },
Unit, Unit,
#[allow(dead_code)]
Int { Int {
value: u128, value: u128,
width: usize, width: usize,
is_signed: bool, is_signed: bool,
}, },
#[allow(dead_code)]
Float { Float {
/// `value` may be `f32`, but it is possible to consider it as `f64`. /// `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 /// Bidirectional map between the name of a global variable and memory box id
#[derive(Default, Debug, PartialEq, Clone)]
struct GlobalMap { struct GlobalMap {
/// Map name of a global variable to memory box id /// 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)] #[derive(Debug, PartialEq, Eq, Hash, Clone)]
enum Byte { enum Byte {
Undef, Undef,
Concrete(u8), Concrete(u8),
#[allow(dead_code)]
Pointer { Pointer {
bid: Option<usize>, bid: Option<usize>,
offset: isize, offset: isize,