]> git.lizzy.rs Git - rust.git/commitdiff
remove Clean trait implementation for hir::FnRetTy
authorGuillaume Gomez <guillaume.gomez@huawei.com>
Thu, 4 Aug 2022 09:32:45 +0000 (11:32 +0200)
committerGuillaume Gomez <guillaume.gomez@huawei.com>
Thu, 4 Aug 2022 09:32:45 +0000 (11:32 +0200)
src/librustdoc/clean/mod.rs

index 5e81db363ee5c1668e5153650521b567c55def06..33ce35a3e6b3c1934b0e9282f175844e269ebda5 100644 (file)
@@ -956,7 +956,11 @@ fn clean_fn_decl_with_args<'tcx>(
     decl: &hir::FnDecl<'tcx>,
     args: Arguments,
 ) -> FnDecl {
-    FnDecl { inputs: args, output: decl.output.clean(cx), c_variadic: decl.c_variadic }
+    let output = match decl.output {
+        hir::FnRetTy::Return(typ) => Return(clean_ty(typ, cx)),
+        hir::FnRetTy::DefaultReturn(..) => DefaultReturn,
+    };
+    FnDecl { inputs: args, output, c_variadic: decl.c_variadic }
 }
 
 fn clean_fn_decl_from_did_and_sig<'tcx>(
@@ -991,15 +995,6 @@ fn clean_fn_decl_from_did_and_sig<'tcx>(
     }
 }
 
-impl<'tcx> Clean<'tcx, FnRetTy> for hir::FnRetTy<'tcx> {
-    fn clean(&self, cx: &mut DocContext<'tcx>) -> FnRetTy {
-        match *self {
-            Self::Return(typ) => Return(clean_ty(typ, cx)),
-            Self::DefaultReturn(..) => DefaultReturn,
-        }
-    }
-}
-
 impl<'tcx> Clean<'tcx, Path> for hir::TraitRef<'tcx> {
     fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
         let path = clean_path(self.path, cx);