Skip to content

Commit

Permalink
Remove extra insert_trait_implementation_for_type (#5004)
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-trunov authored Aug 24, 2023
1 parent baaae4d commit ae2a4b9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions sway-core/src/type_system/ast_elements/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ impl TypeCheckTypeBinding<ty::TyStructDecl> for TypeBinding<CallPath> {
)?;
// Insert the new copy into the declaration engine.
let new_struct_ref = ctx.engines.de().insert(new_copy);
// Take any trait items that apply to the old type and copy them to the new type.
let type_id = type_engine.insert(engines, TypeInfo::Struct(new_struct_ref.clone()));
ctx.namespace
.insert_trait_implementation_for_type(engines, type_id);
Ok((new_struct_ref, Some(type_id), None))
}
}
Expand Down Expand Up @@ -364,10 +361,7 @@ impl TypeCheckTypeBinding<ty::TyEnumDecl> for TypeBinding<CallPath> {
)?;
// Insert the new copy into the declaration engine.
let new_enum_ref = ctx.engines.de().insert(new_copy);
// Take any trait items that apply to the old type and copy them to the new type.
let type_id = type_engine.insert(engines, TypeInfo::Enum(new_enum_ref.clone()));
ctx.namespace
.insert_trait_implementation_for_type(engines, type_id);
Ok((new_enum_ref, Some(type_id), Some(unknown_decl)))
}
}
Expand Down

0 comments on commit ae2a4b9

Please sign in to comment.