File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,16 +132,6 @@ pub struct MoonBit {
132132}
133133
134134impl MoonBit {
135- fn builtin_symbol ( builtin : & str ) -> Option < & str > {
136- builtin. lines ( ) . find_map ( |line| {
137- let trimmed = line. trim ( ) ;
138- let rest = trimmed
139- . strip_prefix ( "extern \" wasm\" fn " )
140- . or_else ( || trimmed. strip_prefix ( "pub fn " ) ) ?;
141- rest. split ( '(' ) . next ( ) . map ( str:: trim)
142- } )
143- }
144-
145135 fn emit_used_builtins < ' a > (
146136 ffi : & mut Source ,
147137 ffi_body : & str ,
@@ -150,23 +140,8 @@ impl MoonBit {
150140 let mut used = builtins. into_iter ( ) . copied ( ) . collect :: < Vec < _ > > ( ) ;
151141 used. sort_unstable ( ) ;
152142 for builtin in used {
153- let should_emit = MoonBit :: builtin_symbol ( builtin)
154- . map ( |symbol| {
155- let needles = [
156- format ! ( "{symbol}(" ) ,
157- format ! ( "{symbol})" ) ,
158- format ! ( "{symbol}," ) ,
159- format ! ( "{symbol} " ) ,
160- format ! ( "{symbol}\n " ) ,
161- format ! ( "{symbol};" ) ,
162- format ! ( "{symbol}]" ) ,
163- ] ;
164- needles. iter ( ) . any ( |needle| ffi_body. contains ( needle) )
165- } )
166- . unwrap_or ( true ) ;
167- if should_emit {
168- uwriteln ! ( ffi, "{builtin}" ) ;
169- }
143+ let _ = ffi_body; // builtins are tracked explicitly via use_ffi
144+ uwriteln ! ( ffi, "{builtin}" ) ;
170145 }
171146 }
172147
You can’t perform that action at this time.
0 commit comments