Skip to content

Commit aaf141d

Browse files
committed
auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson
This assert was likely inherited from some point, but it's not quite valid as a no-timeout read may enter this loop, but data could be stolen by any other read after the socket is deemed readable. I saw this fail in a recent bors run where the assertion was tripped.
2 parents 19dc574 + 2ec7bb8 commit aaf141d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libnative/io/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ pub fn read<T>(fd: sock_t,
959959
// wait for the socket to become readable again.
960960
let _guard = lock();
961961
match retry(|| read(deadline.is_some())) {
962-
-1 if util::wouldblock() => { assert!(deadline.is_some()); }
962+
-1 if util::wouldblock() => {}
963963
-1 => return Err(os::last_error()),
964964
n => { ret = n; break }
965965
}

0 commit comments

Comments
 (0)