Closed codehz closed 2 years ago
To fix the build and the compiler warning:
default
use std::thread::self;
(remove JoinHandle
as it is redundant)Send
trait pub trait ModuleResolver: Send
module_resolver: Box::new(FileModuleResolver),
#[cfg(all(not(target_family = "wasm"), feature = "threading"))]
#[cfg(all(not(target_family = "wasm"), feature = "threading"))]
to bench_push_in/bench_push_link_go/bench_threads_go
#[cfg(feature = "file")]
to test_error/test_functions/test_typechk/test_syntax
I have an idea for improving the design of ModuleResolver
, but this can be done in another PR. The idea is to use a function pointer instead of trait, which means we can get rid of the Box<dyn ModuleResolver>
, which when not optimized by the compiler produces an extra allocation (FileModuleResolver
has size 0, so it should be optimized away).
I think using feature
on lifetime::Kind
is going too far, as it duplicates some code that is hard to maintain.
#[cfg(all(not(target_family = "wasm"), feature = "threading"))]
at line 85/103/196/215I also have an idea of using empty type pattern in ast/mod.rs, but this can be done in another PR.
I'll merge this and make the changes in another PR.
Merging.
Thanks!
hmm, just cut down all thread usage when targeting to wasm(or disabled threading feature) (including
go
andin
expression