Skip to content

gccrs: Fix typechecking of block expression and labels#4665

Merged
philberty merged 1 commit into
masterfrom
phil/block-type-check
Jun 30, 2026
Merged

gccrs: Fix typechecking of block expression and labels#4665
philberty merged 1 commit into
masterfrom
phil/block-type-check

Conversation

@philberty

Copy link
Copy Markdown
Member

Tail expressions were always ignoring the context here and returning unit-type. This patch respects the label context here properly.

Fixes #4538

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): respect context for labels

gcc/testsuite/ChangeLog:

* rust/compile/issue-4538.rs: New test.

Tail expressions were always ignoring the context here and returning
unit-type. This patch respects the label context here properly.

Fixes #4538

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): respect context for labels

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4538.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
@philberty philberty force-pushed the phil/block-type-check branch from 27f6f2d to 9485722 Compare June 30, 2026 13:04
@philberty philberty added this pull request to the merge queue Jun 30, 2026
Merged via the queue into master with commit cbf5303 Jun 30, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libcore 1.49 Jun 30, 2026
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.

Failed to resolve Block type.

1 participant