Skip to content
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

docs: inline std::ffi::c_str types to std::ffi #134791

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

notriddle
Copy link
Contributor

Rustdoc has no way to show that an item is stable, but only at a different path. std::ffi::c_str::NulError is not stable, but std::ffi::NulError is.

To avoid marking these types as unstable when someone just wants to follow a link from CString, inline them into their stable paths.

Fixes #134702

r? @tgross35

Rustdoc has no way to show that an item is stable,
but only at a different path. `std::ffi::c_str::NulError` is
not stable, but `std::ffi::NulError` is.

To avoid marking these types as unstable when someone just
wants to follow a link from `CString`, inline them into their
stable paths.
@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 Dec 26, 2024
@notriddle notriddle added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 26, 2024
@notriddle
Copy link
Contributor Author

Nominating for beta because the risk is low and the docs are very misleading in their current form.

@tgross35
Copy link
Contributor

Thanks for fixing this.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 26, 2024

📌 Commit 40b0026 has been approved by tgross35

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 Dec 26, 2024
@lukas-code
Copy link
Member

Shouldn't the re-exports in core and alloc be inlined as well?

@tgross35
Copy link
Contributor

Shouldn't the re-exports in core and alloc be inlined as well?

Good point, may as well get them done at the same time.

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 26, 2024
@notriddle
Copy link
Contributor Author

@bors r=tgross35

@bors
Copy link
Contributor

bors commented Dec 27, 2024

📌 Commit fc8a541 has been approved by tgross35

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 27, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#131522 ([macro_metavar_expr_concat] Fix rust-lang#128346)
 - rust-lang#134379 (Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.)
 - rust-lang#134644 (Document collection `From` and `FromIterator` impls that drop duplicate keys.)
 - rust-lang#134649 (Fix forgetting to save statx availability on success)
 - rust-lang#134728 (Use scoped threads in `std::sync::Barrier` examples)
 - rust-lang#134782 (Update Code Example for `Iterator::rposition`)
 - rust-lang#134789 (unwinding: bump version to fix naked_asm on Xous)
 - rust-lang#134791 (docs: inline `std::ffi::c_str` types to `std::ffi`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c1447e3 into rust-lang:master Dec 27, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 27, 2024
Rollup merge of rust-lang#134791 - notriddle:notriddle/inline-ffi-error-types, r=tgross35

docs: inline `std::ffi::c_str` types to `std::ffi`

Rustdoc has no way to show that an item is stable, but only at a different path. `std::ffi::c_str::NulError` is not stable, but `std::ffi::NulError` is.

To avoid marking these types as unstable when someone just wants to follow a link from `CString`, inline them into their stable paths.

Fixes rust-lang#134702

r? `@tgross35`
@rustbot rustbot added this to the 1.85.0 milestone Dec 27, 2024
@notriddle notriddle deleted the notriddle/inline-ffi-error-types branch December 27, 2024 15:48
poliorcetics pushed a commit to poliorcetics/rust that referenced this pull request Dec 28, 2024
…or-types, r=tgross35

docs: inline `std::ffi::c_str` types to `std::ffi`

Rustdoc has no way to show that an item is stable, but only at a different path. `std::ffi::c_str::NulError` is not stable, but `std::ffi::NulError` is.

To avoid marking these types as unstable when someone just wants to follow a link from `CString`, inline them into their stable paths.

Fixes rust-lang#134702

r? `@tgross35`
poliorcetics pushed a commit to poliorcetics/rust that referenced this pull request Dec 28, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#131522 ([macro_metavar_expr_concat] Fix rust-lang#128346)
 - rust-lang#134379 (Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.)
 - rust-lang#134644 (Document collection `From` and `FromIterator` impls that drop duplicate keys.)
 - rust-lang#134649 (Fix forgetting to save statx availability on success)
 - rust-lang#134728 (Use scoped threads in `std::sync::Barrier` examples)
 - rust-lang#134782 (Update Code Example for `Iterator::rposition`)
 - rust-lang#134789 (unwinding: bump version to fix naked_asm on Xous)
 - rust-lang#134791 (docs: inline `std::ffi::c_str` types to `std::ffi`)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 29, 2024
docs: inline `alloc::ffi::c_str` types to `alloc::ffi`

like rust-lang#134791 but for `alloc`

r? `@tgross35` `@notriddle`
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 29, 2024
docs: inline `alloc::ffi::c_str` types to `alloc::ffi`

like rust-lang#134791 but for `alloc`

r? ``@tgross35`` ``@notriddle``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2024
Rollup merge of rust-lang#134851 - lukas-code:alloc-ffi, r=tgross35

docs: inline `alloc::ffi::c_str` types to `alloc::ffi`

like rust-lang#134791 but for `alloc`

r? ``@tgross35`` ``@notriddle``
@notriddle notriddle added beta-nominated Nominated for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Dec 30, 2024
@notriddle
Copy link
Contributor Author

@GuillaumeGomez Should we beta nominate this so that it shows up in the Zulip channel?

@GuillaumeGomez
Copy link
Member

Yes please. Go ahead :)

@notriddle notriddle removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 30, 2024
@notriddle
Copy link
Contributor Author

How do I do that? Adding the label didn't seem to work.

@GuillaumeGomez GuillaumeGomez added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 30, 2024
@GuillaumeGomez
Copy link
Member

Hum weird, normally just putting the label is supposed to do it...

@GuillaumeGomez
Copy link
Member

@Kobzol Did the way to nominate beta backport changed?

@tgross35
Copy link
Contributor

Note that #134851 is also nominated, same change to a different module.

@tgross35
Copy link
Contributor

I just want to double check, @clarfonthey it looks like you marked these no_inline in #112136 - do you remember the reason for this?

@Kobzol
Copy link
Contributor

Kobzol commented Dec 31, 2024

@Kobzol Did the way to nominate beta backport changed?

I don't think so, but I don't actually know how it worked before 🤷

@clarfonthey
Copy link
Contributor

clarfonthey commented Dec 31, 2024

I just want to double check, @clarfonthey it looks like you marked these no_inline in #112136 - do you remember the reason for this?

Main reason was just that rustdoc always inlines cross-crate exports and I wanted to make it clearer that these are part of the c_str module.

@Amanieu Amanieu added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 2, 2025
@cuviper cuviper mentioned this pull request Jan 2, 2025
@cuviper cuviper modified the milestones: 1.85.0, 1.84.0 Jan 2, 2025
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 2, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 3, 2025
[beta] backports

- Do not call `extern_crate` on current trait on crate mismatch errors rust-lang#133585
- Correctly handle comments in attributes in doctests source code rust-lang#134260
- Correctly document CTFE behavior of is_null and methods that call is_null. rust-lang#134325
- Make sure we handle `backwards_incompatible_lint` drops appropriately in drop elaboration rust-lang#134486
- Bump compiler `cc` to 1.2.5 rust-lang#134505
- Handle `DropKind::ForLint` in coroutines correctly rust-lang#134575
- docs: inline `std::ffi::c_str` types to `std::ffi` rust-lang#134791
- docs: inline `alloc::ffi::c_str` types to `alloc::ffi` rust-lang#134851

r? cuviper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustdoc regression: stable items reexported from unstable modules appear unstable
10 participants