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

Use StackedContexts class in lieu of TypeCheckContext::block_stack #3284

Open
CohenArthur opened this issue Dec 3, 2024 · 1 comment · May be fixed by #3305
Open

Use StackedContexts class in lieu of TypeCheckContext::block_stack #3284

CohenArthur opened this issue Dec 3, 2024 · 1 comment · May be fixed by #3305

Comments

@CohenArthur
Copy link
Member

The class is available in https://github.com/Rust-GCC/gccrs/blob/master/gcc/rust/util/rust-stacked-contexts.h

You can include the header and remove the block_stack member of the TypeCheckContext class, and replace it with a StackedContexts member instead. You should also remove the associated methods for popping and pushing to the old context.

@Kamiinarii78
Copy link

Is anyone on it ? If not, i can take care of it.

snprajwal added a commit to snprajwal/gccrs that referenced this issue Dec 16, 2024
Replaces the DIY vector stack with a StackedContexts object.

Closes Rust-GCC#3284.

Signed-off-by: Prajwal S N <[email protected]>
@snprajwal snprajwal linked a pull request Dec 16, 2024 that will close this issue
snprajwal added a commit to snprajwal/gccrs that referenced this issue Dec 16, 2024
Replaces the DIY vector stack with a StackedContexts object for block
scopes in the type checker context.

Fixes Rust-GCC#3284.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check.h (class TypeCheckContext): add
	header file and use StackedContexts for blocks
	* typecheck/rust-typecheck-context.cc: update methods
	* typecheck/rust-hir-trait-resolve.cc: refactor function calls
	* typecheck/rust-hir-type-check-implitem.cc: refactor function calls
	* typecheck/rust-hir-type-check-type.cc: refactor function calls

Signed-off-by: Prajwal S N <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants