diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-08-04 11:32:45 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-08-04 11:32:45 +0200 |
| commit | a442c1e0570e07892f9d9bb9c0716a957b155815 (patch) | |
| tree | ac115fd665be5add260b40804ec35f3ecbab1cc9 | |
| parent | caee496150a551fe1b9f77b3a58f7e66d54bc824 (diff) | |
| download | rust-a442c1e0570e07892f9d9bb9c0716a957b155815.tar.gz rust-a442c1e0570e07892f9d9bb9c0716a957b155815.zip | |
remove Clean trait implementation for hir::FnRetTy
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 5e81db363ee..33ce35a3e6b 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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); |
