From 4c1addfcb77b4699be409112075cf3e33e8b5ea7 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 13 Dec 2020 15:13:41 -0500 Subject: [PATCH] Use imports instead of rewriting the type signature of `stable` This was an adventure; see https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/'higher.20ranked.20subtype.20error' --- src/librustdoc/lib.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 286a29edd95e7..94b6617a071af 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -117,21 +117,9 @@ fn get_args() -> Option> { .collect() } -fn stable(name: &'static str, f: F) -> RustcOptGroup -where - F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static, -{ - RustcOptGroup::stable(name, f) -} - -fn unstable(name: &'static str, f: F) -> RustcOptGroup -where - F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static, -{ - RustcOptGroup::unstable(name, f) -} - fn opts() -> Vec { + let stable: fn(_, fn(&mut getopts::Options) -> &mut _) -> _ = RustcOptGroup::stable; + let unstable: fn(_, fn(&mut getopts::Options) -> &mut _) -> _ = RustcOptGroup::unstable; vec![ stable("h", |o| o.optflag("h", "help", "show this help message")), stable("V", |o| o.optflag("V", "version", "print rustdoc's version")),