File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
third_party/move/tools/move-linter/src/model_ast_lints Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 20
20
use move_compiler_v2:: external_checks:: ExpChecker ;
21
21
use move_model:: {
22
22
ast:: { Exp , ExpData , Operation } ,
23
- model:: GlobalEnv ,
23
+ model:: FunctionEnv ,
24
24
} ;
25
25
use ExpData :: Call ;
26
26
use Operation :: { And , Not , Or } ;
@@ -144,11 +144,13 @@ impl SimplerBoolExpression {
144
144
145
145
if is_negation_pair ( left, right) || is_negation_pair ( right, left) {
146
146
let result_value = matches ! ( op, Or ) ;
147
- Some ( if result_value {
148
- SimplerBoolPatternType :: Tautology
149
- } else {
150
- SimplerBoolPatternType :: Contradiction
151
- } )
147
+ Some (
148
+ if result_value {
149
+ SimplerBoolPatternType :: Tautology
150
+ } else {
151
+ SimplerBoolPatternType :: Contradiction
152
+ } ,
153
+ )
152
154
} else {
153
155
None
154
156
}
@@ -210,7 +212,9 @@ impl ExpChecker for SimplerBoolExpression {
210
212
"simpler_bool_expression" . to_string ( )
211
213
}
212
214
213
- fn visit_expr_pre ( & mut self , env : & GlobalEnv , expr : & ExpData ) {
215
+ fn visit_expr_pre ( & mut self , function_env : & FunctionEnv < ' _ > , expr : & ExpData ) {
216
+ let env = function_env. env ( ) ;
217
+
214
218
let Call ( id, op, args) = expr else { return } ;
215
219
216
220
let pattern = match op {
You can’t perform that action at this time.
0 commit comments