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

Replace Void in sys with never type #84212

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Replace Void in sys with never type #84212

merged 2 commits into from
Apr 22, 2021

Conversation

CDirkx
Copy link
Contributor

@CDirkx CDirkx commented Apr 15, 2021

This PR replaces several occurrences in sys of the type enum Void {} with the Rust never type (!).
The name Void is unfortunate because in other languages (C etc.) it refers to a unit type, not an uninhabited type.

Note that the previous stabilization of the never type was reverted, however all uses here are implementation details and not publicly visible.

@rust-highfive
Copy link
Collaborator

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Apr 19, 2021

Is there any reason you used SplitPaths<'a>((!, PhantomData<&'a ()>)) instead of SplitPaths<'a>(!, PhantomData<&'a ()>)? If not, it might be good to remove the extra () to avoid confusing future readers of this code.

r=me either way.

@bors delegate+

@bors
Copy link
Contributor

bors commented Apr 19, 2021

✌️ @CDirkx can now approve this pull request

@CDirkx
Copy link
Contributor Author

CDirkx commented Apr 20, 2021

I thought I was keeping consistency with SplitPaths<'a>(X) elsewhere, but that is not the case.

@bors r=@m-ou-se

@bors
Copy link
Contributor

bors commented Apr 20, 2021

📌 Commit d45e131 has been approved by m-ou-se

@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 Apr 20, 2021
@bors
Copy link
Contributor

bors commented Apr 20, 2021

⌛ Testing commit d45e131 with merge 6ba82cd054972bbfff8f0d521561ca1d61ee3e74...

@bors
Copy link
Contributor

bors commented Apr 20, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 20, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Apr 21, 2021

@bors retry

@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 Apr 21, 2021
@bors
Copy link
Contributor

bors commented Apr 21, 2021

⌛ Testing commit d45e131 with merge b5fcd767322b32e3f2a0a2ba597730757a9d19b5...

@bors
Copy link
Contributor

bors commented Apr 21, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 21, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@CDirkx
Copy link
Contributor Author

CDirkx commented Apr 21, 2021

Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest-xl'

Trying again?
@bors retry

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 21, 2021
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 21, 2021
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Apr 21, 2021
Replace `Void` in `sys` with never type

This PR replaces several occurrences in `sys` of the type `enum Void {}` with the Rust never type (`!`).
The name `Void` is unfortunate because in other languages (C etc.) it refers to a unit type, not an uninhabited type.

Note that the previous stabilization of the never type was reverted, however all uses here are implementation details and not publicly visible.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 22, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#84013 (Replace all `fmt.pad` with `debug_struct`)
 - rust-lang#84119 (Move `sys::vxworks` code to `sys::unix`)
 - rust-lang#84212 (Replace `Void` in `sys` with never type)
 - rust-lang#84251 (fix 'const-stable since' for NonZeroU*::new_unchecked)
 - rust-lang#84301 (Document that `index` and `index_mut` can panic)
 - rust-lang#84365 (Improve the docstrings of the `Lto` struct.)
 - rust-lang#84378 (Fix broken doc link)
 - rust-lang#84379 (Add GAT related tests)
 - rust-lang#84380 (Write Rustdoc titles like "x in crate::mod - Rust")
 - rust-lang#84390 (Format `Struct { .. }` on one line even with `{:#?}`.)
 - rust-lang#84393 (Support `x.py doc std --open`)
 - rust-lang#84406 (Remove `delete` alias from `mem::drop`.)

Failed merges:

 - rust-lang#84387 (Move `sys_common::poison` to `sync::poison`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 31b8380 into rust-lang:master Apr 22, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 22, 2021
@CDirkx CDirkx deleted the void branch April 22, 2021 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants