Skip to content

Commit

Permalink
post clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Mar 12, 2023
1 parent 686b50a commit 58b6260
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hir/src/infer/factoid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,20 @@ pub trait Factoid: fmt::Debug + Clone + PartialEq + Default + Hash {

/// Partial information about a value of type T.
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[derive(Clone, PartialEq, Eq, Hash, Default)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub enum GenericFactoid<T: fmt::Debug + Clone + PartialEq + Hash> {
Only(T),
#[default]
Any,
}

// if T is not Default, autoderive wont work
#[allow(clippy::derivable_impls)]
impl<T: fmt::Debug + Clone + PartialEq + Hash> Default for GenericFactoid<T> {
fn default() -> Self {
GenericFactoid::Any
}
}

impl<T: Copy + Clone + fmt::Debug + PartialEq + Hash> Copy for GenericFactoid<T> {}

impl<T: fmt::Debug + Clone + PartialEq + Hash> Factoid for GenericFactoid<T> {
Expand Down

0 comments on commit 58b6260

Please sign in to comment.