Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight code in `rustc --explain` (WIP) #39300

Closed
wants to merge 3 commits into from

Conversation

Projects
None yet
5 participants
@estebank
Copy link
Contributor

estebank commented Jan 25, 2017

Internals thread.

New output:

colorized code

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 25, 2017

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Jan 25, 2017

Not ready for merging yet: It doesn't check wether the output can actually support color codes. Piping to other tools will cause control characters to be displayed:

$ rustc --explain E0038 > file.txt && more file.txt
(...)
```
ESC[33mtraitESC(BESC[m ESC(BESC[mFooESC(BESC[m ESC(BESC[mESC[33mwhereESC(BESC[m ESC(BESC[mESC[36mSelfESC(BESC[m:ESC(BESC[m ESC(BESC[mSizedESC(BESC[m ESC(BESC[m{ESC(BESC[m

ESC(BESC[m}ESC(BESC[m
ESC(BESC[m```
(...)
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 4, 2017

☔️ The latest upstream changes (presumably #39463) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix pnkfelix changed the title Highlight code in `rustc --explain` Highlight code in `rustc --explain` (WIP) Feb 20, 2017

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Mar 6, 2017

@estebank any status update here? Should I close this PR?

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Mar 7, 2017

@pnkfelix I've been offline for two weeks and haven't had a chance to clean this up for submission (it's lacking detection of pipe vs stdout output). Regardless, could you advice on the changes that were made already, in order to know wether they're in the right track?

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Mar 20, 2017

@estebank I'm not clear on whether we can just add new dependencies to rustc; the last time I tried to just throw in some external crates to the Cargo.toml, @alexcrichton told me that our vendoring requirements make it difficult to add new crates.

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Mar 20, 2017

@pnkfelix this PR didn't introduce any external crates, it moved existing code into its own crate.

I'll try to get back to this PR this Saturday to clean it up for merging.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 1, 2017

Closing due to inactivity, but feel free to resubmit with a rebase!

(seems like a nifty addition!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.