Skip to content

gccrs: Add size checking to SlicePattern#3913

Merged
philberty merged 1 commit into
Rust-GCC:masterfrom
Polygonalr:slicepattern-size-check
Jul 12, 2025
Merged

gccrs: Add size checking to SlicePattern#3913
philberty merged 1 commit into
Rust-GCC:masterfrom
Polygonalr:slicepattern-size-check

Conversation

@Polygonalr

Copy link
Copy Markdown
Contributor

Previously not possible without const folding of array capacities. Since that issue has been resolved with #3889 (Thanks @philberty!), it is now possible to check whether the capacity of the array parent matches the size of a SlicePattern during compile time.

This is part of implementing support for SlicePattern, compilation of the pattern will be next.

@Polygonalr Polygonalr force-pushed the slicepattern-size-check branch 5 times, most recently from 92ac8f6 to 76ba938 Compare July 12, 2025 05:41
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc(TypeCheckPattern::visit(SlicePattern)):
		Implement size checking for SlicePattern when type checking against array parent

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
@Polygonalr Polygonalr force-pushed the slicepattern-size-check branch from 76ba938 to 4cce134 Compare July 12, 2025 06:04

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added this pull request to the merge queue Jul 12, 2025
Merged via the queue into Rust-GCC:master with commit 5dc8c4d Jul 12, 2025
13 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libcore 1.49 Jul 12, 2025
@Polygonalr Polygonalr deleted the slicepattern-size-check branch August 2, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants