about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-05-30 18:02:40 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-05-30 18:02:40 -0700
commit1ee45da2b9789881b8c79d6a1af8a2c9fd5364f2 (patch)
tree5042dbd22ad32882ff4fdbb414c6ea1408e15775 /src/libsyntax
parentb3ac88ad922a618e6bf0eb269084d60233a311e4 (diff)
downloadrust-1ee45da2b9789881b8c79d6a1af8a2c9fd5364f2.tar.gz
rust-1ee45da2b9789881b8c79d6a1af8a2c9fd5364f2.zip
Remove `ArgSource::Recovery`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs2
-rw-r--r--src/libsyntax/mut_visit.rs2
-rw-r--r--src/libsyntax/parse/parser.rs6
3 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 3e25f22f0a4..75e83bd9f9c 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1780,8 +1780,6 @@ pub enum ArgSource {
     Normal,
     /// Argument from `async fn` lowering, contains the original binding pattern.
     AsyncFn(P<Pat>),
-    /// Placeholder argument caused by incorrect syntax. Used to silence unecessary errors.
-    Recovery,
 }
 
 /// Alternative representation for `Arg`s describing `self` parameter of methods.
diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs
index e31bded0dec..0016c0d4d7e 100644
--- a/src/libsyntax/mut_visit.rs
+++ b/src/libsyntax/mut_visit.rs
@@ -580,7 +580,7 @@ pub fn noop_visit_arg<T: MutVisitor>(Arg { id, pat, ty, source }: &mut Arg, vis:
 
 pub fn noop_visit_arg_source<T: MutVisitor>(source: &mut ArgSource, vis: &mut T) {
     match source {
-        ArgSource::Normal | ArgSource::Recovery => {},
+        ArgSource::Normal => {},
         ArgSource::AsyncFn(pat) => vis.visit_pat(pat),
     }
 }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 2c35b9ea7fd..3bb34d0402d 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -464,7 +464,7 @@ fn dummy_arg(ident: Ident) -> Arg {
         span: ident.span,
         id: ast::DUMMY_NODE_ID
     };
-    Arg { ty: P(ty), pat: pat, id: ast::DUMMY_NODE_ID, source: ast::ArgSource::Recovery }
+    Arg { ty: P(ty), pat: pat, id: ast::DUMMY_NODE_ID, source: ast::ArgSource::Normal }
 }
 
 #[derive(Copy, Clone, Debug)]
@@ -5619,8 +5619,8 @@ impl<'a> Parser<'a> {
         // Replace duplicated recovered arguments with `_` pattern to avoid unecessary errors.
         let mut seen_inputs = FxHashSet::default();
         for input in fn_inputs.iter_mut() {
-            let opt_ident = if let (PatKind::Ident(_, ident, _), ast::ArgSource::Recovery) = (
-                &input.pat.node, &input.source,
+            let opt_ident = if let (PatKind::Ident(_, ident, _), TyKind::Err) = (
+                &input.pat.node, &input.ty,
             ) {
                 Some(*ident)
             } else {