From 584c8200de3c83078d7cbb271a16ef4962be761e Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 8 Nov 2024 12:20:51 +1100 Subject: Use a method to apply `RustcOptGroup` to `getopts::Options` --- compiler/rustc_session/src/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index fe05605c1b9..0c4827ef54d 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1373,7 +1373,7 @@ enum OptionStability { } pub struct RustcOptGroup { - pub apply: Box &mut getopts::Options>, + apply: Box &mut getopts::Options>, pub name: &'static str, stability: OptionStability, } @@ -1383,6 +1383,10 @@ impl RustcOptGroup { self.stability == OptionStability::Stable } + pub fn apply(&self, options: &mut getopts::Options) { + (self.apply)(options); + } + pub fn stable(name: &'static str, f: F) -> RustcOptGroup where F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static, -- cgit 1.4.1-3-g733a5