11use super :: exprs:: * ;
22use super :: * ;
3- use crate :: rules :: eval:: operators:: Comparator ;
4- use crate :: rules :: eval_context:: { block_scope, resolve_function, ValueScope } ;
5- use crate :: rules :: path_value:: compare_eq;
3+ use crate :: eval:: operators:: Comparator ;
4+ use crate :: eval_context:: { block_scope, resolve_function, ValueScope } ;
5+ use crate :: path_value:: compare_eq;
66use std:: collections:: HashMap ;
77
88mod operators;
@@ -1010,31 +1010,31 @@ pub(super) fn real_binary_operation<'value, 'loc: 'value>(
10101010 QueryResult :: Literal ( l) | QueryResult :: Resolved ( l) => {
10111011 let r = match cmp {
10121012 ( CmpOperator :: Eq , is_not) => each_lhs_compare (
1013- not_compare ( crate :: rules :: path_value:: compare_eq, is_not) ,
1013+ not_compare ( crate :: path_value:: compare_eq, is_not) ,
10141014 Rc :: clone ( l) ,
10151015 rhs,
10161016 ) ?,
10171017
10181018 ( CmpOperator :: Ge , is_not) => each_lhs_compare (
1019- not_compare ( crate :: rules :: path_value:: compare_ge, is_not) ,
1019+ not_compare ( crate :: path_value:: compare_ge, is_not) ,
10201020 Rc :: clone ( l) ,
10211021 rhs,
10221022 ) ?,
10231023
10241024 ( CmpOperator :: Gt , is_not) => each_lhs_compare (
1025- not_compare ( crate :: rules :: path_value:: compare_gt, is_not) ,
1025+ not_compare ( crate :: path_value:: compare_gt, is_not) ,
10261026 Rc :: clone ( l) ,
10271027 rhs,
10281028 ) ?,
10291029
10301030 ( CmpOperator :: Lt , is_not) => each_lhs_compare (
1031- not_compare ( crate :: rules :: path_value:: compare_lt, is_not) ,
1031+ not_compare ( crate :: path_value:: compare_lt, is_not) ,
10321032 Rc :: clone ( l) ,
10331033 rhs,
10341034 ) ?,
10351035
10361036 ( CmpOperator :: Le , is_not) => each_lhs_compare (
1037- not_compare ( crate :: rules :: path_value:: compare_le, is_not) ,
1037+ not_compare ( crate :: path_value:: compare_le, is_not) ,
10381038 Rc :: clone ( l) ,
10391039 rhs,
10401040 ) ?,
@@ -1075,7 +1075,7 @@ pub(super) fn real_binary_operation<'value, 'loc: 'value>(
10751075}
10761076
10771077#[ allow( clippy:: never_loop) ]
1078- pub ( in crate :: rules ) fn eval_guard_access_clause < ' value , ' loc : ' value > (
1078+ pub fn eval_guard_access_clause < ' value , ' loc : ' value > (
10791079 gac : & ' value GuardAccessClause < ' loc > ,
10801080 resolver : & mut dyn EvalContext < ' value , ' loc > ,
10811081) -> Result < Status > {
@@ -1224,7 +1224,7 @@ pub(in crate::rules) fn eval_guard_access_clause<'value, 'loc: 'value>(
12241224 }
12251225}
12261226
1227- pub ( in crate :: rules ) fn eval_guard_named_clause < ' value , ' loc : ' value > (
1227+ pub fn eval_guard_named_clause < ' value , ' loc : ' value > (
12281228 gnc : & ' value GuardNamedRuleClause < ' loc > ,
12291229 resolver : & mut dyn EvalContext < ' value , ' loc > ,
12301230) -> Result < Status > {
@@ -1288,7 +1288,7 @@ pub(in crate::rules) fn eval_guard_named_clause<'value, 'loc: 'value>(
12881288 }
12891289}
12901290
1291- pub ( in crate :: rules ) fn eval_general_block_clause < ' value , ' loc : ' value , T , E > (
1291+ pub fn eval_general_block_clause < ' value , ' loc : ' value , T , E > (
12921292 block : & ' value Block < ' loc , T > ,
12931293 resolver : & mut dyn EvalContext < ' value , ' loc > ,
12941294 eval_fn : E ,
@@ -1300,7 +1300,7 @@ where
13001300 eval_conjunction_clauses ( & block. conjunctions , & mut block_scope, eval_fn)
13011301}
13021302
1303- pub ( in crate :: rules ) fn eval_guard_block_clause < ' value , ' loc : ' value > (
1303+ pub fn eval_guard_block_clause < ' value , ' loc : ' value > (
13041304 block_clause : & ' value BlockGuardClause < ' loc > ,
13051305 resolver : & mut dyn EvalContext < ' value , ' loc > ,
13061306) -> Result < Status > {
@@ -1571,7 +1571,7 @@ impl<'eval, 'value, 'loc: 'value> RecordTracer<'value>
15711571 }
15721572}
15731573
1574- pub ( in crate :: rules ) fn eval_parameterized_rule_call < ' value , ' loc : ' value > (
1574+ pub fn eval_parameterized_rule_call < ' value , ' loc : ' value > (
15751575 call_rule : & ' value ParameterizedNamedRuleClause < ' loc > ,
15761576 resolver : & mut dyn EvalContext < ' value , ' loc > ,
15771577) -> Result < Status > {
@@ -1617,7 +1617,7 @@ pub(in crate::rules) fn eval_parameterized_rule_call<'value, 'loc: 'value>(
16171617 eval_rule ( & param_rule. rule , & mut eval)
16181618}
16191619
1620- pub ( in crate :: rules ) fn eval_guard_clause < ' value , ' loc : ' value > (
1620+ pub fn eval_guard_clause < ' value , ' loc : ' value > (
16211621 gc : & ' value GuardClause < ' loc > ,
16221622 resolver : & mut dyn EvalContext < ' value , ' loc > ,
16231623) -> Result < Status > {
@@ -1635,7 +1635,7 @@ pub(in crate::rules) fn eval_guard_clause<'value, 'loc: 'value>(
16351635 }
16361636}
16371637
1638- pub ( in crate :: rules ) fn eval_when_clause < ' value , ' loc : ' value > (
1638+ pub fn eval_when_clause < ' value , ' loc : ' value > (
16391639 when_clause : & ' value WhenGuardClause < ' loc > ,
16401640 resolver : & mut dyn EvalContext < ' value , ' loc > ,
16411641) -> Result < Status > {
@@ -1646,7 +1646,7 @@ pub(in crate::rules) fn eval_when_clause<'value, 'loc: 'value>(
16461646 }
16471647}
16481648
1649- pub ( in crate :: rules ) fn eval_type_block_clause < ' value , ' loc : ' value > (
1649+ pub fn eval_type_block_clause < ' value , ' loc : ' value > (
16501650 type_block : & ' value TypeBlock < ' loc > ,
16511651 resolver : & mut dyn EvalContext < ' value , ' loc > ,
16521652) -> Result < Status > {
@@ -1821,7 +1821,7 @@ pub(in crate::rules) fn eval_type_block_clause<'value, 'loc: 'value>(
18211821 Ok ( status)
18221822}
18231823
1824- pub ( in crate :: rules ) fn eval_rule_clause < ' value , ' loc : ' value > (
1824+ pub fn eval_rule_clause < ' value , ' loc : ' value > (
18251825 rule_clause : & ' value RuleClause < ' loc > ,
18261826 resolver : & mut dyn EvalContext < ' value , ' loc > ,
18271827) -> Result < Status > {
@@ -1834,7 +1834,7 @@ pub(in crate::rules) fn eval_rule_clause<'value, 'loc: 'value>(
18341834 }
18351835}
18361836
1837- pub ( in crate :: rules ) fn eval_rule < ' value , ' loc : ' value > (
1837+ pub fn eval_rule < ' value , ' loc : ' value > (
18381838 rule : & ' value Rule < ' loc > ,
18391839 resolver : & mut dyn EvalContext < ' value , ' loc > ,
18401840) -> Result < Status > {
@@ -1912,7 +1912,7 @@ impl<'loc> std::fmt::Display for RulesFile<'loc> {
19121912 }
19131913}
19141914
1915- pub ( crate ) fn eval_rules_file < ' value , ' loc : ' value > (
1915+ pub fn eval_rules_file < ' value , ' loc : ' value > (
19161916 rule : & ' value RulesFile < ' loc > ,
19171917 resolver : & mut dyn EvalContext < ' value , ' loc > ,
19181918 data_file_name : Option < & ' value str > ,
@@ -1968,7 +1968,7 @@ pub(crate) fn eval_rules_file<'value, 'loc: 'value>(
19681968}
19691969
19701970#[ allow( clippy:: never_loop) ]
1971- pub ( in crate :: rules ) fn eval_conjunction_clauses < ' value , ' loc : ' value , T , E > (
1971+ pub fn eval_conjunction_clauses < ' value , ' loc : ' value , T , E > (
19721972 conjunctions : & ' value Conjunctions < T > ,
19731973 resolver : & mut dyn EvalContext < ' value , ' loc > ,
19741974 eval_fn : E ,
@@ -1979,7 +1979,15 @@ where
19791979 Ok ( loop {
19801980 let mut num_passes = 0 ;
19811981 let mut num_fails = 0 ;
1982- let context = format ! ( "{}#disjunction" , std:: any:: type_name:: <T >( ) ) ;
1982+ let full_name = std:: any:: type_name :: < T > ( ) ;
1983+ let short_name = full_name
1984+ . rsplit ( "::" )
1985+ . next ( )
1986+ . unwrap_or ( full_name)
1987+ . split ( '<' )
1988+ . next ( )
1989+ . unwrap_or ( full_name) ;
1990+ let context = format ! ( "{}#disjunction" , short_name) ;
19831991 ' conjunction: for conjunction in conjunctions {
19841992 let mut num_of_disjunction_fails = 0 ;
19851993 let multiple_ors_present = conjunction. len ( ) > 1 ;
0 commit comments