Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 398b876

Browse files
committedMar 11, 2025
Auto merge of rust-lang#138348 - Kobzol:rollup-g3yc3vi, r=Kobzol
Rollup of 11 pull requests Successful merges: - rust-lang#135987 (Clarify iterator by_ref docs) - rust-lang#137967 ([AIX] Fix hangs during testing) - rust-lang#138063 (Improve `-Zunpretty=hir` for parsed attrs) - rust-lang#138147 (Add maintainers for powerpc64le-unknown-linux-gnu) - rust-lang#138288 (Document -Z crate-attr) - rust-lang#138300 (add tracking issue for unqualified_local_imports) - rust-lang#138307 (Allow specifying glob patterns for try jobs) - rust-lang#138315 (use next_back() instead of last() on DoubleEndedIterator) - rust-lang#138330 (Remove unnecessary `[lints.rust]` sections.) - rust-lang#138335 (Fix post-merge workflow) - rust-lang#138343 (Enable `f16` tests for `powf`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 705421b + a9760f4 commit 398b876

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+683
-359
lines changed
 

‎library/std/src/net/test.rs

+11
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ pub fn tsa<A: ToSocketAddrs>(a: A) -> Result<Vec<SocketAddr>, String> {
3131
Err(e) => Err(e.to_string()),
3232
}
3333
}
34+
35+
pub fn compare_ignore_zoneid(a: &SocketAddr, b: &SocketAddr) -> bool {
36+
match (a, b) {
37+
(SocketAddr::V6(a), SocketAddr::V6(b)) => {
38+
a.ip().segments() == b.ip().segments()
39+
&& a.flowinfo() == b.flowinfo()
40+
&& a.port() == b.port()
41+
}
42+
_ => a == b,
43+
}
44+
}

‎library/std/src/net/udp/tests.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::net::test::{next_test_ip4, next_test_ip6};
1+
use crate::net::test::{compare_ignore_zoneid, next_test_ip4, next_test_ip6};
22
use crate::net::*;
33
use crate::sync::mpsc::channel;
44
use crate::thread;
@@ -46,7 +46,7 @@ fn socket_smoke_test_ip4() {
4646
let (nread, src) = t!(server.recv_from(&mut buf));
4747
assert_eq!(nread, 1);
4848
assert_eq!(buf[0], 99);
49-
assert_eq!(src, client_ip);
49+
assert_eq!(compare_ignore_zoneid(&src, &client_ip), true);
5050
rx2.recv().unwrap();
5151
})
5252
}
@@ -78,7 +78,9 @@ fn udp_clone_smoke() {
7878

7979
let _t = thread::spawn(move || {
8080
let mut buf = [0, 0];
81-
assert_eq!(sock2.recv_from(&mut buf).unwrap(), (1, addr1));
81+
let res = sock2.recv_from(&mut buf).unwrap();
82+
assert_eq!(res.0, 1);
83+
assert_eq!(compare_ignore_zoneid(&res.1, &addr1), true);
8284
assert_eq!(buf[0], 1);
8385
t!(sock2.send_to(&[2], &addr1));
8486
});
@@ -94,7 +96,9 @@ fn udp_clone_smoke() {
9496
});
9597
tx1.send(()).unwrap();
9698
let mut buf = [0, 0];
97-
assert_eq!(sock1.recv_from(&mut buf).unwrap(), (1, addr2));
99+
let res = sock1.recv_from(&mut buf).unwrap();
100+
assert_eq!(res.0, 1);
101+
assert_eq!(compare_ignore_zoneid(&res.1, &addr2), true);
98102
rx2.recv().unwrap();
99103
})
100104
}
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.