Repository navigation
Preserve releases on discarded qubit allocations - #3904
Open
Ian Davis (idavis) wants to merge 1 commit into
Open
Ian Davis (idavis) wants to merge 1 commit into
Ian Davis (idavis) wants to merge 1 commit into
Conversation
Ian Davis (idavis)
added this pull request to stack #3892
October 7, 2026 12:51
Ian Davis (idavis)
requested a review
from Stefan J. Wernli (swernli)
as a code owner
October 7, 2026 12:52
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
The HIR qubit-allocation rewrite assumed that single-qubit and qubit-array allocations always used a named binding. Valid code such as
use _ = Qubit();oruse _ = Qubit[2];therefore triggered a compiler panic.Discarding the source-level binding does not remove the allocation's lifetime: the compiler must retain a reference so it can release the qubits when their scope ends, including on early exits.
Fix