Add std::ffi::c_str module by clarfonthey · Pull Request #112136 · rust-lang/rust (original) (raw)

clarfonthey

ACP: rust-lang/libs-team#134

std::ffi docs before change:
Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change:
Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

@rustbot

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

May 31, 2023

@rust-log-analyzer

This comment has been minimized.

clarfonthey

mod c_str;
#[doc(no_inline)]
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stability attribute got lost in some refactoring, I think. I decided to restore it when I was fixing up the code.

clarfonthey

@@ -154,10 +154,39 @@
#![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "alloc_c_string", since = "1.64.0")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stability attributes for these also got lost in refactoring. It makes things much more verbose, but I decided to keep it so the attributes were preserved.

clarfonthey

@@ -276,6 +276,7 @@
//
// Library features (core):
// tidy-alphabetical-start
#![feature(c_str_module)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically I could make it work without these but I prefer the clarity of importing from the modules instead of the re-exports.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@clarfonthey clarfonthey changed the titleAdd std::ffi::c_str{,ing} modules Add std::ffi::c_str module

Jun 1, 2023

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@clarfonthey

So, I actually don't know how to fix the links for the re-exports. It seems that rustdoc can't link to libstd when documenting core, but this feels like it should be possible. Would love if anyone could advise for some help here.

Right now, it appears that all these links are written manually, which will only work on the definition or the re-export, and not both, since they lie at different paths.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

@cuviper

So, I actually don't know how to fix the links for the re-exports. It seems that rustdoc can't link to libstd when documenting core, but this feels like it should be possible. Would love if anyone could advise for some help here.

I'm afraid I don't know how to help, but maybe you can reach out to the rustdoc team on zulip.

@rustbot author

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Aug 11, 2023

@Dylan-DPC Dylan-DPC added S-waiting-on-ACP

Status: PR has an ACP and is waiting for the ACP to complete.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Aug 15, 2023

@rust-log-analyzer

This comment has been minimized.

@clarfonthey

@clarfonthey

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Mar 6, 2024

@cuviper

@bors

📌 Commit 1ea6cd7 has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Mar 8, 2024

jhpratt added a commit to jhpratt/rust that referenced this pull request

Mar 9, 2024

@jhpratt

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 9, 2024

@bors

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Mar 10, 2024

@workingjubilee

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 10, 2024

@bors

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 10, 2024

@matthiaskrgr

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 10, 2024

@bors

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 10, 2024

@matthiaskrgr

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

jhpratt added a commit to jhpratt/rust that referenced this pull request

Mar 10, 2024

@jhpratt

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 10, 2024

@bors

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 10, 2024

@rust-timer

Rollup merge of rust-lang#112136 - clarfonthey:ffi-c_str, r=cuviper

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

std::ffi docs before change: Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString

std::ffi docs after change: Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString

(note: I'm omitting the c_int, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)