Add note about encoding when null bytes found
This commit is contained in:
parent
5605b5d693
commit
651d289405
4 changed files with 3 additions and 0 deletions
|
@ -268,6 +268,9 @@ impl<'a> StringReader<'a> {
|
||||||
// tokens like `<<` from `rustc_lexer`, and then add fancier error recovery to it,
|
// tokens like `<<` from `rustc_lexer`, and then add fancier error recovery to it,
|
||||||
// as there will be less overall work to do this way.
|
// as there will be less overall work to do this way.
|
||||||
let token = unicode_chars::check_for_substitution(self, start, c, &mut err);
|
let token = unicode_chars::check_for_substitution(self, start, c, &mut err);
|
||||||
|
if c == '\x00' {
|
||||||
|
err.help("source files must be encoded in UTF-8, unexpected null bytes might occur when the wrong text encoding is used");
|
||||||
|
}
|
||||||
err.emit();
|
err.emit();
|
||||||
token?
|
token?
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue