summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-12 14:51:38 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-12 16:00:22 -0700
commit7568dd4564d417d6d03801934b0c9163d3566a8b (patch)
treeea7aa0e7960f3839697d130d600804e9653b7eaa /src/libsyntax/parse
parent7eb10c4ce113f37ddd418b95629480f5d1ad9b6a (diff)
downloadrust-7568dd4564d417d6d03801934b0c9163d3566a8b.tar.gz
rust-7568dd4564d417d6d03801934b0c9163d3566a8b.zip
Promote 'const', 'copy', 'fn' to strict keywords
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
-rw-r--r--src/libsyntax/parse/token.rs6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 1089431d810..c96cfdfe6bc 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2329,7 +2329,9 @@ impl parser {
                           | ~"owned" => {
                             self.obsolete(copy self.span,
                                           ObsoleteLowerCaseKindBounds);
-                            None
+                            // Bogus value, but doesn't matter, since
+                            // is an error
+                            Some(bound_send)
                           }
 
                           _ => None
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 7ad5c98b498..9786d2141f0 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -414,8 +414,7 @@ fn temporary_keyword_table() -> HashMap<~str, ()> {
 fn restricted_keyword_table() -> HashMap<~str, ()> {
     let words = str_hash();
     let keys = ~[
-        ~"const", ~"copy",
-        ~"fail", ~"fn",
+        ~"fail",
         ~"unsafe"
     ];
     for keys.each |word| {
@@ -430,9 +429,10 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
     let keys = ~[
         ~"as", ~"assert",
         ~"break",
+        ~"const", ~"copy",
         ~"do", ~"drop",
         ~"else", ~"enum", ~"export", ~"extern",
-        ~"false", ~"for",
+        ~"false", ~"fn", ~"for",
         ~"if", ~"impl",
         ~"let", ~"log", ~"loop",
         ~"match", ~"mod", ~"move", ~"mut",