about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-01-19 18:44:20 -0800
committerEsteban Küber <esteban@kuber.com.ar>2019-01-19 19:27:49 -0800
commit3235446b397a06596063f237ae864de8d95799e9 (patch)
treea5f9b95a4cbeeadec1d1f1ad6aa4c24fffbca21a /src/libsyntax
parentd38e70036eee2187d93d8d760461a79aaa84489f (diff)
downloadrust-3235446b397a06596063f237ae864de8d95799e9.tar.gz
rust-3235446b397a06596063f237ae864de8d95799e9.zip
Accept parenthesized type args for error recovery
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index bbcaaacbab5..d57f9247c05 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -192,6 +192,16 @@ pub struct ParenthesisedArgs {
     pub output: Option<P<Ty>>,
 }
 
+impl ParenthesisedArgs {
+    pub fn as_angle_bracketed_args(&self) -> AngleBracketedArgs {
+        AngleBracketedArgs {
+            span: self.span,
+            args: self.inputs.iter().cloned().map(|input| GenericArg::Type(input)).collect(),
+            bindings: vec![],
+        }
+    }
+}
+
 // hack to ensure that we don't try to access the private parts of `NodeId` in this module
 mod node_id_inner {
     use rustc_data_structures::indexed_vec::Idx;