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

Re-export core::ffi::FromBytesUntilNulError in std::ffi #113701

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

aswild
Copy link
Contributor

@aswild aswild commented Jul 14, 2023

Like the other CStr and CString error types, make a re-export for std::ffi::FromBytesUntilNulError.

This seems to have slipped through the cracks in the cstr_from_bytes_until_nul implementation and core_c_str migration.

Tracking Issue: #95027

Like the other CStr and CString error types, make a re-export for
std::ffi::FromBytesUntilNulError.

This seems to have slipped through the cracks in the
cstr_from_bytes_until_nul implementation and core_c_str migration.

Tracking Issue: rust-lang#95027
@rustbot
Copy link
Collaborator

rustbot commented Jul 14, 2023

r? @Mark-Simulacrum

(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 Jul 14, 2023
@tgross35
Copy link
Contributor

Since this probably should have been included as part of cstr_from_bytes_until_nul, the team might be willing to make it insta-stable under that same guard.

@rustbot label +T-libs-api -T-libs

(not sure if it will let me do this one)

r? libs-api

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 14, 2023
@rustbot rustbot assigned dtolnay and unassigned Mark-Simulacrum Jul 14, 2023
@dtolnay
Copy link
Member

dtolnay commented Jul 14, 2023

@rust-lang/libs-api: Relevant to the "multiple feature gates per API" idea we talked about a few months back. CStr in core (tracking issue: #98314) and CStr::from_bytes_until_nul (tracking issue: #95027) were unstable concurrently, and this causes us to lose track of things. In this case it was luckily in the missing-API way and not in the accidentally-stable way.

This PR re-exports core::ffi::FromBytesUntilNulError (the error type of CStr::from_bytes_until_nul) as std::ffi::FromBytesUntilNulError, matching how CStr and FromBytesWithNulError have already been re-exported from core::ffi to std::ffi for a while.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Jul 14, 2023

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jul 14, 2023
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Jul 25, 2023
@rfcbot
Copy link

rfcbot commented Jul 25, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@tgross35
Copy link
Contributor

I think CURRENT_RUSTC_VERSION might need to change to 1.69.0 to match the rest of cstr_from_bytes_until_nul. Does it let you compile if you set it manually to a different version like 1.72.0?

@Amanieu
Copy link
Member

Amanieu commented Jul 25, 2023

If it becomes an issue then you can just make up a new feature name.

@aswild
Copy link
Contributor Author

aswild commented Jul 30, 2023

Does it let you compile if you set it manually to a different version like 1.72.0?

Yes, changing the line to #[stable(feature = "cstr_from_bytes_until_nul", since = "1.72.0")] still lets everything compile (and x test tidy also passes).

Also thanks, this is my first library contribution so I appreciate the heads up.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Jul 31, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2023

📌 Commit fda3d2a has been approved by dtolnay

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 Jul 31, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#109318 (Make `Debug` representations of `[Lazy, Once]*[Cell, Lock]` consistent with `Mutex` and `RwLock`)
 - rust-lang#113701 (Re-export core::ffi::FromBytesUntilNulError in std::ffi)
 - rust-lang#113804 (Resolve correct archive version name in `opt-dist`)
 - rust-lang#114165 (Add missing rvalues to smir)
 - rust-lang#114182 (clean up after 113312)
 - rust-lang#114193 (Update lexer emoji diagnostics to Unicode 15.0)
 - rust-lang#114200 (Detect trait upcasting through struct tail unsizing in new solver select)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit efd68db into rust-lang:master Aug 1, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 1, 2023
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Aug 4, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants