Do not clone return type

This commit is contained in:
Ayaz Hafiz 2022-11-09 09:28:27 -06:00
parent 9e09914be2
commit b0be1ed08e
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1717,11 +1717,7 @@ fn constrain_function_def(
let ret_var = function_def.return_type;
let closure_var = function_def.closure_type;
let ret_type_index = {
// TODO(types-soa) get rid of clone
let typ = types.clone_with_variable_substitutions(ret_type, &Default::default());
constraints.push_type(types, typ)
};
let ret_type_index = constraints.push_type(types, ret_type);
vars.push(ret_var);
vars.push(closure_var);