]> git.lizzy.rs Git - rust.git/commit
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)
commitac3cc6c427a77c59dd02912cf7178d3190a16720
treea44d351e78fef9f7026f0bda04566f30e65c1083
parent926f38e588bb99aff1902fa94ab82b1db89cbbce
parent039a5539986b38852bca772b8709bab533ca5be0
Rollup merge of #24143 - michaelsproul:extended-errors, r=pnkfelix

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.