about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSmitty <me@smitop.com>2021-06-27 09:53:27 -0400
committerSmitty <me@smitop.com>2021-06-27 09:53:27 -0400
commit63cc169d1e300aa3552a6f7a4ce216169d20cdcf (patch)
tree630d0a5fc72b058c2b82474f10bdfca7dd56feb6
parentb8be3162d734f3583b240977615f3e1bae6b364a (diff)
downloadrust-63cc169d1e300aa3552a6f7a4ce216169d20cdcf.tar.gz
rust-63cc169d1e300aa3552a6f7a4ce216169d20cdcf.zip
Don't run a publically reachable server in tests
This causes Windows Defender's firewall to pop up during tests to ask if
I want to allow the test program to access the public Internet, since it
was listening on `0.0.0.0`. The test server doesn't actually need to be
publically reachable, so this makes it so it is only reachable locally,
which makes Windows Defender happy.
-rw-r--r--src/test/ui/process-termination/process-termination-blocking-io.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/ui/process-termination/process-termination-blocking-io.rs b/src/test/ui/process-termination/process-termination-blocking-io.rs
index f306a61a538..b2dab5c9381 100644
--- a/src/test/ui/process-termination/process-termination-blocking-io.rs
+++ b/src/test/ui/process-termination/process-termination-blocking-io.rs
@@ -9,7 +9,7 @@ use std::{net::TcpListener, sync::mpsc, thread};
 fn main() {
     let (tx, rx) = mpsc::channel();
     thread::spawn(move || {
-        let listen = TcpListener::bind("0.0.0.0:0").unwrap();
+        let listen = TcpListener::bind("127.0.0.1:0").unwrap();
         tx.send(()).unwrap();
         while let Ok(_) = listen.accept() {}
     });