Skip to content

Refactor this to use the implicit insert #3395

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

Open
philberty opened this issue Jan 29, 2025 · 3 comments
Open

Refactor this to use the implicit insert #3395

philberty opened this issue Jan 29, 2025 · 3 comments

Comments

@philberty
Copy link
Member

philberty commented Jan 29, 2025

We are calling insert type using the node mappings helper but this should be calling insert_implicit_type so we just pass the hirid through which is much cleaner

Analysis::NodeMapping (0, 0, mapper.resolved->get_ty_ref (), 0),

context->insert_type (Analysis::NodeMapping (0, 0,

@Harishankar14
Copy link

Hey @philberty,can i work on this issue? //
Refactor to use insert_implicit_type instead of insert_type for cleaner handling.
This change will simplify the code by passing the hirid directly without using NodeMapping.

@mostafa630
Copy link

Hi @philberty , I'd like to work on this issue. Could you please assign it to me?

@P-E-P P-E-P linked a pull request Mar 5, 2025 that will close this issue
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 5, 2025
…the context object (Rust-GCC#3395)

gcc/rust/ChangeLog:

    * typecheck/rust-substitution-mapper.cc: Refactored code to use
      insert_implicit_type instead of insert_type.
    * typecheck/rust-hir-type-check.h: Removed declaration of insert_type
      from TypeCheckContext class.
    * typecheck/rust-typecheck-context.cc: Removed definition of insert_type.

Signed-off-by: sasa630 <[email protected]>
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 6, 2025
…the context object (Rust-GCC#3395)

gcc/rust/ChangeLog:

	 * typecheck/rust-substitution-mapper.cc: Refactored code to use insert_implicit_type instead of insert_type.
	 * typecheck/rust-hir-type-check.h: Removed declaration of insert_type from TypeCheckContext class.
	 * typecheck/rust-typecheck-context.cc: Removed definition of insert_type.

Signed-off-by: sasa630 <[email protected]>

follow code format
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 6, 2025
…the context object (Rust-GCC#3395)

gcc/rust/ChangeLog:

	* typecheck/rust-substitution-mapper.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check.h: Removed declaration of insert_type method.
	* typecheck/rust-typecheck-context.cc: Removed definition of insert_type.
	* typecheck/rust-hir-trait-resolve.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-base.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-enumitem.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-expr.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-implitem.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-item.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-pattern.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-stmt.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-struct.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check-type.cc: use insert_implicit_type.
	* typecheck/rust-hir-type-check.cc: use insert_implicit_type.
	* typecheck/rust-typecheck-context.cc: use insert_implicit_type.
	* typecheck/rust-tyty-subst.cc: use insert_implicit_type.
	* typecheck/rust-tyty-util.cc: use insert_implicit_type.
	* typecheck/rust-tyty.cc: use insert_implicit_type.
	* typecheck/rust-unify.cc: use insert_implicit_type.

Signed-off-by: sasa630 <[email protected]>
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 6, 2025
…ject (Rust-GCC#3395)

gcc/rust/ChangeLog:

	* 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.

Signed-off-by: sasa630 <[email protected]>
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 7, 2025
…ject (Rust-GCC#3395)

gcc/rust/ChangeLog:

	* 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.

Signed-off-by: sasa630 <[email protected]>
@mostafa630
Copy link

@philberty Thanks for the opportunity! I just made a pull request [PR #3489], and all tests passed successfully.

mostafa630 added a commit to mostafa630/gccrs that referenced this issue Mar 14, 2025
…ject (Rust-GCC#3395)

gcc/rust/ChangeLog:

	* 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.

Signed-off-by: mostafayounis <[email protected]>
mostafa630 added a commit to mostafa630/gccrs that referenced this issue Apr 2, 2025
…ject (Rust-GCC#3395)

gcc/rust/ChangeLog:

	* 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.

Signed-off-by: Mostafa Mahmoud Younis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

3 participants