Skip to content

Instantly share code, notes, and snippets.

@michaelsproul
Created April 14, 2015 06:44
Show Gist options
  • Save michaelsproul/0c926b1458baef5254d5 to your computer and use it in GitHub Desktop.
Save michaelsproul/0c926b1458baef5254d5 to your computer and use it in GitHub Desktop.
Rust Unexplained Error Finder
# Run from within src
import subprocess
for err_no in range(500):
err_string = "E%04d" % err_no
# Determine if the error needs a message.
try:
subprocess.check_output(["git", "grep", err_string + ",", "librustc/diagnostics.rs"])
except Exception:
continue
# Print its location.
location_line = subprocess.check_output(["git", "grep", err_string + ","]).splitlines()[-1].decode()
location = location_line[0 : location_line.find(": ")]
print("- [ ] {} in {}".format(err_string, location))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment