5

Emit clearer diagnostics for parens around `for` loop heads by JohnTitor · Pull...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/86422
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

@estebank estebank left a comment •

edited

Left one nitpick. r=me with that addressed. Apologies for the delay.

.span_label(begin_par_sp, "opening `(`")

let sp = MultiSpan::from_spans(vec![begin_par_sp, self.prev_token.span]);

self.struct_span_err(sp, "unexpected parenthesis surrounding `for` loop head")

Copy link

Contributor

@estebank estebank on Sep 9

We should use multipart_suggestion here and use the same spans we use for the error.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK