@@ -53,14 +53,6 @@ pub mod tls;
53
53
54
54
pub type Identifier = InternedString ;
55
55
56
- pub trait IsCoinductive {
57
- /// Convert to a dyn trait value representing `self`. This is a
58
- /// workaround for the lack of proper upcasting in Rust.
59
- fn as_dyn ( & self ) -> & dyn IsCoinductive ;
60
-
61
- fn is_coinductive_trait ( & self , trait_id : TraitId ) -> bool ;
62
- }
63
-
64
56
#[ derive( Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
65
57
/// The set of assumptions we've made so far, and the current number of
66
58
/// universal (forall) quantifiers we're within.
@@ -925,16 +917,6 @@ impl<T> UCanonical<T> {
925
917
}
926
918
}
927
919
928
- impl UCanonical < InEnvironment < Goal > > {
929
- /// A goal has coinductive semantics if it is of the form `T: AutoTrait`, or if it is of the
930
- /// form `WellFormed(T: Trait)` where `Trait` is any trait. The latter is needed for dealing
931
- /// with WF requirements and cyclic traits, which generates cycles in the proof tree which must
932
- /// not be rejected but instead must be treated as a success.
933
- pub fn is_coinductive ( & self , program : & dyn IsCoinductive ) -> bool {
934
- self . canonical . value . goal . is_coinductive ( program)
935
- }
936
- }
937
-
938
920
#[ derive( Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
939
921
/// A general goal; this is the full range of questions you can pose to Chalk.
940
922
pub enum Goal {
@@ -999,18 +981,6 @@ impl Goal {
999
981
pub fn implied_by ( self , predicates : Vec < ProgramClause > ) -> Goal {
1000
982
Goal :: Implies ( predicates, Box :: new ( self ) )
1001
983
}
1002
-
1003
- pub fn is_coinductive ( & self , program : & dyn IsCoinductive ) -> bool {
1004
- match self {
1005
- Goal :: Leaf ( LeafGoal :: DomainGoal ( DomainGoal :: Holds ( wca) ) ) => match wca {
1006
- WhereClause :: Implemented ( tr) => program. is_coinductive_trait ( tr. trait_id ) ,
1007
- WhereClause :: ProjectionEq ( ..) => false ,
1008
- } ,
1009
- Goal :: Leaf ( LeafGoal :: DomainGoal ( DomainGoal :: WellFormed ( WellFormed :: Trait ( ..) ) ) ) => true ,
1010
- Goal :: Quantified ( QuantifierKind :: ForAll , goal) => goal. value . is_coinductive ( program) ,
1011
- _ => false ,
1012
- }
1013
- }
1014
984
}
1015
985
1016
986
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
0 commit comments