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:
parent
ceff2ca1fc
commit
e621e3216b
3 changed files with 31 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue