diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-08 12:20:51 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-08 12:46:39 +1100 |
| commit | 584c8200de3c83078d7cbb271a16ef4962be761e (patch) | |
| tree | 2e1c41bb183f471910791db13b641a4195ed4f7f /compiler/rustc_session/src | |
| parent | 8f7f9b93b2cf1f16d4ded534ff14ce9a673177c0 (diff) | |
| download | rust-584c8200de3c83078d7cbb271a16ef4962be761e.tar.gz rust-584c8200de3c83078d7cbb271a16ef4962be761e.zip | |
Use a method to apply `RustcOptGroup` to `getopts::Options`
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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<dyn Fn(&mut getopts::Options) -> &mut getopts::Options>, + apply: Box<dyn Fn(&mut getopts::Options) -> &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<F>(name: &'static str, f: F) -> RustcOptGroup where F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static, |
