Skip to content

Conversation

lmondada
Copy link
Contributor

@lmondada lmondada commented Apr 8, 2025

This PR splits the Rewrite trait into two (three) traits:

  • a VerifyPatch trait that has the fn verify and fn invalidation_set functions
  • a ApplyPatch trait that has the fn apply function. This inherits VerifyPatch and is the "rewriting" trait that should be used in most scenarios.

In addition, there is a third trait ApplyPatchHugrMut that can be implemented by any patches that can be applied to any HugrMut (as opposed to a specific type H). This is strictly stronger than ApplyPatch and should be implemented instead of ApplyPatch where possible (see the docs of the traits).

closes #588
closes #2052

BREAKING CHANGE: Replaced the Rewrite trait with Patch. Rewrite::ApplyResult is now Patch::Outcome. Rewrite::verify was split into a separate trait, and is now PatchVerification::verify.
BREAKING CHANGE: Renamed hugr.rewrite module to hugr.patch.
BREAKING CHANGE: Changed the type OutlineCfg::ApplyResult (now OutlineCfg::Outcome) from (Node, Node) to [Node; 2].

@lmondada lmondada requested a review from a team as a code owner April 8, 2025 15:30
@lmondada lmondada requested review from aborgna-q, acl-cqc and Copilot and removed request for acl-cqc April 8, 2025 15:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 64.77733% with 87 lines in your changes missing coverage. Please review.

Project coverage is 83.44%. Comparing base (6ca1258) to head (36bb909).
Report is 1 commits behind head on release-rs-v0.16.0.

Files with missing lines Patch % Lines
hugr-core/src/hugr/patch/replace.rs 70.49% 30 Missing and 6 partials ⚠️
hugr-core/src/hugr/patch.rs 10.34% 26 Missing ⚠️
hugr-core/src/hugr/patch/outline_cfg.rs 46.15% 7 Missing ⚠️
hugr-core/src/hugr/patch/inline_call.rs 58.33% 3 Missing and 2 partials ⚠️
hugr-core/src/hugr/patch/inline_dfg.rs 28.57% 3 Missing and 2 partials ⚠️
hugr-core/src/hugr/patch/consts.rs 82.35% 0 Missing and 3 partials ⚠️
hugr-core/src/hugr/patch/insert_identity.rs 57.14% 3 Missing ⚠️
hugr-core/src/hugr/patch/simple_replace.rs 96.42% 1 Missing ⚠️
hugr-passes/src/lower.rs 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           release-rs-v0.16.0    #2070      +/-   ##
======================================================
- Coverage               83.45%   83.44%   -0.02%     
======================================================
  Files                     219      219              
  Lines                   42141    42200      +59     
  Branches                38243    38302      +59     
======================================================
+ Hits                    35167    35212      +45     
- Misses                   5159     5172      +13     
- Partials                 1815     1816       +1     
Flag Coverage Δ
python 85.73% <ø> (ø)
rust 83.20% <64.77%> (-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.

@hugrbot
Copy link
Collaborator

hugrbot commented Apr 8, 2025

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary

--- 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_core::hugr::rewrite::simple_replace::SimpleReplacementError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/simple_replace.rs:351
enum hugr_core::hugr::rewrite::SimpleReplacementError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/simple_replace.rs:351
enum hugr_core::hugr::rewrite::inline_call::InlineCallError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_call.rs:17
enum hugr_core::hugr::rewrite::outline_cfg::OutlineCfgError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/outline_cfg.rs:226
enum hugr_core::hugr::rewrite::replace::NewEdgeKind, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:31
enum hugr_core::hugr::rewrite::replace::ReplaceError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:398
enum hugr_core::hugr::rewrite::inline_dfg::InlineDFGError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_dfg.rs:15
enum hugr_core::hugr::rewrite::consts::RemoveError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/consts.rs:18
enum hugr_core::hugr::rewrite::replace::WhichHugr, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:434
enum hugr_core::hugr::rewrite::insert_identity::IdentityInsertionError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/insert_identity.rs:38
enum hugr_core::hugr::rewrite::BoundaryPort, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/port_types.rs:14

--- 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::hugr::rewrite::insert_identity, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/insert_identity.rs:1
mod hugr_core::hugr::rewrite::outline_cfg, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/outline_cfg.rs:1
mod hugr_core::hugr::rewrite::consts, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/consts.rs:1
mod hugr_core::hugr::rewrite::simple_replace, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/simple_replace.rs:1
mod hugr_core::hugr::rewrite::inline_dfg, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_dfg.rs:1
mod hugr_core::hugr::rewrite, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:1
mod hugr_core::hugr::rewrite::replace, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:1
mod hugr_core::hugr::rewrite::inline_call, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_call.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_core::hugr::rewrite::outline_cfg::OutlineCfg, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/outline_cfg.rs:21
struct hugr_core::hugr::rewrite::inline_call::InlineCall, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_call.rs:12
struct hugr_core::hugr::rewrite::simple_replace::SimpleReplacement, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/simple_replace.rs:25
struct hugr_core::hugr::rewrite::SimpleReplacement, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/simple_replace.rs:25
struct hugr_core::hugr::rewrite::consts::RemoveLoadConstant, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/consts.rs:13
struct hugr_core::hugr::rewrite::Transactional, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:59
struct hugr_core::hugr::rewrite::insert_identity::IdentityInsertion, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/insert_identity.rs:18
struct hugr_core::hugr::rewrite::HostPort, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/port_types.rs:23
struct hugr_core::hugr::rewrite::ReplacementPort, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/port_types.rs:27
struct hugr_core::hugr::rewrite::consts::RemoveConst, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/consts.rs:74
struct hugr_core::hugr::rewrite::replace::NewEdgeSpec, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:18
struct hugr_core::hugr::rewrite::inline_dfg::InlineDFG, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/inline_dfg.rs:10
struct hugr_core::hugr::rewrite::replace::Replacement, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite/replace.rs:57

--- 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 apply_rewrite of trait HugrMut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/hugrmut.rs:199

--- 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::hugr::rewrite::Rewrite, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:20
trait hugr_core::hugr::Rewrite, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/rewrite.rs:20

@aborgna-q aborgna-q added the breaking-change Changes that break semver label Apr 8, 2025
@aborgna-q aborgna-q added this to the hugr-rs 0.16 milestone Apr 8, 2025
Comment on lines 39 to 50
/// A patch that can be applied to a Hugr of type `H`.
///
/// ### When to use
///
/// Use this trait whenever possible in bounds for the most generality. Note
/// that this will require specifying which types `H` the patch applies to.
///
/// ### When to implement
///
/// For `H: HugrMut`, prefer implementing [`ApplyPatchHugrMut`] instead. This
/// will automatically implement this trait.
pub trait ApplyPatch<H: HugrView>: VerifyPatch<Node = H::Node> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming suggestion: Since this is the main entrypoint, could it just be called Patch?

VerifyPatch is more niche, and the name still reflects its a verification for the things you'll do on this trait.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

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.

Like it. Like it a lot! :). Agree with Agustin's suggesting of calling ApplyPatch just Patch.

I've made a lot of driveby comments, more than is really fair, feel free to be selective!

I'd approve all of this except for the changes to Replacement. I remember we talked about this and I can't really remember what we said but I do see now that it is more complex than we talked then. However I've had a go and

  • branch acl/rewrite-trait finds, I think, a better solution, via an enum DynEdgeSpec which stores the three possible kinds of NewEdgeSpec and thus removes the need for DynNode. This saves about 35 lines overall and reduces change vs. the original (branch main).
  • branch acl/rewrite-trait2 goes even further, as I realized that the previous branch does in fact make enum WhichHugr completely redundant. You can see the steps there to remove WhichHugr (including the first commit e61f800 verifying that it is indeed redundant)

I suggest you merge in one or other of those two branches and then I'll approve. (Renaming/etc. is fine and probably advisable - DynEdgeSpec might be better called WhichEdgeSpec, the variants might be better named MuIn/MuOut/MuNew, whatever.)

type Node;

/// Checks whether the rewrite would succeed on the specified Hugr.
/// If this call succeeds, [self.apply] should also succeed on the same `h`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these doclinks work? I'd expect you to have to link to [ApplyPatch::apply]. It might also be worth clarifying in the comment, if ``self`` is an [ApplyPatch].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good spot, fixed!

fn invalidation_set(&self) -> impl Iterator<Item = Self::Node>;
}

/// A patch that can be applied to a Hugr of type `H`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// A patch that can be applied to a Hugr of type `H`.
/// A patch that can be applied to a mutable Hugr of type `H`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

/// ### When to use
///
/// Use this trait whenever possible in bounds for the most generality. Note
/// that this will require specifying which types `H` the patch applies to.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// that this will require specifying which types `H` the patch applies to.
/// that this will require specifying which type `H` the patch applies to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

fn apply(self, h: &mut H) -> Result<Self::Outcome, Self::Error>;
}

/// A patch that can be applied to any HugrMut.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// A patch that can be applied to any HugrMut.
/// A patch that can be applied to any [HugrMut].

///
/// [CFG]: OpType::CFG
type ApplyResult = (Node, Node);
type Outcome = (Node, Node);
Copy link
Contributor

Choose a reason for hiding this comment

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

complete driveby: This'd be better as a [Node; 2] if you fancied changing it

.ok_or(ReplaceError::InvalidAdoptingParent(n))
})?;
let mut transferred: HashSet<Node> = self.adoptions.values().copied().collect();
let mut transferred: HashSet<_> = self.adoptions.values().copied().collect();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let mut transferred: HashSet<_> = self.adoptions.values().copied().collect();
let mut transferred: HashSet<HostNode> = self.adoptions.values().copied().collect();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

applied.

dfg_hugr: Hugr,
#[values(apply_simple, apply_replace)] applicator: impl Fn(&mut Hugr, SimpleReplacement),
) {
use crate::hugr::patch::VerifyPatch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Move this to the top? (An annoying artefact of rstest combined with VSCode)

It is currently impossible to obtain the map from nodes in the
replacement graph to newly inserted nodes in `self` from the
`ApplyResult` type for `SimpleReplacement`.

This PR fixes this.

BREAKING CHANGE: The `ApplyResult` associated type of
`SimpleReplacement` is now a custom struct. The deleted nodes returned
previously can be obtained using the `result.deleted_nodes` field.
@acl-cqc
Copy link
Contributor

acl-cqc commented Apr 22, 2025

Suggest you target this at branch release-rs-v0.16.0

@lmondada lmondada requested a review from acl-cqc April 28, 2025 12:34
@lmondada lmondada force-pushed the feat/rewrite-trait branch from c7c6dc7 to 74eb7df Compare April 28, 2025 13:37
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.

Great stuff! I'd love a shorter name than SimpleReplacementOutcome, and would definitely like to rename DynEdgeSpec (yes, my name, I know!....) but LGTM :-) 👍

use super::HugrMut;

/// Verify that a patch application would succeed.
pub trait PatchVerification {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider Verification or Verifiable but this is OK by me :)

///
/// For `H: HugrMut`, prefer implementing [`PatchHugrMut`] instead. This
/// will automatically implement this trait.
pub trait Patch<H: HugrView>: PatchVerification<Node = H::Node> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any cases where H is not a HugrMut? If not, then bounding by HugrMut would be more obvious, and we could always change to HugrView if such a case comes up later (non-breaking as HugrView is a supertrait)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

H can be a PersistentHugr, which won't implement HugrMut (at least in its current form)

let mut repls = hugr.apply_rewrite(rw)?;
debug_assert_eq!(repls.len(), 1);
Ok(repls.remove(0))
let mut removed_nodes = hugr.apply_patch(rw)?.removed_nodes;
Copy link
Contributor

Choose a reason for hiding this comment

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

might could drop the mut and use into_iter rather than drain

}

/// Result of applying a [`SimpleReplacement`].
pub struct SimpleReplacementOutcome<HostNode = Node> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was hoping you might find a shorter name but OK...

Copy link
Contributor Author

@lmondada lmondada Apr 29, 2025

Choose a reason for hiding this comment

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

PatchOutcome? Or just Outcome? I know you didn't like it when the type name equaled the associated type name, but it's what std does for e.g. vec::Iter.

Unlike a trait name, in this case I personally don't mind having a short and slightly ambiguous name. The user can always choose to only import the module and refer to it by simple_replace::Outcome

/// Nodes in the existing Hugr that are not [Replacement::removal]
/// (or are on the RHS of an entry in [Replacement::adoptions])
Retained,
pub enum DynEdgeSpec<HostNode> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest - strongly suggest - renaming this to something like WhichEdgeSpec - that agrees more with the comment, and that this replaces WhichHugr, and that we don't really do anything dyn with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WhichEdgeSpec is a good name

lmondada and others added 4 commits April 29, 2025 07:03
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
@lmondada lmondada enabled auto-merge April 29, 2025 13:12
@lmondada lmondada added this pull request to the merge queue Apr 29, 2025
Merged via the queue into release-rs-v0.16.0 with commit db4b39f Apr 29, 2025
24 of 25 checks passed
@lmondada lmondada deleted the feat/rewrite-trait branch April 29, 2025 13:20
github-merge-queue bot pushed a commit that referenced this pull request Apr 29, 2025
Oupsie, during one of the merge conflict resolutions I must have
forgotten to remove the old `rewrite.rs` file. As you can see in the
`hugr-core/src/hugr.rs` file, this is no longer a module and thus the
file should be deleted. It has been renamed to `patch.rs` in #2070
aborgna-q pushed a commit that referenced this pull request May 7, 2025
This PR splits the `Rewrite` trait into two (three) traits:
- a `VerifyPatch` trait that has the `fn verify` and `fn
invalidation_set` functions
- a `ApplyPatch` trait that has the `fn apply` function. This inherits
`VerifyPatch` and is the "rewriting" trait that should be used in most
scenarios.

In addition, there is a third trait `ApplyPatchHugrMut` that can be
implemented by any patches that can be applied to _any_ `HugrMut` (as
opposed to a specific type `H`). This is strictly stronger than
`ApplyPatch` and should be implemented instead of `ApplyPatch` where
possible (see the docs of the traits).

closes #588
closes #2052

BREAKING CHANGE: Replaced the `Rewrite` trait with `Patch`.
`Rewrite::ApplyResult` is now `Patch::Outcome`. `Rewrite::verify` was
split into a separate trait, and is now `PatchVerification::verify`.
BREAKING CHANGE: Renamed `hugr.rewrite` module to `hugr.patch`.
BREAKING CHANGE: Changed the type `OutlineCfg::ApplyResult` (now
`OutlineCfg::Outcome`) from `(Node, Node)` to `[Node; 2]`.

---------

Co-authored-by: Alan Lawrence <alan.lawrence@cambridgequantum.com>
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
aborgna-q pushed a commit that referenced this pull request May 7, 2025
Oupsie, during one of the merge conflict resolutions I must have
forgotten to remove the old `rewrite.rs` file. As you can see in the
`hugr-core/src/hugr.rs` file, this is no longer a module and thus the
file should be deleted. It has been renamed to `patch.rs` in #2070
This was referenced May 7, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 14, 2025
~The base of this PR will be moved to main once #2070 has been merged
in.~

~Status: The API and main `struct`s have been defined. Most of the core
logic has yet to be implemented.~

Status: PR is ready. The trait implementations for `HugrView`,
`VerifyPatch` and `ApplyPatch` will be in a separate PR once progress on
those is unblocked.

Closes  #2096
@hugrbot hugrbot mentioned this pull request May 14, 2025
This was referenced May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes that break semver wait to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic Rewrite trait over HugrMut type Rename 'Rewrite'

4 participants