Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile warning on pre-3.12 debug builds #3405

Merged
merged 1 commit into from
Aug 19, 2023

Conversation

davidhewitt
Copy link
Member

Fixes the following warnings which I hit while testing #3404

warning: unreachable expression
   --> pyo3-ffi/src/object.rs:507:5
    |
494 |           return _Py_IncRef(op);
    |           --------------------- any code following this expression is unreachable
...
507 | /     {
508 | |         #[cfg(all(Py_3_12, target_pointer_width = "64"))]
509 | |         {
510 | |             let cur_refcnt = (*op).ob_refcnt.ob_refcnt_split[crate::PY_BIG_ENDIAN];
...   |
535 | |         _Py_INC_REFTOTAL();
536 | |     }
    | |_____^ unreachable expression
    |
    = note: `#[warn(unreachable_code)]` on by default

warning: unreachable expression
   --> pyo3-ffi/src/object.rs:567:5
    |
554 |           return _Py_DecRef(op);
    |           --------------------- any code following this expression is unreachable
...
567 | /     {
568 | |         #[cfg(Py_3_12)]
569 | |         if _Py_IsImmortal(op) != 0 {
570 | |             return;
...   |
601 | |         }
602 | |     }
    | |_____^ unreachable expression

@adamreichold adamreichold added this pull request to the merge queue Aug 19, 2023
Merged via the queue into PyO3:main with commit e6293a9 Aug 19, 2023
32 checks passed
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