diff --git a/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.exp b/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.exp index 21191ffa107a6d..739b14b80441db 100644 --- a/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.exp +++ b/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.exp @@ -5,6 +5,6 @@ Error: error[E04024]: invalid usage of function type ┌─ TEMPFILE:9:62 │ 9 │ public fun for_each_ref(v: &vector, f: |&Element|) { - │ ^^^^^^^^^^ function type only allowed for inline function arguments + │ ^^^^^^^^^^ function-typed values only allowed for inline function arguments diff --git a/third_party/move/move-compiler-v2/src/env_pipeline/function_checker.rs b/third_party/move/move-compiler-v2/src/env_pipeline/function_checker.rs index c70cc293aeb7a1..16e04625ed8fb5 100644 --- a/third_party/move/move-compiler-v2/src/env_pipeline/function_checker.rs +++ b/third_party/move/move-compiler-v2/src/env_pipeline/function_checker.rs @@ -43,9 +43,9 @@ fn identify_function_types_with_functions_in_args(func_returns: Vec) -> Ve // Takes a list of function-typed parameters, along with argument and result type // Returns a list of any parameters whose result type has a function value, along with that result type. -fn identify_function_typed_params_with_functions_in_rets<'a>( - func_params: Vec<&'a Parameter>, -) -> Vec<(&'a Parameter, &'a Type)> { +fn identify_function_typed_params_with_functions_in_rets( + func_params: Vec<&Parameter>, +) -> Vec<(&Parameter, &Type)> { func_params .iter() .filter_map(|param| { diff --git a/third_party/move/move-compiler-v2/src/env_pipeline/recursive_struct_checker.rs b/third_party/move/move-compiler-v2/src/env_pipeline/recursive_struct_checker.rs index 1246ac0ea5ba0f..987a182f663d5e 100644 --- a/third_party/move/move-compiler-v2/src/env_pipeline/recursive_struct_checker.rs +++ b/third_party/move/move-compiler-v2/src/env_pipeline/recursive_struct_checker.rs @@ -117,12 +117,11 @@ impl<'a> RecursiveStructChecker<'a> { struct_name, struct_name, ); - self.mod_env - .env - .error_with_labels(&struct_env.get_loc(), "cyclic data", vec![( - field_env.get_loc().clone(), - note, - )]); + self.mod_env.env.error_with_labels( + &struct_env.get_loc(), + "cyclic data", + vec![(field_env.get_loc().clone(), note)], + ); } /// Report cyclic dependency of structs @@ -195,7 +194,7 @@ impl<'a> RecursiveStructChecker<'a> { .iter() .any(|ty| self.ty_contains_struct(path, ty, loc.clone(), struct_id, checked)) }, - Type::Primitive(_) | Type::TypeParameter(_) => false, + Type::Primitive(_) | Type::TypeParameter(_) | Type::Fun(..) => false, _ => panic!("ICE: {:?} used as a type parameter", ty), } } diff --git a/third_party/move/move-compiler-v2/src/file_format_generator/module_generator.rs b/third_party/move/move-compiler-v2/src/file_format_generator/module_generator.rs index b371d7f17cf2e4..483020e61a99eb 100644 --- a/third_party/move/move-compiler-v2/src/file_format_generator/module_generator.rs +++ b/third_party/move/move-compiler-v2/src/file_format_generator/module_generator.rs @@ -366,8 +366,6 @@ impl ModuleGenerator { } }, Fun(_param_ty, _result_ty) => { - // let _param_ty = Box::new(self.signature_token(ctx, loc, param_ty)); - // let _result_ty = Box::new(self.signature_token(ctx, loc, result_ty)); // TODO(LAMBDA) ctx.error( loc, diff --git a/third_party/move/move-compiler/tests/move_check/typing/lambda_returning_lambda2.exp b/third_party/move/move-compiler/tests/move_check/typing/lambda_returning_lambda2.exp index 3c0588535c6aaf..a14e1a5ff0d5c2 100644 --- a/third_party/move/move-compiler/tests/move_check/typing/lambda_returning_lambda2.exp +++ b/third_party/move/move-compiler/tests/move_check/typing/lambda_returning_lambda2.exp @@ -1,12 +1,6 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/lambda_returning_lambda2.move:10:9 - │ - 3 │ public inline fun foreach_caller2(_v: &vector, _action: ||(u64)) { - │ ----- Expected: 'u64' - · -10 │ foreach_caller2(&v, ||(|e| sum = sum + *e)) // expected to be not implemented - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '|&{integer}|()' - │ Invalid call of '0x8675309::M::foreach_caller2'. Invalid argument for parameter '_action' +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/lambda_returning_lambda2.move:9:13 + │ +9 │ let sum = 0; + │ ^^^ Unused assignment or binding for local 'sum'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_sum')