Skip to content

[BUG] py::move() is untested? #2468

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

Closed
EricCousineau-TRI opened this issue Sep 6, 2020 · 1 comment
Closed

[BUG] py::move() is untested? #2468

EricCousineau-TRI opened this issue Sep 6, 2020 · 1 comment
Assignees

Comments

@EricCousineau-TRI
Copy link
Collaborator

EricCousineau-TRI commented Sep 6, 2020

Issue description

I am updating my fork of pybind11 in this PR (where I have futzed with rvalue casting and unique_ptr):
RobotLocomotion#43
And I run into this error with py::move():
https://github.com/RobotLocomotion/pybind11/pull/43/checks?check_run_id=1074299373#step:7:71

I started manually bisecting, and I briefly got confused by the existing implementation of py::move here:
https://github.com/pybind/pybind11/blob/1caf1d06/include/pybind11/cast.h#L1755

Reproducible example code

If I try to grep for non-std::move() occurrences in the SHA I'm trying to update to (1caf1d0), the only place I see it is in the aforementioned definition:

$ cd pybind11
$ git log -n 1 --oneline --no-decorate
1caf1d06 fix: check list validity and add missing file (#2352)
$ grep -rnI -P '\b(?<!std::)move\(' .
./include/pybind11/cast.h:1755:detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj) {

Suggested Solutions

Either remove the untested code, or add a test.

\cc @rwgk

@EricCousineau-TRI EricCousineau-TRI self-assigned this Sep 6, 2020
@EricCousineau-TRI
Copy link
Collaborator Author

Ah, derp. It was used immediately below that.
https://github.com/pybind/pybind11/blob/1caf1d06/include/pybind11/cast.h#L1775-L1783

🤦

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

No branches or pull requests

1 participant