-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Put back "try with rustc --explain E0XXX" #48041
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I would like to wait for a bit until we have a good story and coverage around |
The old "--explain" suggestion system was a bit heavy. By rewording it, it might be better than what it was. However, |
I think it is reasonable to go that way. I don't know if there was any conversation before removal. I would be very much in favor of having a single note suggesting using |
I was thinking about just adding a line at the end of errors. Something like: "You got error(s), if you want more explanations about this/them, try with |
I like the idea of putting it as part of the final "here's how many errors you got" message. |
I'll write a PR and we'll iterate about the formulation then. |
Rustc explain Fixes #48041. To make the review easier, I separated tests update to code update. Also, I used this script to generate new ui tests stderr: ```python from os import listdir from os.path import isdir, isfile, join PATH = "src/test/ui" def do_something(path): files = [join(path, f) for f in listdir(path)] for f in files: if isdir(f): do_something(f) continue if not isfile(f) or not f.endswith(".stderr"): continue x = open(f, "r") content = x.read().strip() if "error[E" not in content: continue errors = dict() for y in content.splitlines(): if y.startswith("error[E"): errors[y[6:11]] = True errors = sorted(errors.keys()) if len(errors) < 1: print("weird... {}".format(f)) continue if len(errors) > 1: content += "\n\nYou've got a few errors: {}".format(", ".join(errors)) content += "\nIf you want more information on an error, try using \"rustc --explain {}\"".format(errors[0]) else: content += "\n\nIf you want more information on this error, try using \"rustc --explain {}\"".format(errors[0]) content += "\n" x = open(f, "w") x.write(content) do_something(PATH) ```
This sentence has been removed here in this PR. However, I think it's quite useful considering the amount of extra information it provides.
cc @rust-lang/compiler
The text was updated successfully, but these errors were encountered: