Repo Added
|
Files
868
|
Badge
README BADGES
|
push
github
Remove need for mutable reference to static (backport #13705) (#13712) * Remove need for mutable reference to static (#13705) Mutable references to static data are inherently unsafe and typically unsound in Rust, because statics are implicitly shared between threads, and the borrow checker can only enforce the shared/exclusive reference limitations within a single thread here. This just moves the thread-exclusion logic into the individual elements of the `static`, where the `GILOnceCell` can correctly handle the runtime exclusion of multiple threads. (The GIL is no longer suitable for thread exclusion if we were doing a freethreaded Python build, but that's a problem we have all over Qiskit, and would need to change to `OnceLock` or the like.) (cherry picked from commit 7b0b6fcdb) # Conflicts: # crates/circuit/src/imports.rs * Update imports.rs * Fix for older PyO3 --------- Co-authored-by: Jake Lishman <jake.lishman@ibm.com> Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
6 of 6 new or added lines in 2 files covered. (100.0%)
9 existing lines in 2 files now uncovered.79159 of 89023 relevant lines covered (88.92%)
360079.63 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|