diff --git a/crates/fayalite/src/lib.rs b/crates/fayalite/src/lib.rs index 9192645..6e1ccd3 100644 --- a/crates/fayalite/src/lib.rs +++ b/crates/fayalite/src/lib.rs @@ -30,7 +30,6 @@ pub struct __; #[cfg(feature = "unstable-doc")] pub mod _docs; -// FIXME: finish pub mod annotations; pub mod array; pub mod bundle; @@ -50,5 +49,4 @@ pub mod source_location; pub mod testing; pub mod ty; pub mod util; -//pub mod valueless; pub mod wire; diff --git a/crates/fayalite/src/valueless.rs b/crates/fayalite/src/valueless.rs deleted file mode 100644 index d34905e..0000000 --- a/crates/fayalite/src/valueless.rs +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information -use crate::{ - int::{DynIntType, DynSIntType, DynUIntType, IntTypeTrait, SIntType}, - ty::{Type, Value}, -}; -use std::ops::RangeBounds; - -#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Default)] -pub struct Valueless { - pub ty: T, -} - -impl Valueless { - pub fn to_canonical(&self) -> Valueless { - Valueless { - ty: self.ty.canonical(), - } - } - pub fn from_canonical(v: Valueless) -> Self { - Valueless { - ty: T::from_canonical_type(v.ty), - } - } -} - -mod sealed { - pub trait Sealed {} -} - -pub trait ValuelessTr: sealed::Sealed { - type Type: Type; - type Value: Value; -} - -impl sealed::Sealed for Valueless {} - -impl ValuelessTr for Valueless { - type Type = T; - type Value = T::Value; -} - -impl Valueless { - pub fn signum(&self) -> Valueless> { - Valueless::default() - } - pub fn as_same_width_uint(self) -> Valueless { - Valueless { - ty: self.ty.as_same_width_uint(), - } - } - pub fn as_same_width_sint(self) -> Valueless { - Valueless { - ty: self.ty.as_same_width_sint(), - } - } - pub fn as_same_value_uint(self) -> Valueless { - Valueless { - ty: self.ty.as_same_value_uint(), - } - } - pub fn as_same_value_sint(self) -> Valueless { - Valueless { - ty: self.ty.as_same_value_sint(), - } - } - pub fn concat( - &self, - high_part: Valueless, - ) -> Valueless> { - let ty = DynIntType::new( - self.ty - .width() - .checked_add(high_part.ty.width()) - .expect("result has too many bits"), - ); - Valueless { ty } - } - pub fn repeat(&self, count: usize) -> Valueless> { - let width = self.ty.width(); - let ty = DynIntType::new(width.checked_mul(count).expect("result has too many bits")); - Valueless { ty } - } - pub fn slice>(&self, index: I) -> Valueless { - let ty = self.ty.slice(index); - Valueless { ty } - } -}