Skip to content

feat!: Fix lower_funcs with custom extensions failing to load#2925

Merged
aborgna-q merged 3 commits intomainfrom
ab/lower-funcs-exts-rs
Mar 10, 2026
Merged

feat!: Fix lower_funcs with custom extensions failing to load#2925
aborgna-q merged 3 commits intomainfrom
ab/lower-funcs-exts-rs

Conversation

@aborgna-q
Copy link
Copy Markdown
Collaborator

Closes #2520
Having a fixed hugr in an opdef lowering function that contained non-std extension reference caused an error on load.

We may deprecate lowering functions at some point, but we should try to avoid erroring out on currently valid code.

BREAKING CHANGE: LowerFunc::FixedHugr::hugr replaced with LowerFunc::FixedHugr::pkg

@aborgna-q aborgna-q requested a review from a team as a code owner March 6, 2026 17:50
@aborgna-q aborgna-q requested a review from acl-cqc March 6, 2026 17:50
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.82%. Comparing base (61aba25) to head (0faad98).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/envelope/reader.rs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2925      +/-   ##
==========================================
+ Coverage   83.78%   83.82%   +0.03%     
==========================================
  Files         267      267              
  Lines       52975    52996      +21     
  Branches    46914    46935      +21     
==========================================
+ Hits        44384    44422      +38     
+ Misses       6320     6302      -18     
- Partials     2271     2272       +1     
Flag Coverage Δ
python 88.74% <ø> (ø)
rust 83.18% <96.55%> (+0.04%) ⬆️

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.

@aborgna-q aborgna-q added this to the hugr-rs 0.26.0 milestone Mar 9, 2026
@aborgna-q aborgna-q added C-bugfix Category: PR with bug fix A-rust Area: Rust code S-breaking-change Status: Need a breaking change release to progress labels Mar 9, 2026
.unwrap_or(Ok(vec![]))?;
ExtensionRegistry::new(extra_extensions.into_iter().map(std::sync::Arc::new))
let weak_registry: WeakExtensionRegistry = (&self.registry).into();
ExtensionRegistry::new_with_extension_resolution(extra_extensions, &weak_registry)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

drive-by: We weren't running resolution on extensions loaded from the ModelText format.

#[serde_as(as = "Box<AsBinaryEnvelope>")]
hugr: Box<Hugr>,
#[serde(rename = "hugr")]
pkg: Box<Package>,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the fix. The encoded envelope already has all the required non-std extensions.

Decoding it as a Hugr didn't keep a strong reference to the loaded extensions, so they were being dropped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 nice for it to be so neat, and +1 for having commented that it's a single-module package.

@aborgna-q aborgna-q enabled auto-merge March 9, 2026 10:11
@aborgna-q aborgna-q disabled auto-merge March 9, 2026 10:12
@aborgna-q aborgna-q force-pushed the ab/lower-funcs-exts-rs branch from 48d24c2 to e5de069 Compare March 9, 2026 10:51
@hugrbot
Copy link
Copy Markdown
Collaborator

hugrbot commented Mar 9, 2026

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
    Building hugr v0.25.7 (current)
     Built [  37.329s] (current)
   Parsing hugr v0.25.7 (current)
    Parsed [   0.004s] (current)
  Building hugr v0.25.7 (baseline)
     Built [  23.751s] (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 [  63.036s] hugr
  Building hugr-cli v0.25.7 (current)
     Built [  25.520s] (current)
   Parsing hugr-cli v0.25.7 (current)
    Parsed [   0.006s] (current)
  Building hugr-cli v0.25.7 (baseline)
     Built [  23.901s] (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 [  50.629s] hugr-cli
  Building hugr-core v0.25.7 (current)
     Built [  30.638s] (current)
   Parsing hugr-core v0.25.7 (current)
    Parsed [   0.085s] (current)
  Building hugr-core v0.25.7 (baseline)
     Built [  19.018s] (baseline)
   Parsing hugr-core v0.25.7 (baseline)
    Parsed [   0.079s] (baseline)
  Checking hugr-core v0.25.7 -> v0.25.7 (assume minor change)
   Checked [   0.218s] 196 checks: 193 pass, 3 fail, 0 warn, 56 skip

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

Failed in:
field pkg of variant LowerFunc::FixedHugr in /home/runner/work/hugr/hugr/PR_BRANCH/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.47.0/src/lints/enum_struct_variant_field_missing.ron

Failed in:
field hugr of variant LowerFunc::FixedHugr, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/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.47.0/src/lints/enum_variant_missing.ron

Failed in:
variant EnvelopeFormat::ModelText, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope/header.rs:60
variant EnvelopeFormat::ModelTextWithExtensions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/envelope/header.rs:70

   Summary semver requires new major version: 3 major and 0 minor checks failed
  Finished [  51.315s] hugr-core
  Building hugr-llvm v0.25.7 (current)
     Built [  19.843s] (current)
   Parsing hugr-llvm v0.25.7 (current)
    Parsed [   0.012s] (current)
  Building hugr-llvm v0.25.7 (baseline)
     Built [  29.389s] (baseline)
   Parsing hugr-llvm v0.25.7 (baseline)
    Parsed [   0.012s] (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 [  50.393s] hugr-llvm
  Building hugr-model v0.25.7 (current)
     Built [   4.745s] (current)
   Parsing hugr-model v0.25.7 (current)
    Parsed [   0.015s] (current)
  Building hugr-model v0.25.7 (baseline)
     Built [   4.737s] (baseline)
   Parsing hugr-model v0.25.7 (baseline)
    Parsed [   0.015s] (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 [  10.124s] hugr-model
  Building hugr-passes v0.25.7 (current)
     Built [  18.740s] (current)
   Parsing hugr-passes v0.25.7 (current)
    Parsed [   0.024s] (current)
  Building hugr-passes v0.25.7 (baseline)
     Built [  14.710s] (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: 196 pass, 56 skip
   Summary no semver update required
  Finished [  34.952s] hugr-passes
  Building hugr-persistent v0.4.7 (current)
     Built [  15.769s] (current)
   Parsing hugr-persistent v0.4.7 (current)
    Parsed [   0.008s] (current)
  Building hugr-persistent v0.4.7 (baseline)
     Built [  11.578s] (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.015s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  28.215s] hugr-persistent

@aborgna-q aborgna-q changed the title feat: Fix lower_funcs with custom extensions failing to load feat!: Fix lower_funcs with custom extensions failing to load Mar 9, 2026
@aborgna-q aborgna-q linked an issue Mar 10, 2026 that may be closed by this pull request
@aborgna-q aborgna-q force-pushed the ab/lower-funcs-exts-rs branch from e5de069 to 17260e1 Compare March 10, 2026 14:50
Copy link
Copy Markdown
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.

Thanks Agustin, looks good. Not sure if the suggestion of deserializing the whole variant as a FixedHugrDeserializer works.

/// We store it as a single-module package here to keep any encoded
/// extensions required to define the Hugr alive.
///
/// The Package must contain any non-std extension required to define
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

super-nit: must -> should. If it doesn't, things might still work....(probably a lucky accident!)

@@ -295,12 +296,20 @@ pub enum LowerFunc {
FixedHugr {
/// The extensions required by the [`Hugr`]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it might be good to expand this slightly now we have another thing storing the extensions. These are the runtime requirements (i.e. which the spec says may exclude types that are treated only opaquely).

We removed these (/the equivalents) from FunctionType but didn't do so here - perhaps an oversight but also they're still here to allow selecting which lower-func to use.

I had to remind myself that an ExtensionSet is a collection of extension names not definitions (that would be an ExtensionRegistry), this is easy to forget now we aren't using ExtensionSet much...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I would avoid modifying this enum much, given that we're still using serde for extension definitions, and any change here would break the schema.

We're both thinking about dropping LowerFunc and moving extension defs to capnp, so I wouldn't try and break / change this if it's not needed.

pub extensions: ExtensionSet,
#[serde_as(as = "Box<AsBinaryEnvelope>")]
pub hugr: Box<Hugr>,
pub hugr: Box<Package>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So....anything that previously deserialized as a Hugr will now deserialize as a Package (with no extensions, if it was only a Hugr before)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The bytes are already an encoded envelope, we were always deserializing a package and then extracting the single module.

Now we do that step when doing the actual lowering instead, so we keep the package context in-memory.

#[serde_as(as = "Box<AsBinaryEnvelope>")]
hugr: Box<Hugr>,
#[serde(rename = "hugr")]
pkg: Box<Package>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 nice for it to be so neat, and +1 for having commented that it's a single-module package.


for node in lower_hugr.nodes() {
let op = lower_hugr.get_optype(node);
assert!(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optionally, you could check that you do find an ExtensionOp whose extension-arc is inner_ext

/// when loading the Hugr.
///
/// [ExtensionOp]: crate::ops::ExtensionOp
#[serde_as(as = "Box<AsBinaryEnvelope>")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we still use this? I mean, do we still deserialize them individually, as well as deserializing lists of them via deserialize_lower_funcs?

If so, you might wanna serialize this whole variant as a FixedHugrDeserializer?

Copy link
Copy Markdown
Collaborator Author

@aborgna-q aborgna-q Mar 10, 2026

Choose a reason for hiding this comment

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

deserialize_lower_funcs is a deserializing helper to improve errors messages, we still use derive(serde::Serialize) on the main enum for serializing.

@aborgna-q aborgna-q enabled auto-merge March 10, 2026 16:02
@aborgna-q aborgna-q added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 41c172d Mar 10, 2026
28 checks passed
@aborgna-q aborgna-q deleted the ab/lower-funcs-exts-rs branch March 10, 2026 17:25
@hugrbot hugrbot mentioned this pull request Mar 10, 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 <[email protected]>
Co-authored-by: Alec Edgington <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rust Area: Rust code C-bugfix Category: PR with bug fix S-breaking-change Status: Need a breaking change release to progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Custom type drops its extension reference Extension resolution does not work for nested hugr

3 participants