]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/mod.rs
rustc: async fn drop order lowering in HIR
[rust.git] / src / librustdoc / clean / mod.rs
index 4ee63a4c9703b6c310491d0513193aee21b31ac9..319adea6b86820da580e72a0309052b5967f6d9d 100644 (file)
@@ -2018,8 +2018,9 @@ fn clean(&self, cx: &DocContext<'_>) -> Arguments {
 
         Arguments {
             values: self.0.iter().enumerate().map(|(i, ty)| {
+                let original_pat = cx.tcx.hir().original_pat_of_argument(&body.arguments[i]);
                 Argument {
-                    name: name_from_pat(&body.arguments[i].original_pat()),
+                    name: name_from_pat(original_pat),
                     type_: ty.clean(cx),
                 }
             }).collect()
@@ -3145,10 +3146,7 @@ impl<'tcx> Clean<Constant> for ty::Const<'tcx> {
     fn clean(&self, cx: &DocContext<'_>) -> Constant {
         Constant {
             type_: self.ty.clean(cx),
-            expr: match self.val {
-                ConstValue::Param(ty::ParamConst { name, .. }) => format!("{}", name),
-                e => format!("{:?}", e), // FIXME generic consts with expressions
-            },
+            expr: format!("{}", self),
         }
     }
 }