• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 26654241833
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/main/pr-16336-a5cfe3e906a79da9da2973d720a3d2a264ac0b75
DEFAULT BRANCH: main
Ran 29 May 2026 06:42PM UTC
Jobs 1
Files 944
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 May 2026 06:13PM UTC coverage: 87.552% (-0.01%) from 87.565%
26654241833

push

github

web-flow
Make DAGCircuit rust copy like methods infallible (#16316)

* Make DAGCircuit rust copy like methods infallible

The DAGCircuit copy like methods are inherently infallible. At their
core they are copy the dag state excluding instructions. Copying an
existing field in a data structure can't cause a failure when
constructing the new copy. However these methods were all listed as
fallible. At it's core this is because internally the
`DAGCircuit::add_wire()` method is used internally to add cloned version
of all the `Wire` objects. The add_wire is user facing and is fallible
to detect duplicates and block them from being accidentally added. But in
the context of making a copy we know there are no duplicates because
it is a DAGCircuit object, so the duplicate check on addition already
held.

To fix this discrepancy this adds a new error struct to define a
concrete error condition. The inner error from add_wire was previously
using DAGError::Generic with a custom string. But since DAGError is an
enum it was not clear what the error conditions from the method actually
were. This adds the concrete DuplicateWireError to make it clear there
is only one error type that the method can emit. This makes it clear
that we can only have a duplicate wire error from this method and none
of the other DAGError variants apply. Then once that's clear we remove
the error pass through in the copy methods and switch to expect() to
make it clear that the internal assumption for dismissing the error is
that it is not possible for a valid dag to have duplicate wires so the
sole error condition is not possible.

One small detail is that this unifies the duplicate wire error.
Previously the add_wire method was using the DAGError::generic error
variant presumably to set a custom error message. However there was
already a duplicate wire error variant that was used on other methods.
This unifies the error types because the error condition is the same. It
also updates the existing DAGE... (continued)

42 of 50 new or added lines in 11 files covered. (84.0%)

31 existing lines in 2 files now uncovered.

108505 of 123932 relevant lines covered (87.55%)

964573.59 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
85.22
0.02% crates/circuit/src/dag_circuit.rs

Coverage Regressions

Lines Coverage ∆ File
24
96.21
-1.9% crates/qasm2/src/parse.rs
7
92.03
-1.03% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 26654241833.1 29 May 2026 06:42PM UTC 944
87.55
GitHub Action Run
Source Files on build 26654241833
  • Tree
  • List 944
  • Changed 14
  • Source Changed 11
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26654241833
  • 40da0636 on github
  • Prev Build on gh-readonly-queue/main/pr-16249-fcdd703221641828ebed9a3c9b01c6c7d01b426f (#26652423719)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc