Improve comments for reserved prefixes.

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
Mara Bos 2021-06-14 16:46:46 +00:00 committed by lrh2000
parent 3b18e215a3
commit 6adce70a58
2 changed files with 11 additions and 3 deletions

View file

@ -500,7 +500,10 @@ impl<'a> StringReader<'a> {
FatalError.raise()
}
// See RFC 3101.
// RFC 3101 introduced the idea of (reserved) prefixes. As of Rust 2021,
// using a (unknown) prefix is an error. In earlier editions, however, they
// only result in a (allowed by default) lint, and are treated as regular
// identifier tokens.
fn report_reserved_prefix(&self, start: BytePos) {
let prefix_span = self.mk_sp(start, self.pos);
let msg = format!("prefix `{}` is unknown", self.str_from_to(start, self.pos));