summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/rust.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-08-29 10:22:53 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commitfe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c (patch)
treefe25957a1db43513a0b61183d431b498dea40013 /mesonbuild/compilers/rust.py
parentf0a6ba380989c68ecc5af61087157557b329f808 (diff)
downloadmeson-fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c.tar.gz
compilers: remove Compiler.create_option
This saves a *tiny* bit of typing, but at the cost of requiring either the current solution of throwing up our hands and saying "typing is too hard, better to have bugs!" or an extensive amount of `TypedDict`s, `overloads`, and a very new version of mypy. Let's get our type safety back, even if it means writing a little bit more code.
Diffstat (limited to 'mesonbuild/compilers/rust.py')
-rw-r--r--mesonbuild/compilers/rust.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index b8588b8d7..40c85ee68 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -234,11 +234,16 @@ class RustCompiler(Compiler):
# use_linker_args method instead.
def get_options(self) -> MutableKeyedOptionDictType:
- return dict((self.create_option(options.UserComboOption,
- self.form_compileropt_key('std'),
- 'Rust edition to use',
- ['none', '2015', '2018', '2021', '2024'],
- 'none'),))
+ opts = super().get_options()
+
+ key = self.form_compileropt_key('std')
+ opts[key] = options.UserComboOption(
+ self.make_option_name(key),
+ 'Rust edition to use',
+ ['none', '2015', '2018', '2021', '2024'],
+ 'none')
+
+ return opts
def get_dependency_compile_args(self, dep: 'Dependency') -> T.List[str]:
# Rust doesn't have dependency compile arguments so simply return