diff options
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 0bcd4578518..e2656bea483 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -480,6 +480,15 @@ impl<'a> StringReader<'a> { self.with_str_from(start, |string| { if string == "_" { + self.sess.span_diagnostic + .struct_span_warn(mk_sp(start, self.pos), + "underscore literal suffix is not allowed") + .warn("this was previously accepted by the compiler but is \ + being phased out; it will become a hard error in \ + a future release!") + .note("for more information, see issue #42326 \ + <https://github.com/rust-lang/rust/issues/42326>") + .emit(); None } else { Some(Symbol::intern(string)) |
