1
Fork 0

Add error message specific to \<carriage return>.

This can crop-up with a misconfigured editor or an unexpected
interaction between version control and certain operating systems.

Closes #11669.
This commit is contained in:
Huon Wilson 2014-11-10 21:54:42 +11:00
parent ceff2ca1fc
commit e621e3216b
3 changed files with 31 additions and 0 deletions

View file

@ -806,6 +806,13 @@ impl<'a> StringReader<'a> {
if ascii_only { "unknown byte escape" }
else { "unknown character escape" },
c);
if e == '\r' {
let sp = codemap::mk_sp(escaped_pos, last_pos);
self.span_diagnostic.span_help(
sp,
"this is an isolated carriage return; consider checking \
your editor and version control settings.")
}
false
}
}