Do not clone return type

This commit is contained in:
Ayaz Hafiz 2022-11-09 11:26:24 -06:00
parent bd9c9cc184
commit d416b8b184
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -3826,11 +3826,9 @@ fn rec_defs_help(
);
let fn_type_index = {
// TODO(types-soa) optimize for variable
let lambda_set = types.from_old_type(&Type::Variable(closure_var));
// TODO(types-soa) remove clone
let ret = types
.clone_with_variable_substitutions(ret_type, &Default::default());
let typ = types.function(pattern_types, lambda_set, ret);
let typ = types.function(pattern_types, lambda_set, ret_type);
constraints.push_type(types, typ)
};
let body_type =