about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2016-01-27 19:01:01 +1300
committerNick Cameron <ncameron@mozilla.com>2016-02-01 08:42:27 +1300
commitb6e4f18e55e042ff7d1962280106e38050af2361 (patch)
tree671f6ee5fa2e0ea023b52b8623ac5187136d6150 /src/libsyntax/parse
parent9041b930585806b948b4cc68933047ffdc96f6f9 (diff)
downloadrust-b6e4f18e55e042ff7d1962280106e38050af2361.tar.gz
rust-b6e4f18e55e042ff7d1962280106e38050af2361.zip
Replace some aborts with Results
Fixes #31207

by removing abort_if_new_errors
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b8e5642474c..bff5071b8ec 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2483,8 +2483,7 @@ impl<'a> Parser<'a> {
                                     float.trunc() as usize,
                                     format!(".{}", fstr.splitn(2, ".").last().unwrap())));
                     }
-                    err.emit();
-                    self.abort_if_errors();
+                    return Err(err);
 
                   }
                   _ => {
@@ -4117,9 +4116,7 @@ impl<'a> Parser<'a> {
                               or did you mean the comma-separated arguments \
                               'a, Type?");
             err.span_note(mk_sp(span_lo, span_hi), &msg);
-            err.emit();
-
-            self.abort_if_errors()
+            return Err(err);
         }
 
         // First parse types.
@@ -5189,8 +5186,7 @@ impl<'a> Parser<'a> {
                                         of possibly redeclaring it",
                                        paths.name));
             }
-            err.emit();
-            self.abort_if_errors();
+            return Err(err);
         }
 
         match paths.result {