Skip to content

Commit

Permalink
ipcheck: Drop the "Rust (New)" implementation
Browse files Browse the repository at this point in the history
There have been no substantial changes in implementation of various
Rust's IpAddr helper methods (is_loopback() etc.) that I can think of.

The PR[1] that the "Rust (New)" implementation was based on has been
closed in May 2021, I think it's safe to say it's no longer relevant
and doesn't help anyone.

[1] rust-lang/rust#76098
  • Loading branch information
jstasiak committed Dec 15, 2023
1 parent 96018ed commit e19d88d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 164 deletions.
7 changes: 5 additions & 2 deletions tools/ipcheck/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IP Check

Created for https://github.com/rust-lang/rust/pull/76098
Originally created for https://github.com/rust-lang/rust/pull/76098, the tool now tests
the *current* implementation of various helper methods against other programming languages.

This is a little utility program for checking the behavior of various language's IP address implementations.
The goal is to make sure the Rust programs are either the same or deliberately different to other languages.
Expand All @@ -11,13 +12,15 @@ This same approach might be useful for other APIs that have externally specified

These live under the `impls` directory.

- Rust (New) (`impls/rust`) with the behavior proposed in `#76098`
- Rust (Current) (`impls/rust_current`) with the current behavior on `nightly`
- .NET (`impls/dotnet`)
- Python (`impls/python`)
- Go (`impls/go`)
- Java (`impls/java`)

There was a Rust implementation with behavior proposed in `#76098` ("Rust (New)")
but the PR didn't go through so the implementation has been removed.

## Running

With the comparison languages available, you can run `cd host && cargo run` to compare them.
Expand Down
3 changes: 1 addition & 2 deletions tools/ipcheck/host/build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ fn main() {
let mut impls =
std::fs::File::create("../artifacts/.impls").expect("failed to create .impls file");

output_impl(&mut impls, "Rust (New)", rust::build_new());
output_impl(&mut impls, "Rust (Current)", rust::build_current());
output_impl(&mut impls, "Rust", rust::build_current());
output_impl(&mut impls, ".NET", dotnet::build());
output_impl(&mut impls, "Python", python::build());
output_impl(&mut impls, "Go", go::build());
Expand Down
4 changes: 0 additions & 4 deletions tools/ipcheck/host/build/rust.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use std::path::Path;

pub fn build_new() -> std::io::Result<String> {
build_bin("../impls/rust_new", "../artifacts/rust_new", "ipcheck_new")
}

pub fn build_current() -> std::io::Result<String> {
build_bin(
"../impls/rust_current",
Expand Down
2 changes: 1 addition & 1 deletion tools/ipcheck/host/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde_json::{Map, Value};
use std::{collections::BTreeSet, fmt::Write, io::BufRead, net::IpAddr};

const REF_LANG: &'static str = "Rust (New)";
const REF_LANG: &'static str = "Rust";

fn is_ref(lang: &str) -> bool {
lang.starts_with("Rust")
Expand Down
3 changes: 1 addition & 2 deletions tools/ipcheck/impls/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Programs that accept as input a ASCII-encoded IP address to parse and run operations on. As output, these programs produce a JSON object.

## Implementations
- Rust (`rust_*`) (with the behavior specified in https://github.com/rust-lang/rust/pull/76098 as `rust_new`)
- Rust (`rust`)
- .NET (`dotnet`)
- Python (`python`)
- Go (`go`)
- Java (`java`)

2 changes: 0 additions & 2 deletions tools/ipcheck/impls/rust_new/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions tools/ipcheck/impls/rust_new/Cargo.toml

This file was deleted.

138 changes: 0 additions & 138 deletions tools/ipcheck/impls/rust_new/main.rs