Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
swernli committed Feb 9, 2024
1 parent a6f71d4 commit d554e83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 10 additions & 5 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ pub extern "C" fn __quantum__qis__reset__body(qubit: *mut c_void) {

/// QIR API for measuring the given qubit and storing the measured value with the given result identifier,
/// then resetting it in the computational basis.
#[allow(clippy::missing_panics_doc)] // reason="Panics can only occur if the result that was just collected is not found in the BitVec, which should not happen."
#[allow(clippy::missing_panics_doc)]
// reason="Panics can only occur if the result that was just collected is not found in the BitVec, which should not happen."
#[no_mangle]
pub extern "C" fn __quantum__qis__mresetz__body(qubit: *mut c_void, result: *mut c_void) {
SIM_STATE.with(|sim_state| {
Expand All @@ -638,7 +639,8 @@ pub extern "C" fn __quantum__qis__mresetz__body(qubit: *mut c_void, result: *mut
}

/// QIR API for measuring the given qubit in the computation basis and storing the measured value with the given result identifier.
#[allow(clippy::missing_panics_doc)] // reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[allow(clippy::missing_panics_doc)]
// reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[no_mangle]
pub extern "C" fn __quantum__qis__mz__body(qubit: *mut c_void, result: *mut c_void) {
SIM_STATE.with(|sim_state| {
Expand All @@ -660,7 +662,8 @@ pub extern "C" fn __quantum__qis__mz__body(qubit: *mut c_void, result: *mut c_vo

/// QIR API that reads the Boolean value corresponding to the given result identifier, where true
/// indicates a |1⟩ state and false indicates a |0⟩ state.
#[allow(clippy::missing_panics_doc)] // reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[allow(clippy::missing_panics_doc)]
// reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[no_mangle]
pub extern "C" fn __quantum__qis__read_result__body(result: *mut c_void) -> bool {
SIM_STATE.with(|sim_state| {
Expand Down Expand Up @@ -816,7 +819,8 @@ pub mod legacy_output {
SIM_STATE,
};

#[allow(clippy::missing_panics_doc)] // reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[allow(clippy::missing_panics_doc)]
// reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[allow(non_snake_case)]
pub extern "C" fn __quantum__rt__result_record_output(result: *mut c_void) {
SIM_STATE.with(|sim_state| {
Expand All @@ -839,7 +843,8 @@ pub mod legacy_output {
}

/// QIR API for recording the given result into the program output.
#[allow(clippy::missing_panics_doc)] // reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[allow(clippy::missing_panics_doc)]
// reason="Panics can only occur if the result index is not found in the BitVec after resizing, which should not happen."
#[no_mangle]
pub extern "C" fn __quantum__rt__result_record_output(result: *mut c_void, tag: *mut c_char) {
SIM_STATE.with(|sim_state| {
Expand Down
5 changes: 1 addition & 4 deletions stdlib/src/bigints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ mod tests {
unsafe {
let bigint_1 =
__quantum__rt__bigint_create_array(bytes.len().try_into().unwrap(), bytes.as_ptr());
assert_eq!(
*bigint_1,
(9_223_372_036_854_775_807_i64).into()
);
assert_eq!(*bigint_1, (9_223_372_036_854_775_807_i64).into());
__quantum__rt__bigint_update_reference_count(bigint_1, -1);
}
}
Expand Down

0 comments on commit d554e83

Please sign in to comment.