Skip to content

Conversation

jennyQuantinuum
Copy link
Contributor

This PR is related to this deadcode issue found in eldarion.

In hugr-llvm, the previous implementation defaults all the llvm functions except for extern functions to have None linkage, and as a result, after the optimization passes in eldarion, there are some deadcode functions not being eliminated (without specifying linkage for the functions, llvm defaults them to external, and it won't eliminate those external functions even when they are not being used).

The proposed solution is to set the default linkage for llvm functions to be Private, enabling llvm to remove those deadcode functions.

lmondada and others added 22 commits June 24, 2025 15:44
…2300)

This PR provides serde serialization/deserialization support for
`SimpleReplacement` as well as the main types in the `PersistentHugr`
implementation as discussed in #2253.

This can also be used as a template for other types that require
ser/deser implementations in the future.

Closes #2253
#2306)

Bumps the patch group with 2 updates in the / directory:
[clap](https://github.com/clap-rs/clap) and
[clap-verbosity-flag](https://github.com/clap-rs/clap-verbosity-flag).

Updates `clap` from 4.5.38 to 4.5.39
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.39</h2>
<h2>[4.5.39] - 2025-05-27</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Show short flag aliases before long</li>
<li><em>(help)</em> Merge the short and long flag alias lists</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.39] - 2025-05-27</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Show short flag aliases before long</li>
<li><em>(help)</em> Merge the short and long flag alias lists</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/clap-rs/clap/commit/ed2360f9cdf9bb51477ace5cd79ac47794758086"><code>ed2360f</code></a>
chore: Release</li>
<li><a
href="https://github.com/clap-rs/clap/commit/196a14b8c958bd172365f7b82999a0102301380d"><code>196a14b</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/clap-rs/clap/commit/cd622ab63c43a6c07b25a1e914a6aebd4430b0e3"><code>cd622ab</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5846">#5846</a>
from ribru17/alias_fn_dedup</li>
<li><a
href="https://github.com/clap-rs/clap/commit/48ff72be28a0b563d15fc88cbb0e7e247fa33a02"><code>48ff72b</code></a>
fix(complete): Deduplicate bash subcmd cases</li>
<li><a
href="https://github.com/clap-rs/clap/commit/b1b6f17f610efc51a6ac1d18f471b918492c1ea7"><code>b1b6f17</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5843">#5843</a>
from epage/link</li>
<li><a
href="https://github.com/clap-rs/clap/commit/5900216569d0ed0b9967e930c996644e6b86a53b"><code>5900216</code></a>
fix(derive): Update link for derive attributes</li>
<li><a
href="https://github.com/clap-rs/clap/commit/fde45f9aea766fb8de46e3d46e6575f393c3b6b9"><code>fde45f9</code></a>
chore: Release</li>
<li><a
href="https://github.com/clap-rs/clap/commit/45d5d7edcb37d07affb9185b2a06a3bce40e6ea0"><code>45d5d7e</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/clap-rs/clap/commit/4b82b97cd9069dba864185d5c6147232f8ad4942"><code>4b82b97</code></a>
chore: Release</li>
<li><a
href="https://github.com/clap-rs/clap/commit/a982adfbbd369e19427fcc7e31be58bb8a9e2dac"><code>a982adf</code></a>
docs: Update changelog</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.38...clap_complete-v4.5.39">compare
view</a></li>
</ul>
</details>
<br />

Updates `clap-verbosity-flag` from 3.0.2 to 3.0.3
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap-verbosity-flag/blob/master/CHANGELOG.md">clap-verbosity-flag's
changelog</a>.</em></p>
<blockquote>
<h2>[3.0.3] - 2025-05-20</h2>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/7ac7bff71e3b02f09992ca616990b89c7ca02051"><code>7ac7bff</code></a>
chore: Release clap-verbosity-flag version 3.0.3</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/496f3ed5e7c09a67d6d6c08a2e7630b4b9c64894"><code>496f3ed</code></a>
docs(readme): Switch to console code blocks</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/6ca4f7adc1eda6cee5415f2844fcf523db6d77e5"><code>6ca4f7a</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/143">#143</a>
from joshka/jm/docs-tracing</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/352354610f95c53a29f261940fca7d4db6df5000"><code>3523546</code></a>
chore(deps): Update Rust Stable to v1.87 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/144">#144</a>)</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/cda60178099edf1b5a5457c0f3922e44859bd637"><code>cda6017</code></a>
docs: Document tracing support in README and lib.rs</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/d97ade1611850c5b07dedaa97f426ae260a87aed"><code>d97ade1</code></a>
chore(deps): Update Rust Stable to v1.86 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/141">#141</a>)</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/a58fde5b1a357c1820e0032c0d4b24dfa519ab8d"><code>a58fde5</code></a>
chore(deps): Update Rust crate clap to v4.5.31 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/140">#140</a>)</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/d5e646395c2ab3a4586a75904c0682079cd07e4c"><code>d5e6463</code></a>
chore(deps): Update Rust Stable to v1.85 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/139">#139</a>)</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/e8151159f52b2fdc8e725460f1c9abb1518462e8"><code>e815115</code></a>
chore(deps): Update Rust Stable to v1.84 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/137">#137</a>)</li>
<li><a
href="https://github.com/clap-rs/clap-verbosity-flag/commit/6b0a9d4107a4b5a9110824ff0f6724048b774019"><code>6b0a9d4</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/138">#138</a>
from epage/template</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap-verbosity-flag/compare/v3.0.2...v3.0.3">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
To move `PersistentHugr` out of `hugr-core`, I need to be able to
provide custom node labels to the mermaid printer. Whilst adding a field
for this to `RenderConfig` would not be breaking, the problem is that
such a field would have to be an `Option<HashMap>`, which is non-`Copy`
and non-`Hash`. That would be a breaking change to RenderConfig.

I have found a creative way around this here, keeping the Copy-able
`RenderConfig` and adding a `FullRenderConfig` struct with support for
`From` and `TryInto`.

Is this the preferred approach? How would I make a note that this ought
to be simplified ahead of the next breaking release?
The Python testing suite defined an extension named `pytest.quantum,`.
The `,` is not allowed as part of an extension name, making the model
import fail.
This PR fixes a bug in the Python model export: `Call` nodes referred to
themselves instead of the function to be called.
I don't believe any of these changes are breaking or cause serious
performance regressions but worth double checking. Should help with
determinism (avoiding future pit-falls even if not resolving any current
issues)
non exhaustive structs require constructors to be usable outside the
crate

---------

Co-authored-by: Agustín Borgna <[email protected]>
…#2336)

This should have been part of #2256 but some confusion dates from #2147.

Making a callgraph for only the functions beneath the entrypoint makes
no sense - that's either all the functions (if the entrypoint is the
root) or at most one of them (if the entrypoint is one of the
funcdefns). Of course, we didn't test with any Hugrs that had a
non-module-root entrypoint.... so the sensible thing to do now, seems to
be for callgraph to ignore the entrypoint. (We can optimize it looking
for FuncDefns tho, they are now easy to find.)

Dead function removal allowed specifying starting points for analysis
(top-level FuncDefns) but only if the Hugr's entrypoint was the module.
There seems no good reason not to allow specifying module-level
FuncDefns even if the entrypoint is lower, and similarly, we should use
the entrypoint as one starting point (perhaps among many) for
analysis...

(One could rename `entry_points` used by analysis to "starting_points"
but that would be breaking)
This PR fixes two bugs in the export to model in Python:
- `order_hint` metadata was generated for `dfg` regions but not included
in the result.
 - JSON metadata was not generated for module regions.
#2347)

Bumps the minor group with 3 updates in the / directory:
[proptest](https://github.com/proptest-rs/proptest),
[serde_with](https://github.com/jonasbb/serde_with) and
[bumpalo](https://github.com/fitzgen/bumpalo).

Updates `proptest` from 1.6.0 to 1.7.0
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/proptest-rs/proptest/commits">compare
view</a></li>
</ul>
</details>
<br />

Updates `serde_with` from 3.12.0 to 3.13.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jonasbb/serde_with/releases">serde_with's
releases</a>.</em></p>
<blockquote>
<h2>serde_with v3.13.0</h2>
<h3>Added</h3>
<ul>
<li>Added support for <code>schemars</code> v0.9.0 under the
<code>schemars_0_9</code> feature flag by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/849">#849</a>)</li>
<li>Introduce <code>SerializeDisplayAlt</code> derive macro (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/833">#833</a>)
An alternative to the <code>SerializeDisplay</code> macro except instead
of using the
plain formatting like <code>format!(&quot;{}&quot;, ...)</code>, it
serializes with the
<code>Formatter::alternate</code> flag set to true, like
<code>format!(&quot;{:#}&quot;, ...)</code></li>
</ul>
<h3>Changed</h3>
<ul>
<li>Generalize <code>serde_with::rust::unwrap_or_skip</code> to support
deserializing references by <a
href="https://github.com/beroal"><code>@​beroal</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/832">#832</a>)</li>
<li>Bump MSRV to 1.71, since that is required for the
<code>jsonschema</code> dev-dependency.</li>
<li>Make <code>serde_conv</code> available without the <code>std</code>
feature by <a href="https://github.com/arilou"><code>@​arilou</code></a>
(<a
href="https://redirect.github.com/jonasbb/serde_with/issues/839">#839</a>)</li>
<li>Bump MSRV to 1.74, since that is required for <code>schemars</code>
v0.9.0 by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/849">#849</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Make the <code>DurationSeconds</code> types and other variants more
accessible even without <code>std</code> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/845">#845</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/jonasbb/serde_with/commit/92ae7ad4b9e6f1ced3b2f00d641034ae0b56d662"><code>92ae7ad</code></a>
Bump version to 3.13.0 (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/855">#855</a>)</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/b14b17b08bb059e8e1408435340ac14416ae1aff"><code>b14b17b</code></a>
Bump version to 3.13.0</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/d75e9fb2ccec0dff563aab18121ec1638ac2ac51"><code>d75e9fb</code></a>
Update the feature documentation (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/854">#854</a>)</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/ad338d569cc4f22eedfbc5d896ac7c59a43c1a3e"><code>ad338d5</code></a>
Update the feature documentation</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/23aab788a0c6320187bed7704bc11171888815de"><code>23aab78</code></a>
Fix doc links (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/853">#853</a>)</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/c17c7815c63021de74108b9c23c6839ea765a695"><code>c17c781</code></a>
Fix min_properties handing in schemars v0.8 code (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/852">#852</a>)</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/619c2cb5cf313d923f51e43c8d6d44389d65f0bc"><code>619c2cb</code></a>
Fix doc links</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/188074ac5bcb51ef834ba9118cd6b772ebe94651"><code>188074a</code></a>
Fix min_properties handing in schemars v0.8 code</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/4dd13f2f6c34107cb89898fb6e680afe4db7b488"><code>4dd13f2</code></a>
Add support for schemars v0.9 (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/849">#849</a>)</li>
<li><a
href="https://github.com/jonasbb/serde_with/commit/c9b08afcfcdb4245fab705623e7c15c9af69bc85"><code>c9b08af</code></a>
Update expect tests with clippy doc changes</li>
<li>Additional commits viewable in <a
href="https://github.com/jonasbb/serde_with/compare/v3.12.0...v3.13.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `bumpalo` from 3.17.0 to 3.18.1
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md">bumpalo's
changelog</a>.</em></p>
<blockquote>
<h2>3.18.1</h2>
<p>Released 2025-06-05.</p>
<h3>Removed</h3>
<ul>
<li>Removed the <code>allocator-api2</code> version bump from 3.18.0, as
it was not actually
semver compatible.</li>
</ul>
<hr />
<h2>3.18.0 (yanked)</h2>
<p>Released 2025-06-05.</p>
<h3>Added</h3>
<ul>
<li>Added support for enforcing a minimum alignment on all allocations
inside a
<code>Bump</code> arena, which can provide speed ups when allocating
objects whose
alignment is less than or equal to that minimum.</li>
<li>Added <code>serde</code> serialization support for
<code>bumpalo::collections::String</code>.</li>
<li>Added some missing fallible slice allocation function variants.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Replaced <code>extend_from_slice</code> implementation with a
formally-verified version
that is also faster and more-optimizable for LLVM.</li>
<li>Updated <code>allocator-api2</code> support to version
<code>0.3.*</code>.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fixed a bug where the <code>allocated_bytes</code> metrics helper
was accidentally
including the size of <code>bumpalo</code>'s footer, rather than just
reporting the
user-allocated bytes.</li>
</ul>
<hr />
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/a3ac3d680ef39dc97ffed373074758e03e5ffd3c"><code>a3ac3d6</code></a>
Bump to version 3.18.1 (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/278">#278</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/789e34b1eeeddc61f08ceaa4321c64a74378538b"><code>789e34b</code></a>
Bump to version 3.18.0 (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/276">#276</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/b425081688a6c52665267ea0baa64733bf56a416"><code>b425081</code></a>
fix: subtract footer size from allocated_bytes on reset (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/275">#275</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/dd8a0e1aacc184273c36605ea6273504886cbec0"><code>dd8a0e1</code></a>
Replace extend_from_slice with a verified, optimized implementation (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/272">#272</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/2b638f1dc99a2245baf422de3ea9f916a7b79a4f"><code>2b638f1</code></a>
Add a CI job to check that code is formatted (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/273">#273</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/86aaa107b8bd1597e05744a2701bcac80c15b0cc"><code>86aaa10</code></a>
Update <code>allocator-api2</code> to v0.3 (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/271">#271</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/e5c128d3b81535bd2036693a699c9021e812e31f"><code>e5c128d</code></a>
Add support for enforcing minimum alignment in <code>Bump</code> (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/268">#268</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/cc98667869527fdebbddd014651e6a05b0254818"><code>cc98667</code></a>
add serde serialization for String (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/266">#266</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/e39cd38bfae051a6c322b1be11b06536653ad2ad"><code>e39cd38</code></a>
use primitive type u64 in README (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/264">#264</a>)</li>
<li><a
href="https://github.com/fitzgen/bumpalo/commit/f1f33f82ddb14955bec24d7656888c5dc80852c4"><code>f1f33f8</code></a>
Add fallible slice allocation functions (<a
href="https://redirect.github.com/fitzgen/bumpalo/issues/262">#262</a>)</li>
<li>See full diff in <a
href="https://github.com/fitzgen/bumpalo/compare/3.17.0...v3.18.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#2348)

Bumps the patch group with 4 updates in the / directory:
[clap](https://github.com/clap-rs/clap),
[pest](https://github.com/pest-parser/pest),
[pest_derive](https://github.com/pest-parser/pest) and
[petgraph](https://github.com/petgraph/petgraph).

Updates `clap` from 4.5.39 to 4.5.40
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.40] - 2025-06-09</h2>
<h3>Features</h3>
<ul>
<li>Support quoted ids in <code>arg!()</code> macro (e.g.
<code>arg!(&quot;check-config&quot;: ...)</code>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/clap-rs/clap/commit/cff27dbf5749777b380abb0f3627ef3d3147844a"><code>cff27db</code></a>
chore: Release</li>
<li><a
href="https://github.com/clap-rs/clap/commit/4ef41249f1ca5aeacabd1ef373581b17d96075b3"><code>4ef4124</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/clap-rs/clap/commit/ca896175c11d03150291be4bb36c8a5b016cea73"><code>ca89617</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5848">#5848</a>
from jennings/jennings/push-xolwzyoornps</li>
<li><a
href="https://github.com/clap-rs/clap/commit/99b6391ee92bfd3356fc8085ee206df97f284e19"><code>99b6391</code></a>
fix(complete): Fix PowerShell dynamic completion</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.39...clap_complete-v4.5.40">compare
view</a></li>
</ul>
</details>
<br />

Updates `pest` from 2.8.0 to 2.8.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pest-parser/pest/releases">pest's
releases</a>.</em></p>
<blockquote>
<h2>v2.8.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Add reference to ws2markdown by <a
href="https://github.com/dertuxmalwieder"><code>@​dertuxmalwieder</code></a>
in <a
href="https://redirect.github.com/pest-parser/pest/pull/1100">pest-parser/pest#1100</a></li>
<li>remove once_cell (upon next MSRV bump!) by <a
href="https://github.com/2ndDerivative"><code>@​2ndDerivative</code></a>
in <a
href="https://redirect.github.com/pest-parser/pest/pull/1102">pest-parser/pest#1102</a></li>
</ul>
<p>The Minimum Supported Rust Version (MSRV) for default features is
<strong>1.80.0</strong> now.</p>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dertuxmalwieder"><code>@​dertuxmalwieder</code></a>
made their first contribution in <a
href="https://redirect.github.com/pest-parser/pest/pull/1100">pest-parser/pest#1100</a></li>
<li><a
href="https://github.com/2ndDerivative"><code>@​2ndDerivative</code></a>
made their first contribution in <a
href="https://redirect.github.com/pest-parser/pest/pull/1102">pest-parser/pest#1102</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1">https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1</a></p>
<h2>Warning: Semantic Versioning</h2>
<p>Note that the node tag feature in 2.6.0 was a technically
semver-breaking change even though it is a backwards-compatible /
non-breaking change in the meta-grammar. There may be similar
non-breaking changes to the meta-grammar between minor versions in the
future. These non-breaking changes, however, may translate into
semver-breaking changes due to the additional variants propagated from
the generated <code>Rule</code> enum.</p>
<p>This new feature caused issues in some Cargo version resolution
situations where Cargo mixed different versions of pest dependencies.
For this reason, these &quot;grammar non-breaking but
semver-breaking&quot; changes are now available only under the
&quot;grammar-extras&quot; feature flag. If you would like to use node
tags (or other future grammar features), you can do so by enabling this
flag on the pest_derive crate in your Cargo.toml:</p>
<pre><code>...
pest_derive = { version = &quot;2.8&quot;, features =
[&quot;grammar-extras&quot;] }
</code></pre>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pest-parser/pest/commit/2f2ba3d9281d10219d23071f6fa744e25b2ee6ba"><code>2f2ba3d</code></a>
bump version to 2.8.1 (<a
href="https://redirect.github.com/pest-parser/pest/issues/1103">#1103</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/db5c82e0096a3bb4d2fcf4bebc4349e84a271fb3"><code>db5c82e</code></a>
remove once_cell (upon next MSRV bump!) (<a
href="https://redirect.github.com/pest-parser/pest/issues/1102">#1102</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/773976429faf46e43850a916f2eb58b75e803bd9"><code>7739764</code></a>
bump the CI toolchain to 1.82 (<a
href="https://redirect.github.com/pest-parser/pest/issues/1101">#1101</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/eecf4f64d8d4d48926c21303e287621d3b6e91da"><code>eecf4f6</code></a>
Add reference to ws2markdown (<a
href="https://redirect.github.com/pest-parser/pest/issues/1100">#1100</a>)</li>
<li>See full diff in <a
href="https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `pest_derive` from 2.8.0 to 2.8.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pest-parser/pest/releases">pest_derive's
releases</a>.</em></p>
<blockquote>
<h2>v2.8.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Add reference to ws2markdown by <a
href="https://github.com/dertuxmalwieder"><code>@​dertuxmalwieder</code></a>
in <a
href="https://redirect.github.com/pest-parser/pest/pull/1100">pest-parser/pest#1100</a></li>
<li>remove once_cell (upon next MSRV bump!) by <a
href="https://github.com/2ndDerivative"><code>@​2ndDerivative</code></a>
in <a
href="https://redirect.github.com/pest-parser/pest/pull/1102">pest-parser/pest#1102</a></li>
</ul>
<p>The Minimum Supported Rust Version (MSRV) for default features is
<strong>1.80.0</strong> now.</p>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dertuxmalwieder"><code>@​dertuxmalwieder</code></a>
made their first contribution in <a
href="https://redirect.github.com/pest-parser/pest/pull/1100">pest-parser/pest#1100</a></li>
<li><a
href="https://github.com/2ndDerivative"><code>@​2ndDerivative</code></a>
made their first contribution in <a
href="https://redirect.github.com/pest-parser/pest/pull/1102">pest-parser/pest#1102</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1">https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1</a></p>
<h2>Warning: Semantic Versioning</h2>
<p>Note that the node tag feature in 2.6.0 was a technically
semver-breaking change even though it is a backwards-compatible /
non-breaking change in the meta-grammar. There may be similar
non-breaking changes to the meta-grammar between minor versions in the
future. These non-breaking changes, however, may translate into
semver-breaking changes due to the additional variants propagated from
the generated <code>Rule</code> enum.</p>
<p>This new feature caused issues in some Cargo version resolution
situations where Cargo mixed different versions of pest dependencies.
For this reason, these &quot;grammar non-breaking but
semver-breaking&quot; changes are now available only under the
&quot;grammar-extras&quot; feature flag. If you would like to use node
tags (or other future grammar features), you can do so by enabling this
flag on the pest_derive crate in your Cargo.toml:</p>
<pre><code>...
pest_derive = { version = &quot;2.8&quot;, features =
[&quot;grammar-extras&quot;] }
</code></pre>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pest-parser/pest/commit/2f2ba3d9281d10219d23071f6fa744e25b2ee6ba"><code>2f2ba3d</code></a>
bump version to 2.8.1 (<a
href="https://redirect.github.com/pest-parser/pest/issues/1103">#1103</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/db5c82e0096a3bb4d2fcf4bebc4349e84a271fb3"><code>db5c82e</code></a>
remove once_cell (upon next MSRV bump!) (<a
href="https://redirect.github.com/pest-parser/pest/issues/1102">#1102</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/773976429faf46e43850a916f2eb58b75e803bd9"><code>7739764</code></a>
bump the CI toolchain to 1.82 (<a
href="https://redirect.github.com/pest-parser/pest/issues/1101">#1101</a>)</li>
<li><a
href="https://github.com/pest-parser/pest/commit/eecf4f64d8d4d48926c21303e287621d3b6e91da"><code>eecf4f6</code></a>
Add reference to ws2markdown (<a
href="https://redirect.github.com/pest-parser/pest/issues/1100">#1100</a>)</li>
<li>See full diff in <a
href="https://github.com/pest-parser/pest/compare/v2.8.0...v2.8.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `petgraph` from 0.8.1 to 0.8.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/petgraph/petgraph/releases">petgraph's
releases</a>.</em></p>
<blockquote>
<h2>petgraph-v0.8.2</h2>
<p>This minor release fixes several bugs, adds two new algorithms,
slightly improves the performance of <code>maximum_matching</code>,
adds a tool for parsing graphs from Dot/Graphviz files, and improves the
documentation, making it more complete and uniform, as well as
clarifying several points.</p>
<h3>Bug Fixes</h3>
<ul>
<li>Ford Fulkerson sometimes Panics on StableGraphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/793">#793</a>)</li>
<li>Run Maximal Cliques Quickcheck only on Digraphs which are
symmetrical (<a
href="https://redirect.github.com/petgraph/petgraph/pull/800">#800</a>)</li>
<li>Run Steiner Tree Quickcheck on the connected components to properly
support disconnected graphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/801">#801</a>)</li>
<li>Quickcheck random01 function only outputs 0 (<a
href="https://redirect.github.com/petgraph/petgraph/pull/798">#798</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Specify that Acyclic::try_udpate_edge may add an edge (<a
href="https://redirect.github.com/petgraph/petgraph/pull/770">#770</a>)</li>
<li>Update remove_node doc comment in graphmap.rs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/663">#663</a>)</li>
<li>Add examples to minimum spanning tree functions (<a
href="https://redirect.github.com/petgraph/petgraph/pull/808">#808</a>)</li>
<li>Minimal typo fix in comments (<a
href="https://redirect.github.com/petgraph/petgraph/pull/803">#803</a>)</li>
<li>Update docs.rs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/807">#807</a>)</li>
<li>Add note about <code>StableGraph::edge_indices</code> behaviour (<a
href="https://redirect.github.com/petgraph/petgraph/pull/812">#812</a>)</li>
<li>Clarification of references to nodes and V (refresh <a
href="https://redirect.github.com/petgraph/petgraph/issues/358">#358</a>)
(<a
href="https://redirect.github.com/petgraph/petgraph/pull/814">#814</a>)</li>
<li>Fix link and mention Dfs and Bfs as special case in examples (<a
href="https://redirect.github.com/petgraph/petgraph/pull/816">#816</a>)</li>
<li>Unify algo docs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/815">#815</a>)</li>
</ul>
<h3>New Features</h3>
<ul>
<li><em>(parser)</em> allow parsing graphs from Dot/Graphviz files (<a
href="https://redirect.github.com/petgraph/petgraph/pull/653">#653</a>)</li>
<li>Implement <code>DataMap</code> for <code>GraphMap</code> graphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/776">#776</a>)</li>
<li>Add Johnson's algorithm (<a
href="https://redirect.github.com/petgraph/petgraph/pull/741">#741</a>)</li>
<li>Add algorithm to find bridge edges (<a
href="https://redirect.github.com/petgraph/petgraph/pull/590">#590</a>)</li>
</ul>
<h3>Performance</h3>
<ul>
<li>Reuse queue allocation in <code>maximum_matching</code> main loop
(<a
href="https://redirect.github.com/petgraph/petgraph/pull/817">#817</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>Fix new clippy warnings (<a
href="https://redirect.github.com/petgraph/petgraph/pull/791">#791</a>)</li>
</ul>
<h3>Contributors</h3>
<ul>
<li>
<p><a
href="https://github.com/RaoulLuque"><code>@​RaoulLuque</code></a></p>
</li>
<li>
<p><a href="https://github.com/lmondada"><code>@​lmondada</code></a></p>
</li>
<li>
<p><a
href="https://github.com/MeGaGiGaGon"><code>@​MeGaGiGaGon</code></a></p>
</li>
<li>
<p><a
href="https://github.com/boguscoder"><code>@​boguscoder</code></a></p>
</li>
<li>
<p><a
href="https://github.com/starovoid"><code>@​starovoid</code></a></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/petgraph/petgraph/blob/master/CHANGELOG.md">petgraph's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/petgraph/petgraph/compare/[email protected]@v0.8.2">0.8.2</a>
- 2025-06-06</h2>
<p>This minor release fixes several bugs, adds two new algorithms,
slightly improves the performance of <code>maximum_matching</code>,
adds a tool for parsing graphs from Dot/Graphviz files, and improves the
documentation, making it more complete and uniform, as well as
clarifying several points.</p>
<h3>Bug Fixes</h3>
<ul>
<li>Ford Fulkerson sometimes Panics on StableGraphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/793">#793</a>)</li>
<li>Run Maximal Cliques Quickcheck only on Digraphs which are
symmetrical (<a
href="https://redirect.github.com/petgraph/petgraph/pull/800">#800</a>)</li>
<li>Run Steiner Tree Quickcheck on the connected components to properly
support disconnected graphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/801">#801</a>)</li>
<li>Quickcheck random01 function only outputs 0 (<a
href="https://redirect.github.com/petgraph/petgraph/pull/798">#798</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Specify that Acyclic::try_udpate_edge may add an edge (<a
href="https://redirect.github.com/petgraph/petgraph/pull/770">#770</a>)</li>
<li>Update remove_node doc comment in graphmap.rs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/663">#663</a>)</li>
<li>Add examples to minimum spanning tree functions (<a
href="https://redirect.github.com/petgraph/petgraph/pull/808">#808</a>)</li>
<li>Minimal typo fix in comments (<a
href="https://redirect.github.com/petgraph/petgraph/pull/803">#803</a>)</li>
<li>Update docs.rs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/807">#807</a>)</li>
<li>Add note about <code>StableGraph::edge_indices</code> behaviour (<a
href="https://redirect.github.com/petgraph/petgraph/pull/812">#812</a>)</li>
<li>Clarification of references to nodes and V (refresh <a
href="https://redirect.github.com/petgraph/petgraph/issues/358">#358</a>)
(<a
href="https://redirect.github.com/petgraph/petgraph/pull/814">#814</a>)</li>
<li>Fix link and mention Dfs and Bfs as special case in examples (<a
href="https://redirect.github.com/petgraph/petgraph/pull/816">#816</a>)</li>
<li>Unify algo docs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/815">#815</a>)</li>
</ul>
<h3>New Features</h3>
<ul>
<li><em>(parser)</em> allow parsing graphs from Dot/Graphviz files (<a
href="https://redirect.github.com/petgraph/petgraph/pull/653">#653</a>)</li>
<li>Implement <code>DataMap</code> for <code>GraphMap</code> graphs (<a
href="https://redirect.github.com/petgraph/petgraph/pull/776">#776</a>)</li>
<li>Add Johnson's algorithm (<a
href="https://redirect.github.com/petgraph/petgraph/pull/741">#741</a>)</li>
<li>Add algorithm to find bridge edges (<a
href="https://redirect.github.com/petgraph/petgraph/pull/590">#590</a>)</li>
</ul>
<h3>Performance</h3>
<ul>
<li>Reuse queue allocation in <code>maximum_matching</code> main loop
(<a
href="https://redirect.github.com/petgraph/petgraph/pull/817">#817</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>Fix new clippy warnings (<a
href="https://redirect.github.com/petgraph/petgraph/pull/791">#791</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/petgraph/petgraph/commit/2f8b190caa24b741cc30e98b5b0c4ae40b4b2133"><code>2f8b190</code></a>
chore: release v0.8.2 (<a
href="https://redirect.github.com/petgraph/petgraph/issues/768">#768</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/eeb98c43393a6fd0c178004717ceb153c3a10443"><code>eeb98c4</code></a>
docs: Unify algo docs (<a
href="https://redirect.github.com/petgraph/petgraph/issues/815">#815</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/dd2541c9edbcfec62212e676c483cbee985469c4"><code>dd2541c</code></a>
docs: Fix link and mention Dfs and Bfs as special case in examples (<a
href="https://redirect.github.com/petgraph/petgraph/issues/816">#816</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/5fdd192ba8d9a36d40a1398543dbe50754f459bf"><code>5fdd192</code></a>
perf: Reuse queue allocation in <code>maximum_matching</code> main loop
(<a
href="https://redirect.github.com/petgraph/petgraph/issues/817">#817</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/d4272c1116378b2cd0fd5ae9c52ccbd76b741573"><code>d4272c1</code></a>
docs: Clarification of references to nodes and V (refresh <a
href="https://redirect.github.com/petgraph/petgraph/issues/358">#358</a>)
(<a
href="https://redirect.github.com/petgraph/petgraph/issues/814">#814</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/90a220b2cdb54f5829a87e60ff14322acf7c6f51"><code>90a220b</code></a>
docs: Add note about <code>StableGraph::edge_indices</code> behaviour
(<a
href="https://redirect.github.com/petgraph/petgraph/issues/812">#812</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/f5f791c72ab40bf0331561f5e7218693ca38af4e"><code>f5f791c</code></a>
docs: Update docs.rs (<a
href="https://redirect.github.com/petgraph/petgraph/issues/807">#807</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/04b6950fb270bc0ee63310ff0138a26e6397e51c"><code>04b6950</code></a>
docs: Minimal typo fix in comments (<a
href="https://redirect.github.com/petgraph/petgraph/issues/803">#803</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/77ed02bfe992eb1c1f4a9f53e49651c1c1586e7f"><code>77ed02b</code></a>
docs: Add examples to minimum spanning tree functions (<a
href="https://redirect.github.com/petgraph/petgraph/issues/808">#808</a>)</li>
<li><a
href="https://github.com/petgraph/petgraph/commit/1125c33fea0ec3f85d25fc658f1cbe7de7631cd2"><code>1125c33</code></a>
fix: Quickcheck random01 function only outputs 0 (<a
href="https://redirect.github.com/petgraph/petgraph/issues/798">#798</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/petgraph/petgraph/compare/[email protected]@v0.8.2">compare
view</a></li>
</ul>
</details>
<br />

<details>
<summary>Most Recent Ignore Conditions Applied to This Pull
Request</summary>

| Dependency Name | Ignore Conditions |
| --- | --- |
| petgraph | [< 0.7, > 0.6.3] |
</details>


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Agustín Borgna <[email protected]>
…#2340)

These are misleading; it's now used by hugr-core import/export, which
seems fine.
…lacement::invalidation_set (#2358)

Currently a Patch(Verification) has to report its `invalidation_set`
without being able to see the Hugr on which it will act (and without
being able to verify itself against that Hugr - well the set is
meaningless if it doesn't verify/apply, but nonetheless). This would be
really useful in #2290 for one...

So, this PR adds a new method `invalidated_nodes` which is like
`invalidation_set` but takes an `&impl HugrView`; and deprecates the old
`invalidation_set`.

Annoyingly deprecating a method in a trait doesn't flag up
*implementations* of the method, only calls to it. So the breaking
change follow-up to remove invalidation_set (and *require* an
implementation of invalidated_nodes) will be significantly breaking. (If
we didn't have the default now, this would be breaking and the follow-up
still too, however).

For `SimpleReplacement` I've added the method but outside the trait, for
use in PersistentHugr. (It looks a little odd but the deprecation
warning kicks in only if you call the trait method, and the non-trait
method seems to be preferred when both are in scope.)
Replaces the TailLoop with a DFG containing the body plus a Conditional,
inside one Case of which there is a copy of the original TailLoop. (Uses
`HugrMut::copy_descendants` to copy incoming edges without copying their
sources.)

Letting the new DFG take the Node of the old TailLoop allows to preserve
all existing wiring (including e.g. order edges for nonlocals).

closes #2107
So we can use the builder machinery to make new definitions on an
existing hugr.
Introduces two new metadata keys: 
`__generator`: encode the tooling that generated the HUGR. Used in some
decoding errors to provide context if available. Currently only used for
JSON loading, should be extended to model. See also
CQCL/guppylang#1039
`__used_extensions`: encode names and versions of extensions used in the
HUGR, used to detect breaking version mismatch with loaded extensions.
See also CQCL/guppylang#1049

Closes #2351

Recommend reviewing individual commits.
@jennyQuantinuum jennyQuantinuum changed the title DRAFT: hugr-llvm: make default function linkage to private hugr-llvm: make default function linkage to private Jul 22, 2025
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.39%. Comparing base (1e5265b) to head (d4fbe77).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2461      +/-   ##
==========================================
- Coverage   82.39%   82.39%   -0.01%     
==========================================
  Files         248      248              
  Lines       46321    46320       -1     
  Branches    41893    41892       -1     
==========================================
- Hits        38168    38167       -1     
  Misses       6106     6106              
  Partials     2047     2047              
Flag Coverage Δ
python 87.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jennyQuantinuum jennyQuantinuum changed the title hugr-llvm: make default function linkage to private fix: hugr-llvm: make default function linkage to private Jul 22, 2025
@jennyQuantinuum jennyQuantinuum force-pushed the jenny/deadcode_issue2 branch from d4fbe77 to 59b013c Compare July 23, 2025 16:45
@hugrbot
Copy link
Collaborator

hugrbot commented Jul 23, 2025

This PR contains breaking changes to the public Rust API.
Please deprecate the old API instead (if possible), or mark the PR with a ! to indicate a breaking change.

cargo-semver-checks summary

--- failure feature_missing: package feature removed or renamed ---

Description:
A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/feature_missing.ron

Failed in:
feature hugr-persistent in the package's Cargo.toml
feature persistent_unstable in the package's Cargo.toml

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_variant_missing.ron

Failed in:
variant CliError::ValidateKnownGenerator, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-cli/src/lib.rs:131

--- failure struct_with_pub_fields_changed_type: struct with pub fields became an enum or union ---

Description:
A struct with pub fields became an enum or union, breaking accesses to its public fields.
      ref: https://github.com/obi1kenobi/cargo-semver-checks/issues/297#issuecomment-1399099659
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/struct_with_pub_fields_changed_type.ron

Failed in:
struct hugr_cli::CliArgs became enum in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-cli/src/lib.rs:78

--- warning enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_missing.ron

Failed in:
enum hugr_cli::CliCommand, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-cli/src/lib.rs:89

--- failure declarative_macro_missing: macro_rules declaration removed or renamed ---

Description:
A `macro_rules!` declarative macro cannot be invoked by its prior name. The macro may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/declarative_macro_missing.ron

Failed in:
macro impl_serde_as_binary_envelope, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope/serde_with.rs:298
macro impl_serde_as_binary_envelope, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope/serde_with.rs:298

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_missing.ron

Failed in:
enum hugr_core::types::type_param::TermTypeError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:710
enum hugr_core::types::type_param::SeqPart, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:738
enum hugr_core::hugr::patch::simple_replace::BoundaryMode, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:559
enum hugr_core::std_extensions::collections::borrow_array::BArrayUnsafeOpDef, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:117
enum hugr_core::core::Visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:294
enum hugr_core::Visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:294
enum hugr_core::types::type_param::Term, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:70
enum hugr_core::types::Term, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:70

--- failure enum_no_repr_variant_discriminant_changed: enum variant had its discriminant change value ---

Description:
The enum's variant had its discriminant value change. This breaks downstream code that used its value via a numeric cast like `as isize`.
      ref: https://doc.rust-lang.org/reference/items/enumerations.html#assigning-discriminant-values
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_no_repr_variant_discriminant_changed.ron

Failed in:
variant InterGraphEdgeError::NonCFGAncestor 1 -> 2 in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/validate.rs:777
variant InterGraphEdgeError::MissingOrderEdge 2 -> 3 in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/validate.rs:788
variant InterGraphEdgeError::NoRelation 3 -> 4 in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/validate.rs:799
variant InterGraphEdgeError::NonDominatedAncestor 4 -> 5 in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/validate.rs:809

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_variant_added.ron

Failed in:
variant TypeBound:Any in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/types.rs:136

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_variant_missing.ron

Failed in:
variant TypeBound::Linear, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types.rs:138
variant EnvelopeError::ExtensionLoad, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope.rs:323
variant EnvelopeError::FlagUnsupported, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope.rs:333
variant TypeArg::RuntimeType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:76
variant TypeArg::StaticType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:78
variant TypeArg::BoundedNatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:84
variant TypeArg::StringType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:86
variant TypeArg::BytesType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:88
variant TypeArg::FloatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:90
variant TypeArg::ListType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:94
variant TypeArg::TupleType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:97
variant TypeArg::Runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:100
variant TypeArg::Bytes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:109
variant TypeArg::Float, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:112
variant TypeArg::List, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:118
variant TypeArg::ListConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:124
variant TypeArg::Tuple, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:130
variant TypeArg::TupleConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:136
variant TypeArg::RuntimeType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:76
variant TypeArg::StaticType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:78
variant TypeArg::BoundedNatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:84
variant TypeArg::StringType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:86
variant TypeArg::BytesType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:88
variant TypeArg::FloatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:90
variant TypeArg::ListType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:94
variant TypeArg::TupleType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:97
variant TypeArg::Runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:100
variant TypeArg::Bytes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:109
variant TypeArg::Float, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:112
variant TypeArg::List, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:118
variant TypeArg::ListConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:124
variant TypeArg::Tuple, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:130
variant TypeArg::TupleConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:136
variant TypeParam::RuntimeType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:76
variant TypeParam::StaticType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:78
variant TypeParam::BoundedNatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:84
variant TypeParam::StringType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:86
variant TypeParam::BytesType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:88
variant TypeParam::FloatType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:90
variant TypeParam::ListType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:94
variant TypeParam::TupleType, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:97
variant TypeParam::Runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:100
variant TypeParam::Bytes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:109
variant TypeParam::Float, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:112
variant TypeParam::ListConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:124
variant TypeParam::TupleConcat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:136
variant TypeParam::Variable, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:141
variant ValidationError::DuplicateExport, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/validate.rs:711
variant ValidationError::DuplicateExport, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/validate.rs:711

--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/function_missing.ron

Failed in:
function hugr_core::std_extensions::collections::borrow_array::borrow_array_type_parametric, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:355
function hugr_core::types::type_param::check_term_types, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:697
function hugr_core::envelope::format_generator, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope.rs:90
function hugr_core::std_extensions::collections::array::op_builder::build_all_borrow_array_ops, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/array/op_builder.rs:395
function hugr_core::extension::deserialize_lower_funcs, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension/op_def.rs:303
function hugr_core::std_extensions::collections::borrow_array::borrow_array_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:348
function hugr_core::types::type_param::check_term_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:621
function hugr_core::envelope::get_generator, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope.rs:76
function hugr_core::std_extensions::collections::borrow_array::borrow_array_type_def, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:339

--- failure inherent_associated_pub_const_missing: inherent impl's associated pub const removed ---

Description:
An inherent impl's associated public constant is removed or renamed
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/inherent_associated_pub_const_missing.ron

Failed in:
TypeParam::UNIT, previously at /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:269

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/inherent_method_missing.ron

Failed in:
SimpleReplacement::map_host_nodes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:516
SimpleReplacement::map_host_nodes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:516
SimpleReplacement::map_host_nodes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:516
SimpleReplacement::map_host_nodes, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:516
ModuleBuilder::define_function_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/module.rs:98
ModuleBuilder::declare_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/module.rs:146
FuncDefn::new_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:75
FuncDefn::visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:108
FuncDefn::visibility_mut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:113
FuncDefn::new_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:75
FuncDefn::visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:108
FuncDefn::visibility_mut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:113
Wire::from_connected_port, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:232
Wire::all_connected_ports, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:262
Wire::from_connected_port, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:232
Wire::all_connected_ports, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/core.rs:262
Hugr::into_region_portgraph, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:397
Hugr::into_region_portgraph, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:397
FuncDecl::new_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:169
FuncDecl::visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:187
FuncDecl::visibility_mut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:197
FuncDecl::new_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:169
FuncDecl::visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:187
FuncDecl::visibility_mut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops/module.rs:197
DFGWrapper::new_vis, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/dataflow.rs:169
TypeArg::max_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:147
TypeArg::bounded_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:153
TypeArg::new_list, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:158
TypeArg::new_list_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:163
TypeArg::new_tuple_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:168
TypeArg::new_string, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:290
TypeArg::new_list_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:296
TypeArg::new_tuple, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:302
TypeArg::new_tuple_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:308
TypeArg::as_runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:323
TypeArg::new_list_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:470
TypeArg::into_list_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:551
TypeArg::new_tuple_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:558
TypeArg::into_tuple_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:570
TypeArg::max_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:147
TypeArg::bounded_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:153
TypeArg::new_list, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:158
TypeArg::new_list_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:163
TypeArg::new_tuple_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:168
TypeArg::new_string, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:290
TypeArg::new_list_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:296
TypeArg::new_tuple, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:302
TypeArg::new_tuple_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:308
TypeArg::as_runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:323
TypeArg::new_list_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:470
TypeArg::into_list_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:551
TypeArg::new_tuple_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:558
TypeArg::into_tuple_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:570
TypeParam::max_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:147
TypeParam::bounded_nat_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:153
TypeParam::new_list_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:163
TypeParam::new_tuple_type, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:168
TypeParam::new_var_use, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:275
TypeParam::new_string, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:290
TypeParam::new_list_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:296
TypeParam::new_tuple, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:302
TypeParam::new_tuple_concat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:308
TypeParam::as_nat, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:314
TypeParam::as_runtime, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:323
TypeParam::as_string, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:332
TypeParam::new_list_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:470
TypeParam::into_list_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:551
TypeParam::new_tuple_from_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:558
TypeParam::into_tuple_parts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:570

--- failure method_parameter_count_changed: pub method parameter count changed ---

Description:
A publicly-visible method now takes a different number of parameters.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/method_parameter_count_changed.ron

Failed in:
hugr_core::hugr::patch::simple_replace::SimpleReplacement::linked_replacement_output now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:130
hugr_core::hugr::patch::simple_replace::SimpleReplacement::linked_replacement_inputs now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:211
hugr_core::hugr::patch::SimpleReplacement::linked_replacement_output now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:130
hugr_core::hugr::patch::SimpleReplacement::linked_replacement_inputs now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:211
hugr_core::hugr::SimpleReplacement::linked_replacement_output now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:130
hugr_core::hugr::SimpleReplacement::linked_replacement_inputs now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:211
hugr_core::SimpleReplacement::linked_replacement_output now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:130
hugr_core::SimpleReplacement::linked_replacement_inputs now takes 3 parameters instead of 4, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/patch/simple_replace.rs:211

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/module_missing.ron

Failed in:
mod hugr_core::std_extensions::collections::borrow_array, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:1

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing or renamed
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/pub_module_level_const_missing.ron

Failed in:
EXTENSION_ID in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:47
BORROW_ARRAY_VALUENAME in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:45
MAKE_ERROR_OP_ID in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension/prelude.rs:187
BORROW_ARRAY_TYPENAME in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:43
VERSION in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:49

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/struct_missing.ron

Failed in:
struct hugr_core::std_extensions::collections::borrow_array::EXTENSION, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:290
struct hugr_core::types::type_param::TermVar, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:262
struct hugr_core::types::type_param::TuplePartIter, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:782
struct hugr_core::std_extensions::collections::borrow_array::BorrowArray, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:55
struct hugr_core::std_extensions::collections::borrow_array::BArrayUnsafeOpDefIter, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:111
struct hugr_core::std_extensions::collections::borrow_array::BArrayUnsafeOp, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:238
struct hugr_core::envelope::serde_with::AsBinaryEnvelope, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope/serde_with.rs:96
struct hugr_core::types::type_param::ListPartIter, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/type_param.rs:747

--- failure struct_with_no_pub_fields_changed_type: public API struct with no public fields is no longer a struct ---

Description:
A struct without pub fields became an enum or union, breaking pattern matching.
      ref: https://internals.rust-lang.org/t/rest-patterns-foo-should-match-non-struct-types/21607
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/struct_with_no_pub_fields_changed_type.ron

Failed in:
struct hugr_core::import::ImportError became enum in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/import.rs:39

--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/trait_method_missing.ron

Failed in:
method add_hugr_region_with_wires of trait Dataflow, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/build_traits.rs:240
method insert_region of trait HugrMut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/hugrmut.rs:197
method add_hugr_region of trait Container, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/build_traits.rs:96
method module_root_builder of trait HugrBuilder, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/builder/build_traits.rs:145

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/trait_missing.ron

Failed in:
trait hugr_core::std_extensions::collections::borrow_array::BArrayOpBuilder, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/borrow_array.rs:363

--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/trait_method_missing.ron

Failed in:
method fat_entrypoint of trait FatExt, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/utils/fat.rs:381
method emit_make_error of trait PreludeCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/prelude.rs:125
method emit_make_error of trait PreludeCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/prelude.rs:125

--- failure trait_method_requires_different_generic_type_params: trait method now requires a different number of generic type parameters ---

Description:
A trait method now requires a different number of generic type parameters than it used to. Calls or implementations of this trait method using the previous number of generic types will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/trait_method_requires_different_generic_type_params.ron

Failed in:
FatExt::fat_root (0 -> 1 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-llvm/src/utils/fat.rs:376

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/enum_missing.ron

Failed in:
enum hugr_model::v0::Visibility, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/mod.rs:96
enum hugr_model::v0::scope::UnknownVarError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/scope/vars.rs:147

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing or renamed
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/pub_module_level_const_missing.ron

Failed in:
CORE_TITLE in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/mod.rs:335
ORDER_HINT_OUTPUT_KEY in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/mod.rs:308
ORDER_HINT_INPUT_KEY in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/mod.rs:298

--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/struct_pub_field_missing.ron

Failed in:
field visibility of struct Symbol, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/ast/mod.rs:198
field visibility of struct Symbol, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-model/src/v0/table/mod.rs:307

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/inherent_method_missing.ron

Failed in:
ReplaceTypes::replace_op_with, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:375
ReplaceTypes::replace_parametrized_op_with, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:401
ReplaceTypes::replace_op_with, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:375
ReplaceTypes::replace_parametrized_op_with, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:401

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/module_missing.ron

Failed in:
mod hugr_passes::inline_dfgs, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/inline_dfgs.rs:1

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.42.0/src/lints/struct_missing.ron

Failed in:
struct hugr_passes::inline_dfgs::InlineDFGsPass, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/inline_dfgs.rs:19
struct hugr_passes::replace_types::ReplacementOptions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:178

@jennyQuantinuum jennyQuantinuum force-pushed the jenny/deadcode_issue2 branch from b832e11 to 59b013c Compare July 23, 2025 18:46
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Given hugr-v0.20.2, this sounds like the right approach (I am not an expert), however note that in hugr-v0.21, FuncDefn (and FuncDecl) gain an enum Visibility that is either Public or Private, so at that point we might want to use that to determine llvm visibility.

(Or possibly not - we might say that the utility of 'public' is in manipulating Hugrs and at the point we are compiling to LLVM we don't need it anymore)

@jennyQuantinuum jennyQuantinuum changed the title fix: hugr-llvm: make default function linkage to private DRAFT: fix: hugr-llvm: make default function linkage to private Jul 25, 2025
@hugrbot
Copy link
Collaborator

hugrbot commented Jul 25, 2025

Hey there and thank you for opening this pull request! 👋

We follow the Conventional Commits convention for PR titles. It looks like your title needs some adjustment.

The title should have a type prefix, followed by a colon. The most important ones are:

  • feat: for new features
  • fix: for bug fixes

If the PR contains a breaking change, use feat!: or fix!: instead and include a "BREAKING CHANGE:" footer in the description of the pull request.

You may also include a (scope) after the type prefix.

Expand this message for the full list of tags.
  • feat: New feature
  • fix: Bug fix
  • docs: Documentation-only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: Performance improvements
  • test: Adding missing or correcting existing tests
  • ci: Changes to our CI configuration files and scripts
  • chore: Other changes that do not alter public APIs or code behaviour
  • revert: Reverts a previous commit

@jennyQuantinuum
Copy link
Contributor Author

@acl-cqc Thanks for the comment/input! I agree that if we can use the Visibility enum, that will be a much cleaner solution. I wasn't able to test setting linkage based on Visibility as eldarion isn't compatible with the latest hugr version yet. But I created another eldarion PR that sets the linkage to Private for qsystem helper functions only, and I added a note in the PR that we want to first check if Visibility can be used once the hugr version is upgraded as it will be the preferred solution for the deadcode issue.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants