From f3ceb54d3aa3df70643689f4aea0acf6eb985127 Mon Sep 17 00:00:00 2001 From: Bryce Van Dyk <bryce@vandyk.net.nz> Date: Tue, 10 Oct 2017 18:51:44 +1300 Subject: [PATCH] Add a test for issue 1211, showing it's no longer an issue. Since rustfmt has moved away from syntex the overflow seen in issue 1211 is no longer a problem. This commit adds a test to verify that. --- tests/source/issue-1211.rs | 15 +++++++++++++++ tests/target/issue-1211.rs | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/source/issue-1211.rs create mode 100644 tests/target/issue-1211.rs diff --git a/tests/source/issue-1211.rs b/tests/source/issue-1211.rs new file mode 100644 index 00000000000..5818736bf6b --- /dev/null +++ b/tests/source/issue-1211.rs @@ -0,0 +1,15 @@ +fn main() { + for iface in &ifaces { + match iface.addr { + get_if_addrs::IfAddr::V4(ref addr) => { + match addr.broadcast { + Some(ip) => { + sock.send_to(&buf, (ip, 8765)).expect("foobar"); + } + _ => () + } + } + _ => () + }; + } +} diff --git a/tests/target/issue-1211.rs b/tests/target/issue-1211.rs new file mode 100644 index 00000000000..de4c5c87ee6 --- /dev/null +++ b/tests/target/issue-1211.rs @@ -0,0 +1,13 @@ +fn main() { + for iface in &ifaces { + match iface.addr { + get_if_addrs::IfAddr::V4(ref addr) => match addr.broadcast { + Some(ip) => { + sock.send_to(&buf, (ip, 8765)).expect("foobar"); + } + _ => (), + }, + _ => (), + }; + } +}