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

Rollup of 8 pull requests #101282

Closed
wants to merge 31 commits into from
Closed
Changes from 5 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
38de102
Support eager and lazy methods for providing references and values
shepmaster Jul 21, 2022
260ec93
Add `Provider::{would_be_satisfied_by_value_of,would_be_satisfied_by_…
shepmaster Jul 22, 2022
81a583c
Try normalizing types without RevealAll in ParamEnv in mir validation
Noratrieb Aug 3, 2022
96d4137
Only normalize once in mir validator typechecker
Noratrieb Aug 6, 2022
c846a2a
Make `std::os::fd` public.
sunfishcode Jun 14, 2022
09bbc42
Update asrawfd.js.
sunfishcode Jun 22, 2022
bda1262
Clarify that the `fd` module is supported on Unix and WASI.
sunfishcode Jun 30, 2022
7d80510
Re-introduce `unstable` attributes.
sunfishcode Aug 23, 2022
b9d3f65
[drop tracking] Use parent expression for scope
eholk Aug 30, 2022
803e35a
Remove unneeded extra whitespace before where clause
GuillaumeGomez Aug 31, 2022
4304d1d
Update rustdoc tests
GuillaumeGomez Aug 31, 2022
b112bfe
Add rustdoc GUI test
GuillaumeGomez Aug 31, 2022
54645e8
set up rustc_metadata for SessionDiagnostics, port dependency_format.rs
CleanCut Aug 23, 2022
3ed9310
port native_libs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
f7e462a
port encoder.rs to SessionDiagnostics
CleanCut Aug 23, 2022
32e1823
port creader.rs to SessionDiagnostics
CleanCut Aug 23, 2022
bd8e312
port fs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
d0ba1fb
port of locator.rs to SessionDiagnostics, fix some of the errors
CleanCut Aug 24, 2022
0d65819
respond to review feedback: mainly eliminate as many conversions as p…
CleanCut Aug 26, 2022
30adfd6
port 5 new diagnostics that appeared in master
CleanCut Aug 27, 2022
f921f56
Use parent_iter instead of a find_parent_node loop
eholk Aug 31, 2022
a928255
Fix bad target name in Walkthrough
diminishedprime Aug 31, 2022
d8b572b
Tweaks to fuchsia doc walkthrough
andrewpollack Aug 31, 2022
eb14b5d
Rollup merge of #98368 - sunfishcode:sunfishcode/std-os-fd, r=joshtri…
Dylan-DPC Sep 1, 2022
fbe63c2
Rollup merge of #99583 - shepmaster:provider-plus-plus, r=yaahc
Dylan-DPC Sep 1, 2022
6a3a886
Rollup merge of #100121 - Nilstrieb:mir-validator-param-env, r=oli-obk
Dylan-DPC Sep 1, 2022
1116b4d
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davi…
Dylan-DPC Sep 1, 2022
7298451
Rollup merge of #101217 - eholk:drop-tracking-73137, r=jyn514
Dylan-DPC Sep 1, 2022
4e07938
Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whites…
Dylan-DPC Sep 1, 2022
4c92e64
Rollup merge of #101251 - diminishedprime:patch-1, r=JohnTitor
Dylan-DPC Sep 1, 2022
8c9564e
Rollup merge of #101256 - andrewpollack:fuchsia-docs-adding, r=tmandry
Dylan-DPC Sep 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions library/std/src/os/fd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
//! Owned and borrowed Unix-like file descriptors.
//!
//! This module is supported on Unix platforms and WASI, which both use a
//! similar file descriptor system for referencing OS resources.

#![stable(feature = "io_safety", since = "1.63.0")]
#![deny(unsafe_op_in_unsafe_fn)]

// `RawFd`, `AsRawFd`, etc.
pub mod raw;
mod raw;

// `OwnedFd`, `AsFd`, etc.
pub mod owned;
mod owned;

// Implementations for `AsRawFd` etc. for network types.
mod net;

#[cfg(test)]
mod tests;

// Export the types and traits for the public API.
#[unstable(feature = "os_fd", issue = "98699")]
pub use owned::*;
#[unstable(feature = "os_fd", issue = "98699")]
pub use raw::*;
5 changes: 1 addition & 4 deletions library/std/src/os/fd/owned.rs
Original file line number Diff line number Diff line change
@@ -205,10 +205,7 @@ pub trait AsFd {
/// ```rust,no_run
/// use std::fs::File;
/// # use std::io;
/// # #[cfg(target_os = "wasi")]
/// # use std::os::wasi::io::{AsFd, BorrowedFd};
/// # #[cfg(unix)]
/// # use std::os::unix::io::{AsFd, BorrowedFd};
/// # use std::os::fd::{AsFd, BorrowedFd};
///
/// let mut f = File::open("foo.txt")?;
/// # #[cfg(any(unix, target_os = "wasi"))]
15 changes: 3 additions & 12 deletions library/std/src/os/fd/raw.rs
Original file line number Diff line number Diff line change
@@ -42,10 +42,7 @@ pub trait AsRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(unix)]
/// use std::os::unix::io::{AsRawFd, RawFd};
/// #[cfg(target_os = "wasi")]
/// use std::os::wasi::io::{AsRawFd, RawFd};
/// use std::os::fd::{AsRawFd, RawFd};
///
/// let mut f = File::open("foo.txt")?;
/// // Note that `raw_fd` is only valid as long as `f` exists.
@@ -83,10 +80,7 @@ pub trait FromRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(unix)]
/// use std::os::unix::io::{FromRawFd, IntoRawFd, RawFd};
/// #[cfg(target_os = "wasi")]
/// use std::os::wasi::io::{FromRawFd, IntoRawFd, RawFd};
/// use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
///
/// let f = File::open("foo.txt")?;
/// # #[cfg(any(unix, target_os = "wasi"))]
@@ -121,10 +115,7 @@ pub trait IntoRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(unix)]
/// use std::os::unix::io::{IntoRawFd, RawFd};
/// #[cfg(target_os = "wasi")]
/// use std::os::wasi::io::{IntoRawFd, RawFd};
/// use std::os::fd::{IntoRawFd, RawFd};
///
/// let f = File::open("foo.txt")?;
/// #[cfg(any(unix, target_os = "wasi"))]
2 changes: 1 addition & 1 deletion library/std/src/os/mod.rs
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ pub mod solid;
pub mod vxworks;

#[cfg(any(unix, target_os = "wasi", doc))]
mod fd;
pub mod fd;

#[cfg(any(target_os = "linux", target_os = "android", doc))]
mod net;
8 changes: 0 additions & 8 deletions library/std/src/os/unix/io/fd.rs

This file was deleted.

11 changes: 5 additions & 6 deletions library/std/src/os/unix/io/mod.rs
Original file line number Diff line number Diff line change
@@ -77,10 +77,9 @@

#![stable(feature = "rust1", since = "1.0.0")]

mod fd;
mod raw;

#[stable(feature = "io_safety", since = "1.63.0")]
pub use fd::*;
#[stable(feature = "rust1", since = "1.0.0")]
pub use raw::*;
pub use crate::os::fd::*;

// Tests for this module
#[cfg(test)]
mod tests;
6 changes: 0 additions & 6 deletions library/std/src/os/unix/io/raw.rs

This file was deleted.

File renamed without changes.
8 changes: 1 addition & 7 deletions library/std/src/os/wasi/io/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
//! WASI-specific extensions to general I/O primitives.

#![deny(unsafe_op_in_unsafe_fn)]
#![unstable(feature = "wasi_ext", issue = "71213")]

mod fd;
mod raw;

#[unstable(feature = "wasi_ext", issue = "71213")]
pub use fd::*;
#[unstable(feature = "wasi_ext", issue = "71213")]
pub use raw::*;
pub use crate::os::fd::*;
6 changes: 3 additions & 3 deletions src/test/rustdoc-js-std/asrawfd.js
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ const EXPECTED = {
'others': [
// Reproduction test for https://github.com/rust-lang/rust/issues/78724
// Validate that type alias methods get the correct path.
{ 'path': 'std::os::unix::io::AsRawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::wasi::io::AsRawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::linux::process::PidFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::unix::io::RawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::fd::RawFd', 'name': 'as_raw_fd' },
],
};