Skip to content

feat!: Follow pass scopes in composable passes#1429

Draft
aborgna-q wants to merge 5 commits intoab/hugr-0.26.0from
ab/pass-scopes
Draft

feat!: Follow pass scopes in composable passes#1429
aborgna-q wants to merge 5 commits intoab/hugr-0.26.0from
ab/pass-scopes

Conversation

@aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Mar 2, 2026

Adds support for PassScopes 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.

@hugrbot
Copy link
Collaborator

hugrbot commented Mar 2, 2026

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary
    Building tket v0.17.0 (current)
error: running cargo-doc on crate 'tket' failed with output:
-----
 Compiling proc-macro2 v1.0.106
 Compiling unicode-ident v1.0.24
 Compiling quote v1.0.44
 Compiling serde_core v1.0.228
 Compiling libc v0.2.182
 Compiling serde v1.0.228
 Compiling memchr v2.8.0
 Compiling syn v2.0.117
 Compiling shlex v1.3.0
 Compiling autocfg v1.5.0
 Compiling jobserver v0.1.34
 Compiling find-msvc-tools v0.1.9
 Compiling num-traits v0.2.19
 Compiling cc v1.2.56
  Checking either v1.15.0
  Checking once_cell v1.21.3
  Checking cfg-if v1.0.4
 Compiling version_check v0.9.5
  Checking equivalent v1.0.2
  Checking hashbrown v0.16.1
 Compiling semver v1.0.27
 Compiling crossbeam-utils v0.8.21
 Compiling aho-corasick v1.1.4
  Checking indexmap v2.13.0
 Compiling regex-syntax v0.8.10
 Compiling pkg-config v0.3.32
 Compiling lazy_static v1.5.0
 Compiling radium v0.7.0
 Compiling ucd-trie v0.1.7
 Compiling zstd-sys v2.0.16+zstd.1.5.7
  Checking tap v1.0.1
 Compiling thiserror v2.0.18
 Compiling regex-automata v0.4.14
 Compiling fnv v1.0.7
 Compiling ident_case v1.0.1
 Compiling thiserror v1.0.69
 Compiling unicode-segmentation v1.12.0
 Compiling serde_derive v1.0.228
 Compiling strsim v0.11.1
 Compiling zmij v1.0.21
 Compiling darling_core v0.21.3
 Compiling convert_case v0.10.0
 Compiling thiserror-impl v2.0.18
 Compiling regex v1.12.3
 Compiling thiserror-impl v1.0.69
  Checking wyz v0.5.1
 Compiling pest v2.8.6
  Checking crossbeam-epoch v0.9.18
  Checking smallvec v1.15.1
 Compiling zerocopy v0.8.40
 Compiling unicode-xid v0.2.6
  Checking itoa v1.0.17
 Compiling typeid v1.0.3
 Compiling getrandom v0.4.1
 Compiling serde_json v1.0.149
 Compiling paste v1.0.15
 Compiling rayon-core v1.13.0
  Checking funty v2.0.0
  Checking foldhash v0.1.5
  Checking hashbrown v0.15.5
 Compiling pest_meta v2.8.6
  Checking bitvec v1.0.1
 Compiling derive_more-impl v2.1.1
  Checking crossbeam-deque v0.8.6
 Compiling darling_macro v0.21.3
 Compiling slotmap_fork_lmondada v1.0.8
 Compiling ahash v0.8.12
 Compiling zstd-safe v7.2.4
 Compiling winnow v0.7.14
 Compiling convert_case v0.4.0
  Checking fixedbitset v0.5.7
 Compiling heck v0.5.0
 Compiling ref-cast v1.0.25
  Checking pin-project-lite v0.2.17
 Compiling erased-serde v0.4.9
 Compiling strum_macros v0.27.2
  Checking derive_more v2.1.1
  Checking petgraph v0.8.3
 Compiling toml_parser v1.0.9+spec-1.1.0
 Compiling derive_more v0.99.20
 Compiling darling v0.21.3
 Compiling pest_generator v2.8.6
 Compiling llvm-sys v140.1.3
 Compiling ref-cast-impl v1.0.25
 Compiling serde_derive_internals v0.29.1
 Compiling rustc_version v0.4.1
  Checking itertools v0.14.0
  Checking rustc-hash v2.1.1
  Checking byteorder v1.5.0
 Compiling toml_datetime v0.7.5+spec-1.1.0
 Compiling typetag v0.2.21
 Compiling rustix v1.1.4
  Checking typed-arena v2.0.2
 Compiling parking_lot_core v0.9.12
 Compiling cgmath v0.18.0
  Checking arrayvec v0.5.2
  Checking unicode-width v0.2.2
  Checking pretty v0.12.5
 Compiling toml_edit v0.23.10+spec-1.0.0
  Checking fxhash v0.2.1
 Compiling schemars_derive v1.2.1
 Compiling rstest_macros v0.26.1
 Compiling pest_derive v2.8.6
  Checking rayon v1.11.0
 Compiling serde_with_macros v3.17.0
  Checking strum v0.27.2
  Checking ordered-float v5.1.0
 Compiling typetag-impl v0.2.21
 Compiling derive-where v1.6.0
 Compiling tracing-attributes v0.1.31
 Compiling delegate v0.13.5
  Checking tracing-core v0.1.36
  Checking approx v0.4.0
  Checking itertools v0.13.0
  Checking smol_str v0.3.5
  Checking capnp v0.25.1
  Checking scopeguard v1.2.0
  Checking utf8-width v0.1.8
  Checking base64 v0.22.1
  Checking inventory v0.3.22
  Checking dyn-clone v1.0.20
  Checking bitflags v2.11.0
 Compiling fixedbitset v0.4.2
 Compiling syn v1.0.109
  Checking bumpalo v3.20.2
  Checking allocator-api2 v0.2.21
  Checking linux-raw-sys v0.12.1
  Checking hashbrown v0.14.5
  Checking relrc v0.5.0
  Checking hugr-model v0.25.6
 Compiling petgraph v0.6.5
  Checking schemars v1.2.1
  Checking zstd v0.13.3
 Compiling enum_dispatch v0.3.13
  Checking html-escape v0.2.13
  Checking lock_api v0.4.14
  Checking tracing v0.1.44
  Checking portgraph v0.15.3
  Checking serde_with v3.17.0
 Compiling proc-macro-crate v3.4.0
 Compiling ascent_base v0.8.0
 Compiling futures-macro v0.3.32
 Compiling derive-syn-parse v0.2.0
 Compiling glob v0.3.3
  Checking futures-task v0.3.32
 Compiling duplicate v2.0.1
  Checking fastrand v2.3.0
 Compiling pastey v0.2.1
 Compiling anyhow v1.0.102
  Checking slab v0.4.12
  Checking downcast-rs v2.0.2
  Checking static_assertions v1.1.0
 Compiling inkwell v0.8.0
  Checking futures-core v0.3.32
 Compiling relative-path v1.9.3
  Checking hugr-core v0.25.6
  Checking futures-util v0.3.32
 Compiling ascent_macro v0.8.0
  Checking tempfile v3.26.0
  Checking dashmap v5.5.3
 Compiling inkwell_internals v0.13.0
 Compiling hugr-llvm v0.25.6
  Checking console v0.15.11
  Checking instant v0.1.13
  Checking futures-timer v3.0.3
  Checking similar v2.7.0
  Checking boxcar v0.1.0
  Checking insta v1.46.3
  Checking ascent v0.8.0
 Compiling delegate v0.10.0
  Checking rstest v0.26.1
  Checking num-integer v0.1.46
  Checking context-iterators v0.2.0
  Checking hugr-passes v0.25.6
  Checking portgraph v0.8.0
  Checking num-bigint v0.4.6
  Checking uuid v1.21.0
  Checking csv-core v0.1.13
  Checking rmp v0.8.15
  Checking itertools v0.10.5
  Checking ryu v1.0.23
  Checking iana-time-zone v0.1.65
  Checking bimap v0.6.3
  Checking rustc-hash v1.1.0
  Checking chrono v0.4.44
  Checking csv v1.4.0
  Checking portmatching v0.3.3
  Checking rmp-serde v1.3.1
  Checking tket-json-rs v0.8.1
  Checking num-rational v0.4.2
  Checking crossbeam-channel v0.5.15
  Checking priority-queue v2.7.0
  Checking bytemuck v1.25.0
  Checking hugr v0.25.6
Documenting tket v0.17.0 (/home/runner/work/tket2/tket2/PR_BRANCH/tket)
error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/modifier/pass.rs:3:40
|
3 | use hugr::algorithms::{ComposablePass, PassScope};
|                                        ^^^^^^^^^ no `PassScope` in the root

error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/borrow_squash.rs:4:40
|
4 | use hugr::algorithms::{ComposablePass, PassScope};
|                                        ^^^^^^^^^ no `PassScope` in the root

error[E0432]: unresolved import `hugr::algorithms::composable::WithScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:4:5
|
4 | use hugr::algorithms::composable::WithScope;
|     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `WithScope` in `composable`

error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:11:21
 |
11 |     ComposablePass, PassScope, RemoveDeadFuncsError, RemoveDeadFuncsPass, UntuplePass,
 |                     ^^^^^^^^^ no `PassScope` in the root

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/modifier/pass.rs:23:5
 |
23 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
24 | |         self.scope = scope.into();
25 | |         self
26 | |     }
 | |_____^ not a member of trait `ComposablePass`

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/borrow_squash.rs:39:5
 |
39 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
40 | |         self.scope = scope.into();
41 | |         self
42 | |     }
 | |_____^ not a member of trait `ComposablePass`

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:102:5
  |
102 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
103 | |         self.scope = scope.into();
104 | |         self
105 | |     }
  | |_____^ not a member of trait `ComposablePass`

Some errors have detailed explanations: E0407, E0432.
For more information about an error, try `rustc --explain E0407`.
error: could not document `tket`

-----

error: failed to build rustdoc for crate tket v0.17.0
note: this is usually due to a compilation error in the crate,
    and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
    cargo new --lib example &&
        cd example &&
        echo '[workspace]' >> Cargo.toml &&
        cargo add --path /home/runner/work/tket2/tket2/PR_BRANCH/tket --features binary-eccs,default,llvm,portmatching,rewrite-tracing &&
        cargo check &&
        cargo doc

  Building tket-qsystem v0.23.0 (current)
error: running cargo-doc on crate 'tket-qsystem' failed with output:
-----
 Compiling proc-macro2 v1.0.106
 Compiling unicode-ident v1.0.24
 Compiling quote v1.0.44
 Compiling libc v0.2.182
 Compiling serde_core v1.0.228
 Compiling memchr v2.8.0
 Compiling shlex v1.3.0
 Compiling syn v2.0.117
 Compiling find-msvc-tools v0.1.9
 Compiling jobserver v0.1.34
  Checking once_cell v1.21.3
  Checking cfg-if v1.0.4
 Compiling cc v1.2.56
 Compiling serde v1.0.228
 Compiling autocfg v1.5.0
 Compiling num-traits v0.2.19
 Compiling version_check v0.9.5
  Checking either v1.15.0
 Compiling heck v0.5.0
 Compiling crossbeam-utils v0.8.21
 Compiling semver v1.0.27
 Compiling aho-corasick v1.1.4
 Compiling regex-syntax v0.8.10
 Compiling hashbrown v0.16.1
 Compiling equivalent v1.0.2
 Compiling indexmap v2.13.0
 Compiling regex-automata v0.4.14
 Compiling lazy_static v1.5.0
 Compiling pkg-config v0.3.32
 Compiling zstd-sys v2.0.16+zstd.1.5.7
 Compiling fnv v1.0.7
 Compiling serde_derive v1.0.228
 Compiling thiserror v2.0.18
 Compiling getrandom v0.4.1
  Checking unicode-width v0.2.2
 Compiling unicode-segmentation v1.12.0
 Compiling zmij v1.0.21
 Compiling strsim v0.11.1
 Compiling ucd-trie v0.1.7
 Compiling regex v1.12.3
  Checking smallvec v1.15.1
 Compiling ident_case v1.0.1
 Compiling darling_core v0.21.3
 Compiling pest v2.8.6
 Compiling convert_case v0.10.0
 Compiling thiserror-impl v2.0.18
  Checking crossbeam-epoch v0.9.18
  Checking itoa v1.0.17
 Compiling radium v0.7.0
 Compiling rayon-core v1.13.0
  Checking foldhash v0.1.5
 Compiling serde_json v1.0.149
 Compiling zerocopy v0.8.40
 Compiling unicode-xid v0.2.6
 Compiling paste v1.0.15
 Compiling typeid v1.0.3
 Compiling derive_more-impl v2.1.1
  Checking hashbrown v0.15.5
 Compiling darling_macro v0.21.3
  Checking crossbeam-deque v0.8.6
 Compiling pest_meta v2.8.6
 Compiling ahash v0.8.12
 Compiling slotmap_fork_lmondada v1.0.8
  Checking tracing-core v0.1.36
 Compiling winnow v0.7.14
  Checking pin-project-lite v0.2.17
 Compiling zstd-safe v7.2.4
 Compiling thiserror v1.0.69
 Compiling rustix v1.1.4
  Checking fixedbitset v0.5.7
 Compiling erased-serde v0.4.9
  Checking tap v1.0.1
 Compiling ref-cast v1.0.25
  Checking wyz v0.5.1
 Compiling toml_parser v1.0.9+spec-1.1.0
  Checking petgraph v0.8.3
  Checking derive_more v2.1.1
 Compiling pest_generator v2.8.6
 Compiling darling v0.21.3
 Compiling llvm-sys v140.1.3
 Compiling ref-cast-impl v1.0.25
 Compiling strum_macros v0.27.2
 Compiling thiserror-impl v1.0.69
 Compiling serde_derive_internals v0.29.1
 Compiling rustc_version v0.4.1
  Checking itertools v0.14.0
 Compiling convert_case v0.4.0
  Checking rustc-hash v2.1.1
 Compiling parking_lot_core v0.9.12
  Checking typed-arena v2.0.2
  Checking linux-raw-sys v0.12.1
 Compiling toml_datetime v0.7.5+spec-1.1.0
 Compiling cgmath v0.18.0
  Checking bitflags v2.11.0
  Checking funty v2.0.0
  Checking byteorder v1.5.0
  Checking arrayvec v0.5.2
 Compiling typetag v0.2.21
  Checking pretty v0.12.5
  Checking bitvec v1.0.1
  Checking fxhash v0.2.1
 Compiling toml_edit v0.23.10+spec-1.0.0
 Compiling derive_more v0.99.20
 Compiling rstest_macros v0.26.1
 Compiling schemars_derive v1.2.1
  Checking strum v0.27.2
  Checking rayon v1.11.0
 Compiling serde_with_macros v3.17.0
 Compiling pest_derive v2.8.6
  Checking ordered-float v5.1.0
 Compiling derive-where v1.6.0
 Compiling tracing-attributes v0.1.31
 Compiling delegate v0.13.5
 Compiling typetag-impl v0.2.21
  Checking approx v0.4.0
  Checking itertools v0.13.0
  Checking smol_str v0.3.5
  Checking utf8-width v0.1.8
  Checking inventory v0.3.22
  Checking bumpalo v3.20.2
  Checking capnp v0.25.1
  Checking utf8parse v0.2.2
  Checking base64 v0.22.1
  Checking allocator-api2 v0.2.21
  Checking scopeguard v1.2.0
  Checking fastrand v2.3.0
 Compiling fixedbitset v0.4.2
  Checking dyn-clone v1.0.20
  Checking schemars v1.2.1
 Compiling petgraph v0.6.5
  Checking relrc v0.5.0
  Checking hashbrown v0.14.5
  Checking tempfile v3.26.0
  Checking lock_api v0.4.14
  Checking hugr-model v0.25.6
  Checking anstyle-parse v0.2.7
 Compiling enum_dispatch v0.3.13
  Checking html-escape v0.2.13
  Checking tracing v0.1.44
  Checking portgraph v0.15.3
  Checking serde_with v3.17.0
  Checking zstd v0.13.3
 Compiling proc-macro-crate v3.4.0
 Compiling ascent_base v0.8.0
 Compiling derive-syn-parse v0.2.0
 Compiling futures-macro v0.3.32
  Checking anstyle v1.0.13
  Checking colorchoice v1.0.4
  Checking anstyle-query v1.1.5
  Checking is_terminal_polyfill v1.70.2
 Compiling inkwell v0.8.0
 Compiling anyhow v1.0.102
 Compiling relative-path v1.9.3
 Compiling duplicate v2.0.1
  Checking slab v0.4.12
  Checking downcast-rs v2.0.2
  Checking futures-core v0.3.32
  Checking static_assertions v1.1.0
 Compiling pastey v0.2.1
  Checking futures-task v0.3.32
 Compiling glob v0.3.3
  Checking futures-util v0.3.32
  Checking hugr-core v0.25.6
 Compiling ascent_macro v0.8.0
  Checking anstream v0.6.21
  Checking dashmap v5.5.3
 Compiling inkwell_internals v0.13.0
 Compiling hugr-llvm v0.25.6
  Checking console v0.15.11
  Checking instant v0.1.13
  Checking boxcar v0.1.0
  Checking similar v2.7.0
  Checking clap_lex v1.0.0
  Checking futures-timer v3.0.3
  Checking ascent v0.8.0
  Checking rstest v0.26.1
  Checking clap_builder v4.5.60
  Checking insta v1.46.3
 Compiling clap_derive v4.5.55
 Compiling proc-macro-error-attr2 v2.0.0
  Checking log v0.4.29
 Compiling proc-macro-error2 v2.0.1
  Checking num-integer v0.1.46
  Checking bytecount v0.6.9
  Checking same-file v1.0.6
  Checking walkdir v2.5.0
  Checking papergrid v0.17.0
  Checking num-bigint v0.4.6
  Checking clap v4.5.60
  Checking hugr-passes v0.25.6
 Compiling tabled_derive v0.11.0
  Checking tracing-log v0.2.0
  Checking sharded-slab v0.1.7
  Checking uuid v1.21.0
  Checking testing_table v0.3.0
  Checking csv-core v0.1.13
  Checking is-terminal v0.4.17
  Checking thread_local v1.1.9
  Checking ryu v1.0.23
  Checking nu-ansi-term v0.50.3
  Checking iana-time-zone v0.1.65
  Checking chrono v0.4.44
  Checking tracing-subscriber v0.3.22
  Checking csv v1.4.0
  Checking clio v0.3.5
  Checking tabled v0.20.0
  Checking tket-json-rs v0.8.1
  Checking num-rational v0.4.2
  Checking clap-verbosity-flag v3.0.4
  Checking priority-queue v2.7.0
  Checking crossbeam-channel v0.5.15
  Checking bytemuck v1.25.0
  Checking hugr v0.25.6
  Checking hugr-cli v0.25.6
  Checking tket v0.17.0 (/home/runner/work/tket2/tket2/PR_BRANCH/tket)
error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/modifier/pass.rs:3:40
|
3 | use hugr::algorithms::{ComposablePass, PassScope};
|                                        ^^^^^^^^^ no `PassScope` in the root

error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/borrow_squash.rs:4:40
|
4 | use hugr::algorithms::{ComposablePass, PassScope};
|                                        ^^^^^^^^^ no `PassScope` in the root

error[E0432]: unresolved import `hugr::algorithms::composable::WithScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:4:5
|
4 | use hugr::algorithms::composable::WithScope;
|     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `WithScope` in `composable`

error[E0432]: unresolved import `hugr::algorithms::PassScope`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:11:21
 |
11 |     ComposablePass, PassScope, RemoveDeadFuncsError, RemoveDeadFuncsPass, UntuplePass,
 |                     ^^^^^^^^^ no `PassScope` in the root

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/modifier/pass.rs:23:5
 |
23 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
24 | |         self.scope = scope.into();
25 | |         self
26 | |     }
 | |_____^ not a member of trait `ComposablePass`

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
--> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/borrow_squash.rs:39:5
 |
39 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
40 | |         self.scope = scope.into();
41 | |         self
42 | |     }
 | |_____^ not a member of trait `ComposablePass`

error[E0407]: method `with_scope_internal` is not a member of trait `ComposablePass`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:102:5
  |
102 | /     fn with_scope_internal(mut self, scope: impl Into<PassScope>) -> Self {
103 | |         self.scope = scope.into();
104 | |         self
105 | |     }
  | |_____^ not a member of trait `ComposablePass`

error[E0599]: no method named `with_scope` found for struct `NormalizeCFGPass<N>` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:110:18
  |
109 | /             NormalizeCFGPass::default()
110 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `NormalizeCFGPass<_>`
  | |_________________|
  |

error[E0599]: no method named `with_scope` found for struct `UntuplePass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:116:18
  |
115 | /             UntuplePass::new(UntupleRecursive::Recursive)
116 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `UntuplePass`
  | |_________________|
  |

error[E0599]: no method named `with_scope` found for struct `ConstantFoldPass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:122:18
  |
121 | /             ConstantFoldPass::default()
122 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `ConstantFoldPass`
  | |_________________|
  |

error[E0599]: no method named `with_scope` found for struct `RemoveDeadFuncsPass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:129:18
  |
128 | /             RemoveDeadFuncsPass::default()
129 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `RemoveDeadFuncsPass`
  | |_________________|
  |

error[E0599]: no method named `with_scope` found for struct `InlineDFGsPass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:135:18
  |
134 | /             InlineDFGsPass
135 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `InlineDFGsPass`
  | |_________________|
  |

error[E0599]: no method named `with_scope` found for struct `BorrowSquashPass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:143:18
  |
142 | /             BorrowSquashPass::default()
143 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `BorrowSquashPass`
  | |_________________|
  |
  |
 ::: /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/borrow_squash.rs:25:1
  |
25 |   pub struct BorrowSquashPass {
  |   --------------------------- method `with_scope` not found for this struct

error[E0599]: no method named `with_scope` found for struct `RedundantOrderEdgesPass` in the current scope
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/passes/guppy.rs:151:18
  |
149 | /             RedundantOrderEdgesPass::default()
150 | |                 .recursive(true)
151 | |                 .with_scope(self.scope.clone())
  | |                 -^^^^^^^^^^ method not found in `RedundantOrderEdgesPass`
  | |_________________|
  |

Some errors have detailed explanations: E0407, E0432, E0599.
For more information about an error, try `rustc --explain E0407`.
error: could not compile `tket` (lib) due to 14 previous errors

-----

error: failed to build rustdoc for crate tket-qsystem v0.23.0
note: this is usually due to a compilation error in the crate,
    and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
    cargo new --lib example &&
        cd example &&
        echo '[workspace]' >> Cargo.toml &&
        cargo add --path /home/runner/work/tket2/tket2/PR_BRANCH/tket-qsystem --features cli,default,llvm &&
        cargo check &&
        cargo doc

error: aborting due to failure to build rustdoc for crate tket v0.17.0

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 69.04762% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.53%. Comparing base (353c9c3) to head (ca4ba4b).

Files with missing lines Patch % Lines
tket-qsystem/src/extension/qsystem/lower.rs 73.33% 7 Missing and 5 partials ⚠️
tket/src/passes/guppy.rs 65.21% 4 Missing and 4 partials ⚠️
tket/src/modifier/pass.rs 0.00% 7 Missing ⚠️
tket-qsystem/src/replace_bools.rs 53.84% 4 Missing and 2 partials ⚠️
tket-qsystem/src/lower_drops.rs 33.33% 4 Missing ⚠️
tket-qsystem/src/extension/qsystem/barrier.rs 0.00% 1 Missing ⚠️
tket/src/modifier/modifier_resolver.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1429      +/-   ##
==========================================
- Coverage   79.59%   79.53%   -0.07%     
==========================================
  Files         157      157              
  Lines       20465    20463       -2     
  Branches    19476    19474       -2     
==========================================
- Hits        16290    16276      -14     
- Misses       3193     3208      +15     
+ Partials      982      979       -3     
Flag Coverage Δ
python 92.99% <ø> (ø)
qis-compiler 100.00% <ø> (ø)
rust 78.83% <69.04%> (-0.07%) ⬇️

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 requested a review from acl-cqc March 3, 2026 15:50
@aborgna-q aborgna-q added this to the tket-py v0.13.0 milestone Mar 4, 2026
@aborgna-q aborgna-q changed the base branch from main to ab/hugr-0.26.0 March 16, 2026 15:43
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.

2 participants