| Age | Commit message (Collapse) | Author | Lines |
|
This commit adds a new entry to the Travis matrix which will execute emscripten
test suites. Along the way it updates a few bits of the test suite to continue
passing on emscripten, such as:
* Ignoring i128/u128 tests as they're presumably just not working (didn't
investigate as to why)
* Disabling a few process tests (not working on emscripten)
* Ignore some num tests in libstd (#39119)
* Fix some warnings when compiling
|
|
PartialEq and PartialOrd between IpAddr and Ipv[46]Addr.
PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.
|
|
`ToSocketAddrs` is implemented for a number of different types,
including `(IpAddr, u16)`, `&str`, and various others, for the
convenience of being able to run things like
`TcpListener::bind("10.11.12.13:1415")`. However, because this is a
generic parameter with a trait bound, if you have a `String` you cannot
pass it in, either directly as `TcpListener::bind(string)`, or the
`TcpListener::bind(&string)` as you might expect due to deref coercion;
you have to use `TcpListener::bind(&*string)`, which is noisy and hard
to discover (though #39029 suggests better error messages to make it
more discoverable).
Rather than making people stumble over this, just implement
`ToSocketAddrs` for `String`.
|
|
std/net/udp: Improve set_nonblocking test
While writing a separate change, I noticed the current test for `UdpSocket::set_nonblocking()` is fairly ineffective.
This fixes the test so that it validates that a correct error is returned on calls to `recv()` when no data is available.
|
|
std: Ignore close_read_wakes_up on Windows
It looks like in practice at least this test will not pass on Windows.
Empirically it is prone to blocking forever, presumably because a call to
`shutdown` doesn't actually wake up other threads on Windows.
We don't document this as a guarantee for `shutdown`, nor do we internally rely
on it. This test originated in a time long since passed when it was leveraged
for canceling I/O, but nowadays there's nothing fancy happening in the standard
library so it's not really a productive test anyway, hence just ignoring it on
Windows.
Closes #31657
|
|
|
|
Doc fix
|
|
Impl From<Ipv4Addr, Ipv6Addr> for IpAddr.
Fixes https://github.com/rust-lang/rfcs/issues/1816.
|
|
It looks like in practice at least this test will not pass on Windows.
Empirically it is prone to blocking forever, presumably because a call to
`shutdown` doesn't actually wake up other threads on Windows.
We don't document this as a guarantee for `shutdown`, nor do we internally rely
on it. This test originated in a time long since passed when it was leveraged
for canceling I/O, but nowadays there's nothing fancy happening in the standard
library so it's not really a productive test anyway, hence just ignoring it on
Windows.
Closes #31657
|
|
This was supposed to have been removed in #33124 but snuck through :(
|
|
|
|
Fixes https://github.com/rust-lang/rfcs/issues/1816.
|
|
Fixes https://github.com/rust-lang/rfcs/issues/1816.
|
|
|
|
Add From<[u16; 8]> to Ipv6Addr
Not really sure that this requires an RFC, but I figured that I'd offer a pull request and see what people think. It seems like a reasonable addition.
|
|
|
|
Part of https://github.com/rust-lang/rust/issues/31869.
Also turn on the `missing_debug_implementations` lint at the crate
level.
|
|
Add more examples to UpdSocket
r? @frewsxcv
|
|
|
|
Add missing examples for IpAddr enum
r? @frewsxcv
|
|
Add part of missing UdpSocket's urls and examples
r? @frewsxcv
|
|
Add missing examples for Ipv6Addr
r? @steveklabnik
cc @frewsxcv
|
|
|
|
Add examples for TcpListener struct
r? @frewsxcv
|
|
|
|
Add missing urls and examples to TcpStream
r? @frewsxcv
|
|
|
|
Add missing examples to SocketAddrV6
r? @steveklabnik
cc @frewsxcv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #34202
|
|
Add two functions to check type of SockAddr
These can be used to determine the type of the underlying IP
address
r? @alexcrichton
|
|
Add two functions to check type of given address
The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
|
|
std: Correct stability attributes for some implementations
These are displayed by rustdoc so should be correct.
|
|
These can be used to determine the type of the underlying IP
address
|
|
The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
|
|
This is intended to maintain existing standards of code organization
in hopes that the standard library will continue to be refactored to
isolate platform-specific bits, making porting easier; where "standard
library" roughly means "all the dependencies of the std and test
crates".
This generally means placing restrictions on where `cfg(unix)`,
`cfg(windows)`, `cfg(target_os)` and `cfg(target_env)` may appear,
the basic objective being to isolate platform-specific code to the
platform-specific `std::sys` modules, and to the allocation,
unwinding, and libc crates.
Following are the basic rules, though there are currently
exceptions:
- core may not have platform-specific code
- liballoc_system may have platform-specific code
- liballoc_jemalloc may have platform-specific code
- libpanic_abort may have platform-specific code
- libpanic_unwind may have platform-specific code
- other crates in the std facade may not
- std may have platform-specific code in the following places
- sys/unix/
- sys/windows/
- os/
There are plenty of exceptions today though, noted in the whitelist.
|
|
These are displayed by rustdoc so should be correct.
|
|
|
|
|
|
|
|
Add missing Eq implementations
Part of #36301.
|
|
|
|
|