-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 8 pull requests #94548
Rollup of 8 pull requests #94548
Conversation
This change weakens the descriptions of the `{as,into,from}_raw_{fd,handle,socket}` descriptions from saying that they *do* express ownership relations to say that they are *typically used* in ways that express ownership relations. This needed needed since, for example, std's own [`RawFd`] implements `{As,From,Into}Fd` without any of the ownership relationships. This adds proper `# Safety` comments to `from_raw_{fd,handle,socket}`, adds the requirement that raw handles be not opened with the `FILE_FLAG_OVERLAPPED` flag, and merges the `OwnedHandle::from_raw_handle` comment into the main `FromRawHandle::from_raw_handle` comment. And, this changes `HandleOrNull` and `HandleOrInvalid` to not implement `FromRawHandle`, since they are intended for limited use in FFI situations, and not for generic use, and they have constraints that are stronger than the those of `FromRawHandle`. [`RawFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/type.RawFd.html
This function is documented in more detail in the `FromRawSocket` trait.
There's still open discussion if this lint is ready to be enabled by default. We want to give us more time to figure this out and prevent this lint from getting to stable as an enabled-by-default lint.
There may eventually be something to say about `FILE_FLAG_OVERLAPPED` here, however this appears to be independent of the other changes in this PR, so remove them from this PR so that it can be discussed separately.
…joshtriplett Update the documentation for `{As,Into,From}Raw{Fd,Handle,Socket}`. This change weakens the descriptions of the `{as,into,from}_raw_{fd,handle,socket}` descriptions from saying that they *do* express ownership relations to say that they are *typically used* in ways that express ownership relations. This is needed since, for example, std's own [`RawFd`] implements `{As,From,Into}Fd` without any of the ownership relationships. This adds proper `# Safety` comments to `from_raw_{fd,handle,socket}`, adds the requirement that raw handles be not opened with the `FILE_FLAG_OVERLAPPED` flag, and merges the `OwnedHandle::from_raw_handle` comment into the main `FromRawHandle::from_raw_handle` comment. And, this changes `HandleOrNull` and `HandleOrInvalid` to not implement `FromRawHandle`, since they are intended for limited use in FFI situations, and not for generic use, and they have constraints that are stronger than the those of `FromRawHandle`. [`RawFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/type.RawFd.html
…s, r=GuillaumeGomez rustdoc: add test cases for hidden enum variants
8 - Make more use of `let_chains` Continuation of rust-lang#94376. cc rust-lang#53667
Remove out-of-context line at end of E0284 message Removed the last line of E0284 message because it was out of context (probably kept by accident when changing whole error message).
Re-export (unstable) core::ffi types from std::ffi
Move transmute_undefined_repr back to nursery again This PR reapplies rust-lang#94014, which was reverted unintentionally I think by rust-lang#94329. The combination of rust-lang/rust-clippy#8432 + rust-lang/rust-clippy#8497 in clippy should prevent this from happening again. r? `@Manishearth`
Use ? operator in one instance instead of manual match As suggested [here](rust-lang#94139 (comment)). r? `@notriddle`
…nkov Add some examples to comments in mbe code I found these things non-obvious when re-familiarizing myself with the code. r? `@petrochenkov`
@bors r+ rollup=never p=8 |
📌 Commit 88aa75b has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (06460fe): comparison url. Summary: This benchmark run did not return any relevant results. 29 results were found to be statistically significant but too small to be relevant. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Successful merges:
{As,Into,From}Raw{Fd,Handle,Socket}
. #93562 (Update the documentation for{As,Into,From}Raw{Fd,Handle,Socket}
.)let_chains
#94484 (8 - Make more use oflet_chains
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup