-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Mistake in CStr type's to_string_lossy() doc #139835
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
Comments
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Apr 19, 2025
fix incorrect type in cstr `to_string_lossy()` docs Restoring what it said prior to commit 67065fe in which it was changed incorrectly with no supporting explanation. Closes rust-lang#139835.
ChrisDenton
added a commit
to ChrisDenton/rust
that referenced
this issue
Apr 19, 2025
fix incorrect type in cstr `to_string_lossy()` docs Restoring what it said prior to commit 67065fe in which it was changed incorrectly with no supporting explanation. Closes rust-lang#139835.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 19, 2025
Rollup merge of rust-lang#139922 - jnqnfe:cstr_doc_fix, r=jhpratt fix incorrect type in cstr `to_string_lossy()` docs Restoring what it said prior to commit 67065fe in which it was changed incorrectly with no supporting explanation. Closes rust-lang#139835.
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this issue
Apr 22, 2025
Restoring what it said prior to commit 67065fe in which it was changed incorrectly with no supporting explanation. Closes rust-lang#139835.
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this issue
Apr 22, 2025
fix incorrect type in cstr `to_string_lossy()` docs Restoring what it said prior to commit 67065fe in which it was changed incorrectly with no supporting explanation. Closes rust-lang#139835.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Location
https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.to_str
Summary
The documentation for the
to_string_lossy()
method ofCStr
, which returns aCow<'_, str>
, currently contains the following text:The owned case seems wrong. I believe that it would return a
Cow::Owned(String)
not aCow::Owned(&str)
.The documentation did actually claim
Cow::Owned(String)
was returned prior to commit 67065fe which changed it to the above without explanation.The text was updated successfully, but these errors were encountered: