]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelix
authorSteve Klabnik <steve@steveklabnik.com>
Wed, 8 Apr 2015 15:34:11 +0000 (11:34 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Wed, 8 Apr 2015 15:34:11 +0000 (11:34 -0400)
I've taken another look at extended errors - fixing up the printing and adding a few more for match expressions.

With regards to printing, the previous behaviour was to just print the error message string directly, despite it containing indentation which caused it to overflow the standard terminal width of 80 columns (try `rustc --explain E0004`). The first approach I considered was to strip the leading whitespace from each line and lay out the text dynamically, inserting spaces in between. This approach became quite messy when taking multi-paragraph errors into account (and seemed overkill). The approach I settled on removes the indentation in the string itself and begins each message with a newline that is stripped before printing.

I feel like complete extended errors would be nice to have for 1.0.0 and I'm happy to spearhead an effort to get them written. Brian got me onto writing them at an SF meetup and I think it shouldn't be too hard to get the remaining 80 or so written with the help of people who don't really work on compiler innards.


Trivial merge