Skip to content

Stabilize from_raw_os feature in 1.1 #25125

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

Merged
merged 1 commit into from
May 7, 2015
Merged

Conversation

Stebalien
Copy link
Contributor

So, I realize this is really late in the game so it's unlikely to be accepted but FromRawFd/FromRawHandle are necessary for fine grain control over file creation. For example, the current OpenOptions does not provide a way to avoid file creation races (there's no way to specify O_EXCL or the windows equivalent). Stabilizing these traits and their implementations will give 1.0 users fine-grain control over file creation without committing to any new complex APIs. Additionally, AsRawFd/AsRawHandle are already stable so I feel that that stabilizing their inverses is a reasonably small change.

Disclaimer: I'm asking because my crate, tempfile, depends on this feature.

@rust-highfive
Copy link
Contributor

r? @aturon

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

@steveklabnik
Copy link
Member

This would not make it into 1.0, even if merged. See https://internals.rust-lang.org/t/reminder-the-trains-are-running/1959

Generally speaking, stabilizing large amounts of code like this requires an RFC. @aturon , what do you think?

@Stebalien
Copy link
Contributor Author

This would not make it into 1.0, even if merged.

I know, this is a request to merge and cherry-pick into 1.0.

Generally speaking, stabilizing large amounts of code like this requires an RFC.

Sorry, I thought this was covered in the IO reform RFC but, on further inspection, it appears to have been removed.

@aturon
Copy link
Member

aturon commented May 5, 2015

@Stebalien I basically agree with the rationale that you laid out, especially given that these functions are unsafe in any case (due to memory safety issues around e.g. memory maps). I will discuss the stabilization situation with @alexcrichton.

@aturon
Copy link
Member

aturon commented May 5, 2015

OK, I discussed this with @alexcrichton, and we feel comfortable stabilizing these as of 1.1.0, but not backporting to 1.0 (given the still-recent change to unsafe). Would you mind updating the PR accordingly?

@Stebalien
Copy link
Contributor Author

Done (I left the feature as from_raw_os). I can also go through the usual RFC process if you would prefer given that 1.1.0 ~7 weeks from now.

@Stebalien Stebalien changed the title Stabilize from_raw_os feature in 1.0 Stabilize from_raw_os feature in 1.1 May 6, 2015
@alexcrichton
Copy link
Member

For each trait itself could you also add a #[stable] marker to the method? The #[unstable] marker is inherited by default but the #[stable] marker is not.

@Stebalien
Copy link
Contributor Author

Done.

@alexcrichton
Copy link
Member

@bors: r+ f9f01ef

Thanks!

@bors
Copy link
Collaborator

bors commented May 7, 2015

⌛ Testing commit f9f01ef with merge 9560754...

bors added a commit that referenced this pull request May 7, 2015
So, I realize this is really late in the game so it's unlikely to be accepted but `FromRawFd`/`FromRawHandle` are necessary for fine grain control over file creation. For example, the current `OpenOptions` does not provide a way to avoid file creation races (there's no way to specify `O_EXCL` or the windows equivalent). Stabilizing these traits and their implementations will give 1.0 users fine-grain control over file creation without committing to any new complex APIs.  Additionally, `AsRawFd`/`AsRawHandle` are already stable so I feel that that stabilizing their inverses is a reasonably small change.

Disclaimer: I'm asking because my crate, tempfile, depends on this feature.
@bors
Copy link
Collaborator

bors commented May 7, 2015

@bors bors merged commit f9f01ef into rust-lang:master May 7, 2015
@Stebalien Stebalien deleted the from_raw_os branch June 11, 2015 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants