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 4 pull requests #117041

Merged
merged 8 commits into from
Oct 22, 2023
3 changes: 3 additions & 0 deletions compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,9 @@ fn collect_nonexhaustive_missing_variants<'p, 'tcx>(
cx: &MatchCheckCtxt<'p, 'tcx>,
column: &[&DeconstructedPat<'p, 'tcx>],
) -> Vec<WitnessPat<'tcx>> {
if column.is_empty() {
return Vec::new();
}
let ty = column[0].ty();
let pcx = &PatCtxt { cx, ty, span: DUMMY_SP, is_top_level: false };

Expand Down
13 changes: 11 additions & 2 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ fn windows_unix_socket_exists() {
let tmp = tmpdir();
let socket_path = tmp.join("socket");

// std doesn't current support Unix sockets on Windows so manually create one here.
// std doesn't currently support Unix sockets on Windows so manually create one here.
net::init();
unsafe {
let socket = c::WSASocketW(
Expand All @@ -1728,7 +1728,16 @@ fn windows_unix_socket_exists() {
0,
c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT,
);
assert_ne!(socket, c::INVALID_SOCKET);
// AF_UNIX is not supported on earlier versions of Windows,
// so skip this test if it's unsupported and we're not in CI.
if socket == c::INVALID_SOCKET {
let error = c::WSAGetLastError();
if env::var_os("CI").is_none() && error == c::WSAEAFNOSUPPORT {
return;
} else {
panic!("Creating AF_UNIX socket failed (OS error {error})");
}
}
let mut addr = c::SOCKADDR_UN { sun_family: c::AF_UNIX, sun_path: mem::zeroed() };
let bytes = socket_path.as_os_str().as_encoded_bytes();
addr.sun_path[..bytes.len()].copy_from_slice(bytes);
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustdoc/src/write-documentation/what-to-include.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ and your test suite, this example needs some additional code:
``````text
/// Example
/// ```rust
/// # main() -> Result<(), std::num::ParseIntError> {
/// # fn main() -> Result<(), std::num::ParseIntError> {
/// let fortytwo = "42".parse::<u32>()?;
/// println!("{} + 10 = {}", fortytwo, fortytwo+10);
/// # Ok(())
Expand Down
Loading
Loading