-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Functions using c_char show misleading "i8" instead of docs #113735
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jul 15, 2023
saethlin
added
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jul 15, 2023
i think this is a duplicate of #15823 |
It'll be fixed once #112792 is stable. |
mutexlox-signal
added a commit
to mutexlox-signal/cubeb-rs
that referenced
this issue
Oct 2, 2024
This architecture has a different c_char: u8, rather than i8. Due to rust-lang/rust#113735, this causes a build breakage, since CStr::from_ptr was documented to take an i8 but actually takes a c_char.
mutexlox-signal
added a commit
to mutexlox-signal/cubeb-rs
that referenced
this issue
Oct 2, 2024
On arm64 linux, c_char is u8. CStr::from_ptr is documented to take an i8, but this is not accurate (see rust-lang/rust#113735); instead, it takes c_char, which is sometimes but not always the same. One time it is different is on aarch64 Linux, so without this commit, cubeb-rs fails to build there.
padenot
pushed a commit
to mozilla/cubeb-rs
that referenced
this issue
Oct 7, 2024
On arm64 linux, c_char is u8. CStr::from_ptr is documented to take an i8, but this is not accurate (see rust-lang/rust#113735); instead, it takes c_char, which is sometimes but not always the same. One time it is different is on aarch64 Linux, so without this commit, cubeb-rs fails to build there.
mutexlox-signal
added a commit
to mutexlox-signal/cubeb-rs
that referenced
this issue
Oct 7, 2024
This architecture has a different c_char: u8, rather than i8. Due to rust-lang/rust#113735, this causes a build breakage, since CStr::from_ptr was documented to take an i8 but actually takes a c_char.
kinetiknz
pushed a commit
to mozilla/cubeb-rs
that referenced
this issue
Oct 7, 2024
* Cross-compile for aarch64-linux. This architecture has a different c_char: u8, rather than i8. Due to rust-lang/rust#113735, this causes a build breakage, since CStr::from_ptr was documented to take an i8 but actually takes a c_char. * Fix some new nightly clippy findings * Exclude systest from cross-compile * Fix another clippy finding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Take for example https://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_ptr, which says the signature for
CStr::from_ptr
is:The real signature uses
c_char
instead ofi8
, which is notably different becausec_char
can be eitheri8
oru8
depending on the platform. I had to follow the link to the source to make sure it was taking*const c_char
and not an actual*const i8
, which would have required a conversion.The text was updated successfully, but these errors were encountered: