| Age | Commit message (Collapse) | Author | Lines |
|
|
|
The attribute is also renamed `fake_variadic`.
|
|
|
|
|
|
add tracking issue to generic member access APIs
Missed as part of https://github.com/rust-lang/rust/pull/98072
|
|
r=joshtriplett
Document and stabilize process_set_process_group
Tracking issue: https://github.com/rust-lang/rust/issues/93857
FCP finished here: https://github.com/rust-lang/rust/issues/93857#issuecomment-1179551697
|
|
Implement `fmt::Write` for `OsString`
This allows to format into an `OsString` without unnecessary
allocations. E.g.
```
let mut temp_filename = path.into_os_string();
write!(&mut temp_filename, ".tmp.{}", process::id());
```
|
|
|
|
Explain PGID 0, and provide the acronym PGID.
|
|
|
|
r=Mark-Simulacrum
Stabilize `core::ffi::CStr`, `alloc::ffi::CString`, and friends
Stabilize the `core_c_str` and `alloc_c_string` feature gates.
Change `std::ffi` to re-export these types rather than creating type
aliases, since they now have matching stability.
|
|
Fix typo in mod.rs
constuct -> construct
|
|
Add std::fs::write documentation precision
Fixes #97947.
As mentioned in #97947, the documentation is updated
|
|
r=yaahc
Add new unstable API `downcast` to `std::io::Error`
https://github.com/rust-lang/libs-team/issues/57
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
|
|
|
|
Stabilize the `core_c_str` and `alloc_c_string` feature gates.
Change `std::ffi` to re-export these types rather than creating type
aliases, since they now have matching stability.
|
|
Just return `io::ErrorKind::Unsupported` instead.
|
|
futimens requires Android API level 19, and std still supports older API
levels.
|
|
This would otherwise silently ignore the attempt, since 0 serves as a
flag to not set a timestamp.
|
|
|
|
Add `struct FileTimes` to contain the relevant file timestamps, since
most platforms require setting all of them at once. (This also allows
for future platform-specific extensions such as setting creation time.)
Add `File::set_file_time` to set the timestamps for a `File`.
Implement the `sys` backends for UNIX, macOS (which needs to fall back
to `futimes` before macOS 10.13 because it lacks `futimens`), Windows,
and WASI.
|
|
constuct -> construct
|
|
Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
|
|
Rollup of 6 pull requests
Successful merges:
- #98072 (Add provider API to error trait)
- #98580 (Emit warning when named arguments are used positionally in format)
- #99000 (Move abstract const to middle)
- #99192 (Fix spans for asm diagnostics)
- #99222 (Better error message for generic_const_exprs inference failure)
- #99236 (solaris: unbreak build on native platform)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add provider API to error trait
Implements https://github.com/rust-lang/rfcs/pull/2895
|
|
Support unstable moves via stable in unstable items
part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328.
The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge.
This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
|
|
Stabilize `core::ffi:c_*` and rexport in `std::ffi`
This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.
|
|
This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
We have `File::create` for creating a file or opening an existing file,
but the secure way to guarantee creating a new file requires a longhand
invocation via `OpenOptions`.
Add `File::create_new` to handle this case, to make it easier for people
to do secure file creation.
|
|
|
|
|
|
|
|
Inline Windows `OsStrExt::encode_wide`
User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
|
|
As mentioned in #97947, the documentation is updated
|
|
Windows: Fallback for overlapped I/O
Fixes #98947
|
|
Tracking issue: https://github.com/rust-lang/rust/issues/93857
FCP finished here:
https://github.com/rust-lang/rust/issues/93857#issuecomment-1179551697
|
|
|
|
Implement ExitCodeExt for Windows
Fixes #97914
### Motivation:
On Windows it is common for applications to return `HRESULT` (`i32`) or `DWORD` (`u32`) values. These stem from COM based components ([HRESULTS](https://docs.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coinitialize)), Win32 errors ([GetLastError](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror)), GUI applications ([WM_QUIT](https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-quit)) and more. The newly stabilized `ExitCode` provides an excellent fit for propagating these values, because `std::process::exit` does not run deconstructors which can result in errors. However, `ExitCode` currently only implements `From<u8> for ExitCode`, which disallows the full range of `i32`/`u32` values. This pull requests attempts to address that shortcoming by providing windows specific extensions that accept a `u32` value (which covers all possible `HRESULTS` and Win32 errors) analog to [ExitStatusExt::from_raw](https://doc.rust-lang.org/std/os/windows/process/trait.ExitStatusExt.html#tymethod.from_raw).
This was also intended by the original Stabilization https://github.com/rust-lang/rust/pull/93840#issue-1129209143= as pointed out by ``@eggyal`` in https://github.com/rust-lang/rust/issues/97914#issuecomment-1151076755:
> Issues around platform specific representations: We resolved this issue by changing the return type of report from i32 to the opaque type ExitCode. __That way we can change the underlying representation without affecting the API, letting us offer full support for platform specific exit code APIs in the future.__
[Emphasis added]
### API
```rust
/// Windows-specific extensions to [`process::ExitCode`].
///
/// This trait is sealed: it cannot be implemented outside the standard library.
/// This is so that future additional methods are not breaking changes.
#[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
pub trait ExitCodeExt: Sealed {
/// Creates a new `ExitCode` from the raw underlying `u32` return value of
/// a process.
#[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
fn from_raw(raw: u32) -> Self;
}
#[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
impl ExitCodeExt for process::ExitCode {
fn from_raw(raw: u32) -> Self {
process::ExitCode::from_inner(From::from(raw))
}
}
```
### Misc
I apologize in advance if I misplaced any attributes regarding stabilzation, as far as I learned traits are insta-stable so I chose to make them stable. If this is an error, please let me know and I'll correct it. I also added some additional machinery to make it work, analog to [ExitStatus](https://doc.rust-lang.org/std/process/struct.ExitStatus.html#).
EDIT: Proposal: https://github.com/rust-lang/libs-team/issues/48
|
|
|
|
|
|
|
|
to be able to set a marker/id on the socket for network filtering
(iptables/ipfw here) purpose.
|
|
|
|
Try waiting on the file handle once. If that fails then give up.
|
|
|
|
|
|
|
|
|