diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-01-10 09:54:46 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-01-10 15:53:26 -0500 |
commit | 1209b8820bad58fd3865069b63f3a1125d9824bc (patch) | |
tree | 95b8e6d0e706d377b8cfbf46f44a503097386e85 /mesonbuild/compilers/rust.py | |
parent | f67994476da4bdc5389c558989809df48a172c6e (diff) | |
download | meson-1209b8820bad58fd3865069b63f3a1125d9824bc.zip meson-1209b8820bad58fd3865069b63f3a1125d9824bc.tar.gz meson-1209b8820bad58fd3865069b63f3a1125d9824bc.tar.bz2 |
compilers: push the compiler id to a class variable
It really is a per class value, and shouldn't be set per instance. It
also allows us to get rid of useless constructors, including those
breaking mypy
Diffstat (limited to 'mesonbuild/compilers/rust.py')
-rw-r--r-- | mesonbuild/compilers/rust.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 8f7e165..399570d 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -44,6 +44,7 @@ class RustCompiler(Compiler): # rustc doesn't invoke the compiler itself, it doesn't need a LINKER_PREFIX language = 'rust' + id = 'rustc' _WARNING_LEVELS: T.Dict[str, T.List[str]] = { '0': ['-A', 'warnings'], @@ -61,7 +62,6 @@ class RustCompiler(Compiler): is_cross=is_cross, full_version=full_version, linker=linker) self.exe_wrapper = exe_wrapper - self.id = 'rustc' self.base_options.add(OptionKey('b_colorout')) if 'link' in self.linker.id: self.base_options.add(OptionKey('b_vscrt')) @@ -205,11 +205,4 @@ class ClippyRustCompiler(RustCompiler): This just provides us a different id """ - def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', - exe_wrapper: T.Optional['ExternalProgram'] = None, - full_version: T.Optional[str] = None, - linker: T.Optional['DynamicLinker'] = None): - super().__init__(exelist, version, for_machine, is_cross, info, - exe_wrapper, full_version, linker) - self.id = 'clippy-driver rustc' + id = 'clippy-driver rustc' |