]> git.lizzy.rs Git - rust.git/blobdiff - src/items.rs
Merge pull request #3011 from topecongiro/rustc-ap-syntax
[rust.git] / src / items.rs
index ff635137e42d671e61ef323b0ab5411b440c6d29..7f8980dd15068fc6d1a6f8aae7be54a406314539 100644 (file)
@@ -2232,8 +2232,10 @@ fn rewrite_args(
 ) -> Option<String> {
     let mut arg_item_strs = args
         .iter()
-        .map(|arg| arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent)))
-        .collect::<Option<Vec<_>>>()?;
+        .map(|arg| {
+            arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent))
+                .unwrap_or_else(|| context.snippet(arg.span()).to_owned())
+        }).collect::<Vec<_>>();
 
     // Account for sugary self.
     // FIXME: the comment for the self argument is dropped. This is blocked