Skip to content

Commit 6990419

Browse files
Rollup merge of #80016 - jyn514:imports, r=GuillaumeGomez
Use imports instead of rewriting the type signature of `RustcOptGroup::stable` This was an adventure; see https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/'higher.20ranked.20subtype.20error' r? `@GuillaumeGomez`
2 parents a2fcdc4 + 4c1addf commit 6990419

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/librustdoc/lib.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,9 @@ fn get_args() -> Option<Vec<String>> {
117117
.collect()
118118
}
119119

120-
fn stable<F>(name: &'static str, f: F) -> RustcOptGroup
121-
where
122-
F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static,
123-
{
124-
RustcOptGroup::stable(name, f)
125-
}
126-
127-
fn unstable<F>(name: &'static str, f: F) -> RustcOptGroup
128-
where
129-
F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static,
130-
{
131-
RustcOptGroup::unstable(name, f)
132-
}
133-
134120
fn opts() -> Vec<RustcOptGroup> {
121+
let stable: fn(_, fn(&mut getopts::Options) -> &mut _) -> _ = RustcOptGroup::stable;
122+
let unstable: fn(_, fn(&mut getopts::Options) -> &mut _) -> _ = RustcOptGroup::unstable;
135123
vec![
136124
stable("h", |o| o.optflag("h", "help", "show this help message")),
137125
stable("V", |o| o.optflag("V", "version", "print rustdoc's version")),

0 commit comments

Comments
 (0)