From 58b626045d83a9092f8985877d76763e9014d51c Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Fri, 10 Mar 2023 11:00:38 +0100 Subject: [PATCH] post clippy fix --- hir/src/infer/factoid.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hir/src/infer/factoid.rs b/hir/src/infer/factoid.rs index 0eaf36f3e6..b288509fbe 100644 --- a/hir/src/infer/factoid.rs +++ b/hir/src/infer/factoid.rs @@ -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 { Only(T), - #[default] Any, } +// if T is not Default, autoderive wont work +#[allow(clippy::derivable_impls)] +impl Default for GenericFactoid { + fn default() -> Self { + GenericFactoid::Any + } +} + impl Copy for GenericFactoid {} impl Factoid for GenericFactoid {