| Age | Commit message (Collapse) | Author | Lines |
|
Make `std::fs::copy` attempt to create copy-on-write clones of files on MacOS
The behaviour of MacOS now matches Linux which uses `copy_file_range` to perform CoW file copies where available and supported by the underlying filesystem.
|
|
Thanks to Eduard Marin and David Oswald at the University of Burmingham,
and Jo Van Bulck at KU Leuven for discovering this issue.
|
|
|
|
|
|
use SecRandomCopyBytes on macOS in Miri
This is a hack to fix https://github.com/rust-lang/miri/issues/686: on macOS, rustc will open `/dev/urandom` to initialize a `HashMap`. That's quite hard to emulate properly in Miri without a full-blown implementation of file descriptors. However, Miri needs an implementation of `SecRandomCopyBytes` anyway to support [getrandom](https://crates.io/crates/getrandom), so using it here should work just as well.
This will only have an effect when libstd is compiled specifically for Miri, but that will generally be the case when people use `cargo miri`.
This is clearly a hack, so I am opening this to start a discussion about whether we are okay with such a hack or not.
Cc @oli-obk
|
|
This can happen because of seccomp or some VMs.
Fixes #52609.
|
|
|
|
Extend the std::process::Child docs with warning about possible zombies.
The previous version mentioned that when dropping the Child, the
process is not killed. However, the wording gave the impression that
such behaviour is fine to do (leaving the reader believe low-level
details like reaping zombies of the dead processes is taken over by std
somehow; or simply leaving the reader unaware about the problem).
|
|
Debug-print error when using rtunwrap
When I added this macro a while back I didn't have a way to make it print the failure for all types that you might want to unwrap. Now, I came up with a solution.
|
|
|
|
|
|
Stabilized vectored IO
This renames `std::io::IoVec` to `std::io::IoSlice` and
`std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes
`std::io::IoSlice`, `std::io::IoSliceMut`,
`std::io::Read::read_vectored`, and `std::io::Write::write_vectored`.
Closes #58452
r? @alexcrichton
|
|
Document `Item` type in `std::env::SplitPaths` iterator.
Previously there wasn't any documentation to show what the type of
`Item` was inside `std::env::SplitPaths`. Now, in the same format as
other examples of docs in `std` for `Iterator#Item`, we mention the
type.
This fixes #59543.
r? @steveklabnik
|
|
... but leave the old names in there for backwards compatibility.
|
|
|
|
This renames `std::io::IoVec` to `std::io::IoSlice` and
`std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes
`std::io::IoSlice`, `std::io::IoSliceMut`,
`std::io::Read::read_vectored`, and `std::io::Write::write_vectored`.
Closes #58452
|
|
Closes #60271.
|
|
|
|
|
|
Reexport IntErrorKind in std
Currently `IntErrorKind` can only be found in `core`. @Centril confirmed on Discord that this is unintentional (should I r? him in this situation?).
Should there be a test for this? As far as this *specific* situation goes, I don't think so, I'll risk it and say that there's no way this regresses. However, it might be a good idea to have some tool detect public items in `core` that are not reexported in `std`. Does this belong in tidy, or should that be a separate tool? Is there some rustc-specific *linter*? Unless that's entirely a dumb idea, this should probably get an issue.
Note: My local build hasn't finished yet, but it's well past the point where I would expect problems.
|
|
|
|
Stabilize futures_api
cc https://github.com/rust-lang/rust/issues/59725.
Based on https://github.com/rust-lang/rust/pull/59733 and https://github.com/rust-lang/rust/pull/59119 -- only the last two commits here are relevant.
r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.
|
|
Replace HashMap implementation with SwissTable (as an external crate)
This is the same as #56241 except that it imports `hashbrown` as an external crate instead of copying the implementation into libstd.
This includes a few API changes (all unstable):
- `try_reserve` is added to `HashSet`.
- Some trait bounds have been changed in the `raw_entry` API.
- `search_bucket` has been removed from the `raw_entry` API (doesn't work with SwissTable).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See @the8472 comment's on Github:
https://github.com/rust-lang/rust/pull/60145#issuecomment-485424229
> I don't think is_reserved including ranges marked for future use is
> a good idea since those future uses may be realized at at some point
> and then old software with is_reserved filters may have false
> positives. This is not a hypothetical concern, such issues have been
> encountered before when IANA assigned previously reserved /8 address
> blocks.
|
|
site-local addresses are deprecated, so we should warn users about it.
|
|
Disallow double trailing newlines in tidy
This wasn't done previously in https://github.com/rust-lang/rust/pull/47064#issuecomment-354533010 as it affected too many files, but I think it's best to fix it now so that the number of files with double trailing newlines doesn't keep increasing.
r? kennytm
|
|
Fix sync_all on macos/ios
`sync_all` should flush all metadata in macos/ios, so it should call `fcntl` with the `F_FULLFSYNC` flag as `sync_data` does.
Note that without this `sync_data` performs more flushes than `sync_all` on macos/ios.
|
|
|
|
|
|
Also add tests to IpAddr for make sure these addresses are not global
or multicast.
|
|
Also add tests to IpAddr to make sure these addresses are not global.
|
|
also add test to Ipaddr, making sure that these addresses are not
global.
|
|
|
|
Ipv6Addr::is_unicast_global() now returns `true` for unicast site
local addresses, since they are deprecated.
|
|
Ipv4addr::is_global() previously considered 0/8 was global, but has
now been fixed, so these tests needed to be fixed as well.
|
|
|
|
|
|
As per @therealbstern's comment[0]:
The implementation of Ipv4::is_global is not complete, according to the
IANA IPv4 Special-Purpose Address Registry.
- It compares the address to 0.0.0.0, but anything in 0.0.0.0/8
should not be considered global.
- 0/8 is not global and is currently forbidden because
some systems used to treat it as the local network.
- The implementation of Ipv4::is_unspecified is correct.
0.0.0.0 is the unspecified address.
- It does not examine 100.64.0.0/10, which is "Shared Address
Space" and not global.
- Ditto 192.0.0.0/24 (IETF Protocol Assignments), except for
192.0.0.9/32 and 192.0.0.10/32, which are carved out as
globally reachable.
- 198.18.0.0/15 is for "Benchmarking" and should not be globally
reachable.
- 240.0.0.0/4 is reserved and not currently reachable
|