about summary refs log tree commit diff
path: root/src/librustc_resolve
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-11-21 08:03:02 -0800
committerEsteban Küber <esteban@kuber.com.ar>2017-11-24 07:34:32 -0800
commitc82e9e8e1e634250b901b69808f65fbe5f3312c3 (patch)
treee84815f5482ca3dd0ed07b58198a51f2fc1ef8ef /src/librustc_resolve
parent7c0387e36a1dab95492de61a2f26262a4526c286 (diff)
downloadrust-c82e9e8e1e634250b901b69808f65fbe5f3312c3.tar.gz
rust-c82e9e8e1e634250b901b69808f65fbe5f3312c3.zip
Do not attemt to continue parsing after `pub ident`
Try to identify the following code in order to provide better
diagnostics, but return the error to bail out early during the parse.
Diffstat (limited to 'src/librustc_resolve')
-rw-r--r--src/librustc_resolve/build_reduced_graph.rs2
-rw-r--r--src/librustc_resolve/lib.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs
index 1492c817ffd..46513a5740a 100644
--- a/src/librustc_resolve/build_reduced_graph.rs
+++ b/src/librustc_resolve/build_reduced_graph.rs
@@ -269,7 +269,7 @@ impl<'a> Resolver<'a> {
                 self.define(parent, ident, TypeNS, imported_binding);
             }
 
-            ItemKind::GlobalAsm(..) | ItemKind::Placeholder => {}
+            ItemKind::GlobalAsm(..) => {}
 
             ItemKind::Mod(..) if item.ident == keywords::Invalid.ident() => {} // Crate root
 
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 64d242307a7..ae92cb81e27 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -1947,8 +1947,7 @@ impl<'a> Resolver<'a> {
                 }
             }
 
-            ItemKind::ExternCrate(_) | ItemKind::MacroDef(..) | ItemKind::GlobalAsm(_) |
-            ItemKind::Placeholder => {
+            ItemKind::ExternCrate(_) | ItemKind::MacroDef(..) | ItemKind::GlobalAsm(_) => {
                 // do nothing, these are just around to be encoded
             }