Skip to content

feat!: Update remainder of passes to use PassScope, drop default with_scope#2871

Merged
acl-cqc merged 10 commits intomainfrom
acl/pass-scope-breaking
Mar 11, 2026
Merged

feat!: Update remainder of passes to use PassScope, drop default with_scope#2871
acl-cqc merged 10 commits intomainfrom
acl/pass-scope-breaking

Conversation

@acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Feb 11, 2026

Following #2836, the remaining passes, where breakage was inevitable - mostly passes that were an empty struct (without any previous config).

Non-local-edges stuff needed some API changes where I did some deprecation, but we could just break.

RedundantOrderEdgesPass I've removed the old config methods - we should perhaps deprecate first, but some breakage seems inevitable as the empty struct derived Copy.

LocalizeEdges I've deprecated+moved top-level ensure_no_nonlocal_edges into a struct method check_no_nonlocal_edges, as IIUC it's used, but I've removed top-level nonlocal_edges altogether, it doesn't seem to be used.

Also remove the default impl for ComposablePass::with_scope_internal, to check we got 'em all.

BREAKING CHANGE: InlineDFGsPass, LocalizeEdgesPass, MonomorphizePass, RedundantOrderEdgesPass must be constructed via ::default(); remove RedundantOrderEdgesPass::recursive and don't derive Copy; ComposablePass::with_scope_internal requires impl; remove toplevel fn nonlocal_edges

@hugrbot
Copy link
Collaborator

hugrbot commented Feb 11, 2026

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary
    Building hugr v0.25.7 (current)
     Built [  35.453s] (current)
   Parsing hugr v0.25.7 (current)
    Parsed [   0.004s] (current)
  Building hugr v0.25.7 (baseline)
     Built [  35.421s] (baseline)
   Parsing hugr v0.25.7 (baseline)
    Parsed [   0.004s] (baseline)
  Checking hugr v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.012s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  72.153s] hugr
  Building hugr-cli v0.25.7 (current)
     Built [  28.980s] (current)
   Parsing hugr-cli v0.25.7 (current)
    Parsed [   0.006s] (current)
  Building hugr-cli v0.25.7 (baseline)
     Built [  29.111s] (baseline)
   Parsing hugr-cli v0.25.7 (baseline)
    Parsed [   0.006s] (baseline)
  Checking hugr-cli v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.016s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  60.025s] hugr-cli
  Building hugr-core v0.25.7 (current)
     Built [  25.442s] (current)
   Parsing hugr-core v0.25.7 (current)
    Parsed [   0.084s] (current)
  Building hugr-core v0.25.7 (baseline)
     Built [  25.473s] (baseline)
   Parsing hugr-core v0.25.7 (baseline)
    Parsed [   0.078s] (baseline)
  Checking hugr-core v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.218s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  52.408s] hugr-core
  Building hugr-llvm v0.25.7 (current)
     Built [  29.983s] (current)
   Parsing hugr-llvm v0.25.7 (current)
    Parsed [   0.011s] (current)
  Building hugr-llvm v0.25.7 (baseline)
     Built [  29.938s] (baseline)
   Parsing hugr-llvm v0.25.7 (baseline)
    Parsed [   0.011s] (baseline)
  Checking hugr-llvm v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.040s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  61.095s] hugr-llvm
  Building hugr-model v0.25.7 (current)
     Built [  11.046s] (current)
   Parsing hugr-model v0.25.7 (current)
    Parsed [   0.015s] (current)
  Building hugr-model v0.25.7 (baseline)
     Built [  10.907s] (baseline)
   Parsing hugr-model v0.25.7 (baseline)
    Parsed [   0.014s] (baseline)
  Checking hugr-model v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.030s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  22.802s] hugr-model
  Building hugr-passes v0.25.7 (current)
     Built [  27.948s] (current)
   Parsing hugr-passes v0.25.7 (current)
    Parsed [   0.023s] (current)
  Building hugr-passes v0.25.7 (baseline)
     Built [  27.940s] (baseline)
   Parsing hugr-passes v0.25.7 (baseline)
    Parsed [   0.023s] (baseline)
  Checking hugr-passes v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.039s] 196 checks: 192 pass, 4 fail, 0 warn, 56 skip

--- failure derive_trait_impl_removed: built-in derived trait no longer implemented ---

Description:
A public type has stopped deriving one or more traits. This can break downstream code that depends on those types implementing those traits.
      ref: https://doc.rust-lang.org/reference/attributes/derive.html#derive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.47.0/src/lints/derive_trait_impl_removed.ron

Failed in:
type RedundantOrderEdgesPass no longer derives Copy, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/redundant_order_edges.rs:25

--- 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.47.0/src/lints/inherent_method_missing.ron

Failed in:
RedundantOrderEdgesPass::new, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/redundant_order_edges.rs:39
RedundantOrderEdgesPass::recursive, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/redundant_order_edges.rs:44

--- failure trait_method_default_impl_removed: pub trait default method impl removed ---

Description:
A method's default impl in an unsealed trait has been removed, breaking trait implementations that relied on that default
      ref: https://doc.rust-lang.org/book/ch10-02-traits.html#default-implementations
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.47.0/src/lints/trait_method_default_impl_removed.ron

Failed in:
trait method hugr_passes::composable::ComposablePass::with_scope_internal in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/composable.rs:45
trait method hugr_passes::ComposablePass::with_scope_internal in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/composable.rs:45

--- failure unit_struct_changed_kind: unit struct changed kind ---

Description:
A public unit struct has been changed to a normal (curly-braces) struct, which cannot be constructed using the same struct literal syntax.
      ref: https://github.com/rust-lang/cargo/pull/10871
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.47.0/src/lints/unit_struct_changed_kind.ron

Failed in:
struct MonomorphizePass in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/monomorphize.rs:201
struct InlineDFGsPass in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/inline_dfgs.rs:16
struct LocalizeEdges in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/non_local.rs:22

   Summary semver requires new major version: 4 major and 0 minor checks failed
  Finished [  56.925s] hugr-passes
  Building hugr-persistent v0.4.7 (current)
     Built [  22.337s] (current)
   Parsing hugr-persistent v0.4.7 (current)
    Parsed [   0.008s] (current)
  Building hugr-persistent v0.4.7 (baseline)
     Built [  22.276s] (baseline)
   Parsing hugr-persistent v0.4.7 (baseline)
    Parsed [   0.007s] (baseline)
  Checking hugr-persistent v0.4.7 -> v0.4.7 (assume minor change)
   Checked [   0.014s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  45.463s] hugr-persistent

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 78.62595% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.80%. Comparing base (d503db7) to head (43680e4).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
hugr-passes/src/monomorphize.rs 26.31% 12 Missing and 2 partials ⚠️
hugr-passes/src/inline_dfgs.rs 44.44% 5 Missing ⚠️
hugr-passes/src/non_local.rs 94.11% 4 Missing and 1 partial ⚠️
hugr-passes/src/redundant_order_edges.rs 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2871      +/-   ##
==========================================
+ Coverage   83.78%   83.80%   +0.02%     
==========================================
  Files         267      267              
  Lines       52995    53032      +37     
  Branches    46934    46971      +37     
==========================================
+ Hits        44401    44445      +44     
- Misses       6314     6317       +3     
+ Partials     2280     2270      -10     
Flag Coverage Δ
python 88.74% <ø> (ø)
rust 83.17% <78.62%> (+0.02%) ⬆️

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.

@acl-cqc acl-cqc added this to the hugr-rs 0.26.0 milestone Mar 6, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
Follow-up to #2772 with non-breaking updates to ConstFoldPass,
DeadCodeElimPass, NormalizeCFGsPass, RedundantOrderEdgesPass,
RemoveDeadFuncsPass, ReplaceTypes, UntuplePass. (Breaking updates to
follow in #2871.)

Generally this means keeping pre-existing pass configurating methods but
deprecating, and storing such config in an `Either<PassScope,
old-config>`, so we can drop the old config in time.

Also deprecated toplevel functions `constant_fold_pass`,
`remove_dead_funcs` and `monomorphize`.

---------

Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
Base automatically changed from acl/pass-scopes to main March 6, 2026 17:01
@acl-cqc acl-cqc force-pushed the acl/pass-scope-breaking branch from 74f2a46 to 502bc9e Compare March 9, 2026 18:36
@acl-cqc acl-cqc force-pushed the acl/pass-scope-breaking branch from 502bc9e to 17fbd89 Compare March 9, 2026 19:02
if self.recursive && hugr.first_child(node).is_some() {
region_candidates.extend(hugr.children(node));
if self.scope.recursive() && hugr.first_child(node).is_some() {
region_candidates.push_back(node); // ALAN bugfix? hugr.children(node));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Am I being stupid here or would the old code have skipped child regions and looked only at grandchild regions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

How so?

We are adding children of parent to the candidates here, and run is doing while let Some(region) = region_candidates.pop_front() and calling run_on_df_region on each one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah ok. Think I had missed where node came from. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, wait. I was reading the new code as "the old one".

I think you were right 🤦

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh 🤦. So....node is a child of parent; thus we were adding children of a child of parent. Yes, done again.
Avoiding the ambiguous node and calling everything either child or parent seems like it'd help avoid this confusion, so I've renamed too.

@@ -35,17 +35,6 @@ pub struct RedundantOrderEdgesResult {
}

impl RedundantOrderEdgesPass {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could try much harder here - the old recursive(false) is equivalent to EntrypointFlat (does notihng if module=entrypoint), but old recursive(true) is union of EntrypointRecursive and Global, so would require an Option config

Copy link
Collaborator

Choose a reason for hiding this comment

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

union of EntrypointRecursive and Global
How so? Do you mean that

  • it behaves as Global if entrypoint == module
  • it behaves as EntrypointRecursive if entrypoint != module

I think it's fine to make the change.
The caller is normally aware of whether the hugr entrypoint is at the module root or elsewhere, and should set the scope accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • it behaves as Global if entrypoint == module
  • it behaves as EntrypointRecursive if entrypoint != module

Exactly (because EntrypointRecursive would do nothing in the first case)

.then_some((node, in_p))
})
})
pub fn nonlocal_edges<'a, H: HugrView>(
Copy link
Contributor Author

@acl-cqc acl-cqc Mar 9, 2026

Choose a reason for hiding this comment

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

I think this is used, so have preserved behaviour (respecting entrypoint)....that might not be what we want; could deprecate

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't find any usage.
tket uses ensure_no_nonlocal_edges, and you already added a deprecation there.

I'd remove these (either here or in the deprecation removal PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right, I don't see uses either. Ok, slightly naughty as it is, yeet

@@ -57,69 +105,63 @@ pub enum FindNonLocalEdgesError<N> {
Edges(Vec<(N, IncomingPort)>),
}

/// Verifies that there are no non local value edges in the Hugr.
/// Verifies that there are no non local value edges in the Hugr beneath the entrypoint.
#[deprecated(note = "Use LocalizeEdges::check_no_nonlocal_edges")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Seems misnamed)

@acl-cqc acl-cqc requested a review from aborgna-q March 9, 2026 19:39
@acl-cqc acl-cqc marked this pull request as ready for review March 9, 2026 19:39
@acl-cqc acl-cqc requested a review from a team as a code owner March 9, 2026 19:39
Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

LGTM other than the with_scope_internal comment.

Comment on lines 39 to 44
@@ -42,15 +42,7 @@ pub trait ComposablePass<H: HugrMut>: Sized {
/// From `hugr >=0.26.0`, passes must respect the scope configuration.
//
// For hugr passes, this is tracked by <https://github.com/Quantinuum/hugr/issues/2771>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace with with a must?

    /// Passes must always respect the scope configuration set here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to since 0.26.0, passes must.... and removed reference to earlier versions

.then_some((node, in_p))
})
})
pub fn nonlocal_edges<'a, H: HugrView>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't find any usage.
tket uses ensure_no_nonlocal_edges, and you already added a deprecation there.

I'd remove these (either here or in the deprecation removal PR).

if self.recursive && hugr.first_child(node).is_some() {
region_candidates.extend(hugr.children(node));
if self.scope.recursive() && hugr.first_child(node).is_some() {
region_candidates.push_back(node); // ALAN bugfix? hugr.children(node));
Copy link
Collaborator

Choose a reason for hiding this comment

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

How so?

We are adding children of parent to the candidates here, and run is doing while let Some(region) = region_candidates.pop_front() and calling run_on_df_region on each one

@@ -35,17 +35,6 @@ pub struct RedundantOrderEdgesResult {
}

impl RedundantOrderEdgesPass {
Copy link
Collaborator

Choose a reason for hiding this comment

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

union of EntrypointRecursive and Global
How so? Do you mean that

  • it behaves as Global if entrypoint == module
  • it behaves as EntrypointRecursive if entrypoint != module

I think it's fine to make the change.
The caller is normally aware of whether the hugr entrypoint is at the module root or elsewhere, and should set the scope accordingly.

@acl-cqc acl-cqc enabled auto-merge March 11, 2026 14:39
@acl-cqc acl-cqc added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 01fa963 Mar 11, 2026
31 of 33 checks passed
@acl-cqc acl-cqc deleted the acl/pass-scope-breaking branch March 11, 2026 14:45
@hugrbot hugrbot mentioned this pull request Mar 11, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
## 🤖 New release

* `hugr-model`: 0.25.7 -> 0.26.0 (✓ API compatible changes)
* `hugr-core`: 0.25.7 -> 0.26.0 (⚠ API breaking changes)
* `hugr-llvm`: 0.25.7 -> 0.26.0 (✓ API compatible changes)
* `hugr-persistent`: 0.4.7 -> 0.5.0 (✓ API compatible changes)
* `hugr`: 0.25.7 -> 0.26.0 (✓ API compatible changes)
* `hugr-passes`: 0.25.7 -> 0.26.0 (⚠ API breaking changes)
* `hugr-cli`: 0.25.7 -> 0.26.0 (✓ API compatible changes)

### ⚠ `hugr-core` breaking changes

```text
--- failure enum_struct_variant_field_added: pub enum struct variant field added ---

Description:
An enum's exhaustive struct variant has a new field, which has to be included when constructing or matching on this variant.
        ref: https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/enum_struct_variant_field_added.ron

Failed in:
  field pkg of variant LowerFunc::FixedHugr in /tmp/.tmpGqHhMb/hugr/hugr-core/src/extension/op_def.rs:312

--- failure enum_struct_variant_field_missing: pub enum struct variant's field removed or renamed ---

Description:
A publicly-visible enum has a struct variant whose field 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.46.0/src/lints/enum_struct_variant_field_missing.ron

Failed in:
  field hugr of variant LowerFunc::FixedHugr, previously in file /tmp/.tmpqeiszk/hugr-core/src/extension/op_def.rs:303

--- 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.46.0/src/lints/enum_variant_missing.ron

Failed in:
  variant BuildError::HugrInsertionError, previously in file /tmp/.tmpqeiszk/hugr-core/src/builder.rs:186
  variant EnvelopeFormat::ModelText, previously in file /tmp/.tmpqeiszk/hugr-core/src/envelope/header.rs:60
  variant EnvelopeFormat::ModelTextWithExtensions, previously in file /tmp/.tmpqeiszk/hugr-core/src/envelope/header.rs:70
  variant Value::Function, previously in file /tmp/.tmpqeiszk/hugr-core/src/ops/constant.rs:169
  variant Value::Function, previously in file /tmp/.tmpqeiszk/hugr-core/src/ops/constant.rs:169

--- 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.46.0/src/lints/function_missing.ron

Failed in:
  function hugr_core::envelope::read_described_envelope, previously in file /tmp/.tmpqeiszk/hugr-core/src/envelope.rs:98

--- 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.46.0/src/lints/inherent_method_missing.ron

Failed in:
  Value::function, previously in file /tmp/.tmpqeiszk/hugr-core/src/ops/constant.rs:380
  Value::function, previously in file /tmp/.tmpqeiszk/hugr-core/src/ops/constant.rs:380
```

### ⚠ `hugr-passes` breaking changes

```text
--- failure derive_trait_impl_removed: built-in derived trait no longer implemented ---

Description:
A public type has stopped deriving one or more traits. This can break downstream code that depends on those types implementing those traits.
        ref: https://doc.rust-lang.org/reference/attributes/derive.html#derive
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/derive_trait_impl_removed.ron

Failed in:
  type RedundantOrderEdgesPass no longer derives Copy, in /tmp/.tmpGqHhMb/hugr/hugr-passes/src/redundant_order_edges.rs:26

--- 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.46.0/src/lints/enum_missing.ron

Failed in:
  enum hugr_passes::untuple::UntupleRecursive, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:23

--- 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.46.0/src/lints/function_missing.ron

Failed in:
  function hugr_passes::remove_dead_funcs, previously in file /tmp/.tmpqeiszk/hugr-passes/src/dead_funcs.rs:179
  function hugr_passes::const_fold::constant_fold_pass, previously in file /tmp/.tmpqeiszk/hugr-passes/src/const_fold.rs:224
  function hugr_passes::non_local::nonlocal_edges, previously in file /tmp/.tmpqeiszk/hugr-passes/src/non_local.rs:39
  function hugr_passes::nonlocal_edges, previously in file /tmp/.tmpqeiszk/hugr-passes/src/non_local.rs:39
  function hugr_passes::monomorphize, previously in file /tmp/.tmpqeiszk/hugr-passes/src/monomorphize.rs:36

--- 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.46.0/src/lints/inherent_method_missing.ron

Failed in:
  UntuplePass::new, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:102
  UntuplePass::set_parent, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:114
  UntuplePass::recursive, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:136
  UntuplePass::find_rewrites, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:151
  UntuplePass::new, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:102
  UntuplePass::set_parent, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:114
  UntuplePass::recursive, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:136
  UntuplePass::find_rewrites, previously in file /tmp/.tmpqeiszk/hugr-passes/src/untuple.rs:151
  RedundantOrderEdgesPass::new, previously in file /tmp/.tmpqeiszk/hugr-passes/src/redundant_order_edges.rs:39
  RedundantOrderEdgesPass::recursive, previously in file /tmp/.tmpqeiszk/hugr-passes/src/redundant_order_edges.rs:44
  RemoveDeadFuncsPass::with_module_entry_points, previously in file /tmp/.tmpqeiszk/hugr-passes/src/dead_funcs.rs:75
  NormalizeCFGPass::cfgs, previously in file /tmp/.tmpqeiszk/hugr-passes/src/normalize_cfgs.rs:121
  ValueHandle::new_const_hugr, previously in file /tmp/.tmpqeiszk/hugr-passes/src/const_fold/value_handle.rs:95

--- failure trait_added_supertrait: non-sealed trait added new supertraits ---

Description:
A non-sealed trait added one or more supertraits, which breaks downstream implementations of the trait
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#generic-bounds-tighten
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/trait_added_supertrait.ron

Failed in:
  trait hugr_passes::composable::ComposablePass gained WithScope in file /tmp/.tmpGqHhMb/hugr/hugr-passes/src/composable.rs:25
  trait hugr_passes::ComposablePass gained WithScope in file /tmp/.tmpGqHhMb/hugr/hugr-passes/src/composable.rs:25

--- 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.46.0/src/lints/trait_method_missing.ron

Failed in:
  method value_from_const_hugr of trait ConstLoader, previously in file /tmp/.tmpqeiszk/hugr-passes/src/dataflow.rs:73
  method with_scope_internal of trait ComposablePass, previously in file /tmp/.tmpqeiszk/hugr-passes/src/composable.rs:45
  method with_scope_internal of trait ComposablePass, previously in file /tmp/.tmpqeiszk/hugr-passes/src/composable.rs:45

--- failure type_allows_fewer_generic_type_params: type now allows fewer generic type parameters ---

Description:
A type now allows fewer generic type parameters than it used to. Uses of this type that supplied all previously-supported generic types will be broken.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/type_allows_fewer_generic_type_params.ron

Failed in:
  Struct NormalizeCFGPass allows 1 -> 0 generic types in /tmp/.tmpGqHhMb/hugr/hugr-passes/src/normalize_cfgs.rs:101

--- failure unit_struct_changed_kind: unit struct changed kind ---

Description:
A public unit struct has been changed to a normal (curly-braces) struct, which cannot be constructed using the same struct literal syntax.
        ref: rust-lang/cargo#10871
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/unit_struct_changed_kind.ron

Failed in:
  struct MonomorphizePass in /tmp/.tmpGqHhMb/hugr/hugr-passes/src/monomorphize.rs:178
  struct InlineDFGsPass in /tmp/.tmpGqHhMb/hugr/hugr-passes/src/inline_dfgs.rs:17
  struct LocalizeEdges in /tmp/.tmpGqHhMb/hugr/hugr-passes/src/non_local.rs:23
```

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.26.0](hugr-model-v0.25.7...hugr-model-v0.26.0)
- 2026-03-16

### Testing

- Replace model text snapshots with roundtrip tests
([#2933](#2933))
- Add missing width arg in model-call example
([#2945](#2945))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.26.0](hugr-core-v0.25.7...hugr-core-v0.26.0)
- 2026-03-16

### Bug Fixes

- Keep declared used_extensions in envelope description
([#2932](#2932))

### Documentation

- Move `spec/schema` and `spec/std_extensions` to `resources/`
([#2897](#2897))

### Miscellaneous Tasks

- [**breaking**] Fix new clippy warning on rust 1.94
([#2912](#2912))

### New Features

- [**breaking**] Rename ModelText envelope format to SExpression
([#2927](#2927))
- [**breaking**] Fix lower_funcs with custom extensions failing to load
([#2925](#2925))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
- Deprecate HugrView::as_petgraph
([#2944](#2944))

### Refactor

- [**breaking**] Remove deprecated Value::Function
([#2928](#2928))
- [**breaking**] Remove deprecated definitions
([#2930](#2930))

### Testing

- Fix type_row intos in doctests
([#2941](#2941))
- Add missing width arg in model-call example
([#2945](#2945))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.26.0](hugr-llvm-v0.25.7...hugr-llvm-v0.26.0)
- 2026-03-16

### New Features

- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- Include private HUGR functions in the local symbol table
([#2831](#2831))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))

### Refactor

- [**breaking**] Remove deprecated Value::Function
([#2928](#2928))
- [**breaking**] Remove deprecated stack_array codegen
([#2929](#2929))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.5.0](hugr-persistent-v0.4.7...hugr-persistent-v0.5.0)
- 2026-03-16

### New Features

- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
</blockquote>

## `hugr`

<blockquote>

##
[0.26.0](hugr-v0.25.7...hugr-v0.26.0)
- 2026-03-16

### Bug Fixes

- Keep declared used_extensions in envelope description
([#2932](#2932))

### Documentation

- Move `spec/schema` and `spec/std_extensions` to `resources/`
([#2897](#2897))

### Miscellaneous Tasks

- [**breaking**] Fix new clippy warning on rust 1.94
([#2912](#2912))

### New Features

- [**breaking**] Update remainder of passes to use PassScope, drop
default with_scope
([#2871](#2871))
- [**breaking**] Make `WithScope` a supertrait of `ComposablePass`
([#2921](#2921))
- [**breaking**] Rename ModelText envelope format to SExpression
([#2927](#2927))
- [**breaking**] Fix lower_funcs with custom extensions failing to load
([#2925](#2925))
- Deprecate HugrView::as_petgraph
([#2944](#2944))
- [**breaking**] `hugr-passes` is no longer reexported from
`hugr::algorithms`
([#2922](#2922))
- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))

### Refactor

- [**breaking**] Remove deprecated pass configuration
([#2938](#2938))
- [**breaking**] Remove deprecated Value::Function
([#2928](#2928))
- [**breaking**] Remove deprecated definitions
([#2930](#2930))

### Testing

- Fix type_row intos in doctests
([#2941](#2941))
- Add missing width arg in model-call example
([#2945](#2945))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.26.0](hugr-passes-v0.25.7...hugr-passes-v0.26.0)
- 2026-03-16

### New Features

- [**breaking**] `hugr-passes` is no longer reexported from
`hugr::algorithms`
([#2922](#2922))
- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- [**breaking**] Update remainder of passes to use PassScope, drop
default with_scope
([#2871](#2871))
- [**breaking**] Make `WithScope` a supertrait of `ComposablePass`
([#2921](#2921))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
- Deprecate HugrView::as_petgraph
([#2944](#2944))

### Refactor

- [**breaking**] Remove deprecated Value::Function
([#2928](#2928))
- [**breaking**] Remove deprecated pass configuration
([#2938](#2938))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.26.0](hugr-cli-v0.25.7...hugr-cli-v0.26.0)
- 2026-03-16

### Documentation

- Move `spec/schema` and `spec/std_extensions` to `resources/`
([#2897](#2897))

### New Features

- [**breaking**] Rename ModelText envelope format to SExpression
([#2927](#2927))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
@hugrbot hugrbot mentioned this pull request Mar 17, 2026
github-merge-queue bot pushed a commit to Quantinuum/tket2 that referenced this pull request Mar 23, 2026
Adds support for `PassScope`s in the pass definitions. See
Quantinuum/hugr#2772.

~Requires a hugr release with the `PassScope` definition and
Quantinuum/hugr#2910

~Many of these also call other passes from `hugr_passes`. While we pass
the scope config along, proper support requires
Quantinuum/hugr#2836 and
Quantinuum/hugr#2871

This is a rust-only change, the python interface will follow up.

BREAKING CHANGE: Multiple unit-like pass structs must now be constructed
using a `::default()` call instead.
BREAKING CHANGE: `QSystemPass` is now a `ComposablePass`. Import the
trait to call `run`.
BREAKING CHANGE: `QSystemPass` no longer implements `Copy`.
BREAKING CHANGE: Renamed
`tket_qsystem::extension::qsystem::lower_tket_op` to `lower_tket_ops`.
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.

3 participants