Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra insert_trait_implementation_for_type #5004

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading