Skip to content

Conversation

@aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Apr 28, 2025

Re-created from #2113, targeting the release branch instead.

BREAKING CHANGE: Downstream crates need to remove the model_unstable feature flag when referencing hugr or hugr-core.

@aborgna-q aborgna-q added this to the hugr-rs 0̶.̶1̶6̶ 0.20 milestone Apr 28, 2025
@aborgna-q aborgna-q requested a review from a team as a code owner April 28, 2025 10:06
@hugrbot
Copy link
Collaborator

hugrbot commented Apr 28, 2025

This PR contains breaking changes to the public Rust API.

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.41.0/src/lints/feature_missing.ron

Failed in:
feature hugr-model in the package's Cargo.toml
feature model_unstable in the package's Cargo.toml

--- failure auto_trait_impl_removed: auto trait no longer implemented ---

Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
      ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/auto_trait_impl_removed.ron

Failed in:
type SiblingMut is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:236

--- 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.41.0/src/lints/feature_missing.ron

Failed in:
feature model_unstable in the package's Cargo.toml
feature hugr-model in the package's Cargo.toml

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

Description:
A method now requires a different number of generic type parameters than it used to. Uses of this method that supplied 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.41.0/src/lints/method_requires_different_generic_type_params.ron

Failed in:
hugr_core::hugr::views::sibling::SiblingMut::try_new takes 1 generic types instead of 0, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:250

--- 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.41.0/src/lints/module_missing.ron

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

--- failure trait_allows_fewer_generic_type_params: trait now allows fewer generic type parameters ---

Description:
A trait now allows fewer generic type parameters than it used to. Uses of this trait 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.41.0/src/lints/trait_allows_fewer_generic_type_params.ron

Failed in:
trait NodeHandle allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:12
trait ContainerHandle allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.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.41.0/src/lints/trait_method_missing.ron

Failed in:
method try_node_handle of trait OpTrait, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/ops.rs:386
method set_root of trait HugrMutInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:115
method node_metadata_map_mut of trait HugrMutInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:224
method extensions_mut of trait HugrMutInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:229
method node_metadata_map of trait HugrInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:57

--- 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.41.0/src/lints/trait_method_requires_different_generic_type_params.ron

Failed in:
HugrMut::insert_from_view (1 -> 0 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:239
HugrMut::insert_subgraph (1 -> 0 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:258
Container::add_hugr_view (1 -> 0 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/builder/build_traits.rs:122

--- 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.41.0/src/lints/trait_missing.ron

Failed in:
trait hugr_core::std_extensions::collections::array::op_builder::ArrayOpBuilder, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/array/op_builder.rs:13
trait hugr_core::std_extensions::collections::array::ArrayOpBuilder, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/array/op_builder.rs:13

--- failure trait_removed_associated_type: trait's associated type was removed ---

Description:
A public trait's associated type was 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.41.0/src/lints/trait_removed_associated_type.ron

Failed in:
associated type Rewrite::Node, previously at /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:22
associated type Rewrite::Node, previously at /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:22

--- 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.41.0/src/lints/type_allows_fewer_generic_type_params.ron

Failed in:
Struct DfgID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:50
Struct ConditionalID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:118
Struct InsertionResult allows 2 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:310
Struct DataflowOpID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:46
Struct ModuleRootID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:58
Struct FuncID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:70
Struct BasicBlockID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:106
Struct DataflowParentID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:122
Struct CaseID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:110
Struct CfgID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:54
Struct TailLoopID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:114
Struct SiblingMut allows 2 -> 1 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:236
Struct AliasID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:78
Struct ConstID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:102
Struct ModuleID allows 1 -> 0 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/ops/handle.rs:62

--- failure auto_trait_impl_removed: auto trait no longer implemented ---

Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
      ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/auto_trait_impl_removed.ron

Failed in:
type RemoveDeadFuncsError is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dead_funcs.rs:20
type RemoveDeadFuncsError is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dead_funcs.rs:20
type UntupleError is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:58
type UntupleError is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:58

--- 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.41.0/src/lints/derive_trait_impl_removed.ron

Failed in:
type ConstFoldError no longer derives Clone, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/const_fold.rs:44
type ConstFoldError no longer derives PartialEq, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/const_fold.rs:44
type UntupleResult no longer derives PartialEq, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:67

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

Failed in:
enum hugr_passes::composable::ValidatePassError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:116

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

Failed in:
variant PartialValue::LoadedFunction, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dataflow/partial_value.rs:318
variant LinearizeError::NestedTemplateError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types/linearize.rs:170
variant NodeTemplate::Call, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:51
variant ReplaceTypesError::AddTemplateError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:254

--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---

Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/function_requires_different_generic_type_params.ron

Failed in:
function row_contains_bottom (2 -> 1 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow.rs:123

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

Failed in:
PartialValue::new_load, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dataflow/partial_value.rs:357
UntuplePass::set_parent, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/untuple.rs:80
UntuplePass::set_parent, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/untuple.rs:80

--- 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.41.0/src/lints/method_parameter_count_changed.ron

Failed in:
hugr_passes::untuple::UntuplePass::new now takes 2 parameters instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:74
hugr_passes::UntuplePass::new now takes 2 parameters instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:74

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

Description:
A method now requires a different number of generic type parameters than it used to. Uses of this method that supplied 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.41.0/src/lints/method_requires_different_generic_type_params.ron

Failed in:
hugr_passes::dataflow::PartialValue::try_into_concrete takes 3 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:351
hugr_passes::dataflow::AnalysisResults::try_read_wire_concrete takes 3 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/results.rs:87
hugr_passes::dataflow::PartialSum::try_into_sum takes 3 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:158

--- 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.41.0/src/lints/module_missing.ron

Failed in:
mod hugr_passes::composable, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.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.41.0/src/lints/struct_missing.ron

Failed in:
struct hugr_passes::composable::IfThen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:188
struct hugr_passes::composable::ValidatingPass, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:135
struct hugr_passes::dataflow::LoadedFunction, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dataflow/partial_value.rs:57

--- 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.41.0/src/lints/trait_missing.ron

Failed in:
trait hugr_passes::dataflow::AsConcrete, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dataflow/partial_value.rs:175
trait hugr_passes::composable::ComposablePass, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:12
trait hugr_passes::ComposablePass, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:12
trait hugr_passes::composable::ErrorCombiner, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/composable.rs:59

--- 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.41.0/src/lints/type_allows_fewer_generic_type_params.ron

Failed in:
Enum PartialValue allows 2 -> 1 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:276
Struct PartialSum allows 2 -> 1 generic types in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:57

--- 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.41.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:275

@aborgna-q aborgna-q requested review from cqc-alec and removed request for jake-arkinstall April 28, 2025 12:36
@aborgna-q
Copy link
Collaborator Author

@cqc-alec You already did the review on the original PR, so this should be mergable as-is

@aborgna-q aborgna-q added this pull request to the merge queue Apr 28, 2025
Merged via the queue into release-rs-v0.16.0 with commit d91dbe6 Apr 28, 2025
51 checks passed
@aborgna-q aborgna-q deleted the zrho/model-stable branch April 28, 2025 13:06
aborgna-q added a commit that referenced this pull request May 7, 2025
Re-created from #2113, targeting the release branch instead.

BREAKING CHANGE: Downstream crates need to remove the model_unstable
feature flag when referencing hugr or hugr-core.

---------

Co-authored-by: Lukas Heidemann <[email protected]>
This was referenced May 7, 2025
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.

5 participants