Skip to content

Commit

Permalink
Auto merge of rust-lang#117041 - matthiaskrgr:rollup-b18h0ln, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#116985 (Use gdb.ValuePrinter tag class)
 - rust-lang#116989 (Skip test if Unix sockets are unsupported)
 - rust-lang#117034 (Don't crash on empty match in the `nonexhaustive_omitted_patterns` lint)
 - rust-lang#117037 (rustdoc book doc example error)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Oct 22, 2023
2 parents 3932c87 + 77d8a73 commit 724ba7f
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 152 deletions.
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

0 comments on commit 724ba7f

Please sign in to comment.