about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-12 22:46:50 +0200
committerGitHub <noreply@github.com>2019-07-12 22:46:50 +0200
commitd709e8d9d0c0629eb8727f4feaadb387bfde07c2 (patch)
tree3f2ed4209c88c23f6cb468ea3e6a86a0d4c86997 /src/libsyntax
parentd69e9588f0f752bea54f8238f482f869567c676a (diff)
parentc9f7a3d2060a7b2c6f691f4f4b32328edffcf5bd (diff)
downloadrust-d709e8d9d0c0629eb8727f4feaadb387bfde07c2.tar.gz
rust-d709e8d9d0c0629eb8727f4feaadb387bfde07c2.zip
Rollup merge of #62605 - estebank:emit-dropped-err, r=pnkfelix
Emit dropped unemitted errors to aid in ICE debugging
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/parser.rs13
-rw-r--r--src/libsyntax/util/parser_testing.rs6
2 files changed, 10 insertions, 9 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 83dbff6b2d5..871fc0e7062 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -6666,12 +6666,13 @@ impl<'a> Parser<'a> {
     }
 
     /// Reads a module from a source file.
-    fn eval_src_mod(&mut self,
-                    path: PathBuf,
-                    directory_ownership: DirectoryOwnership,
-                    name: String,
-                    id_sp: Span)
-                    -> PResult<'a, (ast::Mod, Vec<Attribute> )> {
+    fn eval_src_mod(
+        &mut self,
+        path: PathBuf,
+        directory_ownership: DirectoryOwnership,
+        name: String,
+        id_sp: Span,
+    ) -> PResult<'a, (ast::Mod, Vec<Attribute>)> {
         let mut included_mod_stack = self.sess.included_mod_stack.borrow_mut();
         if let Some(i) = included_mod_stack.iter().position(|p| *p == path) {
             let mut err = String::from("circular modules: ");
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs
index f850960624c..2ef32d37d44 100644
--- a/src/libsyntax/util/parser_testing.rs
+++ b/src/libsyntax/util/parser_testing.rs
@@ -34,7 +34,7 @@ fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T
 }
 
 /// Parse a string, return a crate.
-pub fn string_to_crate (source_str : String) -> ast::Crate {
+pub fn string_to_crate(source_str : String) -> ast::Crate {
     let ps = ParseSess::new(FilePathMapping::empty());
     with_error_checking_parse(source_str, &ps, |p| {
         p.parse_crate_mod()
@@ -42,7 +42,7 @@ pub fn string_to_crate (source_str : String) -> ast::Crate {
 }
 
 /// Parse a string, return an expr
-pub fn string_to_expr (source_str : String) -> P<ast::Expr> {
+pub fn string_to_expr(source_str : String) -> P<ast::Expr> {
     let ps = ParseSess::new(FilePathMapping::empty());
     with_error_checking_parse(source_str, &ps, |p| {
         p.parse_expr()
@@ -50,7 +50,7 @@ pub fn string_to_expr (source_str : String) -> P<ast::Expr> {
 }
 
 /// Parse a string, return an item
-pub fn string_to_item (source_str : String) -> Option<P<ast::Item>> {
+pub fn string_to_item(source_str : String) -> Option<P<ast::Item>> {
     let ps = ParseSess::new(FilePathMapping::empty());
     with_error_checking_parse(source_str, &ps, |p| {
         p.parse_item()