about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-06 13:57:44 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-03-06 14:11:09 -0800
commit39e2c6954171fafeabf29a71fba96f161577d9fa (patch)
tree5933b51e21c07337f30540cb0f4daa4567e42e33 /src/libsyntax/parse
parent1fe8f221450bad3ffb1351c6549f67c18ce0b94e (diff)
downloadrust-39e2c6954171fafeabf29a71fba96f161577d9fa.tar.gz
rust-39e2c6954171fafeabf29a71fba96f161577d9fa.zip
syntax: Remove deprecated unicode escapes
These have been deprecated for quite some time, so we should be good to remove
them now.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer/mod.rs24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 72ff501c648..f5781e0587d 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -777,13 +777,6 @@ impl<'a> StringReader<'a> {
         }
     }
 
-    fn old_escape_warning(&mut self, sp: Span) {
-        self.span_diagnostic
-            .span_warn(sp, "\\U00ABCD12 and \\uABCD escapes are deprecated");
-        self.span_diagnostic
-            .fileline_help(sp, "use \\u{ABCD12} escapes instead");
-    }
-
     /// Scan for a single (possibly escaped) byte or char
     /// in a byte, (non-raw) byte string, char, or (non-raw) string literal.
     /// `start` is the position of `first_source_char`, which is already consumed.
@@ -803,21 +796,8 @@ impl<'a> StringReader<'a> {
                         return match e {
                             'n' | 'r' | 't' | '\\' | '\'' | '"' | '0' => true,
                             'x' => self.scan_byte_escape(delim, !ascii_only),
-                            'u' if !ascii_only => {
-                                if self.curr == Some('{') {
-                                    self.scan_unicode_escape(delim)
-                                } else {
-                                    let res = self.scan_hex_digits(4, delim, false);
-                                    let sp = codemap::mk_sp(escaped_pos, self.last_pos);
-                                    self.old_escape_warning(sp);
-                                    res
-                                }
-                            }
-                            'U' if !ascii_only => {
-                                let res = self.scan_hex_digits(8, delim, false);
-                                let sp = codemap::mk_sp(escaped_pos, self.last_pos);
-                                self.old_escape_warning(sp);
-                                res
+                            'u' if self.curr_is('{') => {
+                                self.scan_unicode_escape(delim)
                             }
                             '\n' if delim == '"' => {
                                 self.consume_whitespace();