Refactored to use implicit insert and remove insert_type method from context object #3395
This solution resolves issue #3395 by refactoring the code to use implicit_insert_type instead of insert_type, improving clarity and eliminating the insert_type method from the context object. Changed files: * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_type): Remove. * typecheck/rust-hir-type-check.h: Remove declaration of insert_type method. * typecheck/rust-tyty-subst.cc: Replace all insert_type with insert_implicit_type. * typecheck/rust-tyty-util.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. * typecheck/rust-substitution-mapper.cc: Likewise. * typecheck/rust-hir-trait-resolve.cc: Likewise. * typecheck/rust-hir-type-check-base.cc: Likewise. * typecheck/rust-hir-type-check-enumitem.cc: Likewise. * typecheck/rust-hir-type-check-expr.cc: use Likewise. * typecheck/rust-hir-type-check-implitem.cc: Likewise. * typecheck/rust-hir-type-check-item.cc: use Likewise. * typecheck/rust-hir-type-check-pattern.cc: Likewise. * typecheck/rust-hir-type-check-stmt.cc: Likewise. * typecheck/rust-hir-type-check-struct.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-hir-type-check.cc: Likewise. * typecheck/rust-unify.cc: Likewise.
You don't have to keep recreating the PR, you can just force-push
Looks good, just missing the removal of a few insert_type calls
Looks good, just missing the removal of a few
insert_typecalls
Should I only remove the remaining ones, or should I replace them with insert_implicit_type?
Replace them with insert_implicit_type
FYI, changelog is not really correct. You should have things like:
* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::Resolve): use insert_implicit_type.
* typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_type): Remove.
(TypeCheckContext::compute_inference_variables): use insert_implicit_type.
...
You're not supposed to only point at the file where you've made changes, but to more precise "item" (function, type definition, etc).
Also, instead of repeating the same thing in sequence, you can use the idiomatic "Likewise" (have a look at existing entries in git log). Do not hesitate to ask for help if needed :)
@dkm can I use clang-format-13 or I must use version 10 because I have some problems in installing version 10
I use version 19, which only very rarely disagrees with version 10. You can always try it with version 13 and see if the CI complains
I use version 19, which only very rarely disagrees with version 10. You can always try it with version 13 and see if the CI complains
@powerboat9 Thanks! I tried it with version 13, and it works well. All tests passed successfully.
@dkm I wonder if pseudonyms are allowed for sign off
I think you need to fix your sign-off for DCO you are using a pseudonym
https://gcc.gnu.org/dco.html
I changed the sign-off to match the DCO.
I think you need to fix your sign-off for DCO you are using a pseudonym https://gcc.gnu.org/dco.html
I changed the sign-off to match the DCO.
erm, I thought they were going to relax this rule. At least, it was mentioned during last Cauldron I think.
(please note that my initial comment on changelog section still holds...)
I think you need to fix your sign-off for DCO you are using a pseudonym https://gcc.gnu.org/dco.html
I changed the sign-off to match the DCO.
erm, I thought they were going to relax this rule. At least, it was mentioned during last Cauldron I think.
(please note that my initial comment on changelog section still holds...)
sorry , but do you mean that i should make this : * typecheck/rust-hir-type-check.h: Remove declaration of insert_type method. like that : * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_type): Remove.
or do you mean that i don't mentioned which function exactly i changed it : * typecheck/rust-tyty-subst.cc: Replace all insert_type with insert_implicit_type.
(i don't mentioned functions because there are many of them so the change log will be huge)
Your git signoff line needs to mention your full name it cant be a username
Your git signoff line needs to mention your full name it cant be a username
Okay, I will use that: Mostafa Mahmoud Younis. But is there any further update in the message change log?