-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
std::slice::bytes::copy_memory and std::io::copy take their arguments in different orders #22890
Comments
Nominating for backcompat-libs, needs-decision |
Other APIs to consider are |
P-backcompat-libs, 1.0 beta, I-needs-decision. |
Well and then on the other hand |
Those functions that are basically memmove and memcpy wrappers, shouldn't they just stick to that argument order? |
We tend follow general C principles in terms of the overall API of a function (e.g. roughly matching inputs and outputs), but we don't always strive for exact compliance with C APIs with respect to aspects such as argument order. A "rustic" design and a consistent standard library come paramount after selecting the right set of inputs/outputs for us. |
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes rust-lang#22890 [breaking-change]
…aturon This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes rust-lang#22890 [breaking-change]
std::slice::bytes::copy_memory
takes the destination first (likememcpy
does), whilestd::io::copy
takes the source first.cc @aturon
The text was updated successfully, but these errors were encountered: