Fix lint errors when singlepass is disabled.

This commit is contained in:
losfair 2019-11-20 01:52:33 +08:00
parent c9aa37fc99
commit 93f096b726

View File

@ -860,9 +860,15 @@ fn validate(validate: Validate) {
}
}
fn get_compiler_by_backend(backend: Backend, opts: &Run) -> Option<Box<dyn Compiler>> {
fn get_compiler_by_backend(backend: Backend, _opts: &Run) -> Option<Box<dyn Compiler>> {
Some(match backend {
#[cfg(feature = "backend-singlepass")]
Backend::Singlepass => {
use wasmer_runtime_core::codegen::StreamingCompiler;
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
use wasmer_runtime_core::codegen::MiddlewareChain;
let opts = opts.clone();
let opts = _opts.clone();
let middlewares_gen = move || {
let mut middlewares = MiddlewareChain::new();
if opts.call_trace {
@ -876,12 +882,6 @@ fn get_compiler_by_backend(backend: Backend, opts: &Run) -> Option<Box<dyn Compi
middlewares
};
Some(match backend {
#[cfg(feature = "backend-singlepass")]
Backend::Singlepass => {
use wasmer_runtime_core::codegen::StreamingCompiler;
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
let c: StreamingCompiler<SinglePassMCG, _, _, _, _> =
StreamingCompiler::new(middlewares_gen);
Box::new(c)