Description
Was #22227, closed due to vandalism.
@sanxiyn said:
I think we should have
--progress
option. This could show phases, and for long phases like type checking, this could even show the name of the function being checked.
To which I replied:
+1. We can use control codes to update parts of the terminal without spewing output.
I will think about how to integrate this with --color
and the drawing characters.
I'm imagining that rustc in whiz-bang fancy terminal mode would display progress on a single line, updated at each stage:
[/] Parsing
[-] Expanding macros
[\] Resolving names
[|] Checking types
[/] Checking lifetimes
[-] Checking
[+] All checks passed; generating LLVM
[+] All checks passed; optimizing
[+] All checks passed; generating machine code
[+] All checks passed; linking
[+] Compilation successful (in 0m 18s)
your-prompt$
And just that last "success" message will remain in your terminal buffer.
The spinner has a constant speed in wall-clock terms. Long-running parts of rustc will call sess.update_spinner()
now and then to keep it going.
After we pass the "rest easy" point, the spinner turns into a calming +
and the first part of the message turns green.