From 1209b8820bad58fd3865069b63f3a1125d9824bc Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 10 Jan 2022 09:54:46 -0800 Subject: 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 --- mesonbuild/compilers/rust.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'mesonbuild/compilers/rust.py') 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' -- cgit v1.1