@@ -115,7 +115,7 @@ pub fn compile(db: &dyn Db, docs: MemDocsInput, out: String, op: Options) {
115
115
/// compile_dry compiles the source code of pivot-lang into the pivot-lang AST with a wrapper.
116
116
/// the `dry` refers the function ends up parsing at LLVM IR or LSP analysis.
117
117
#[ salsa:: tracked]
118
- pub fn compile_dry ( db : & dyn Db , docs : MemDocsInput ) -> Result < ModWrapper , String > {
118
+ pub fn compile_dry < ' db > ( db : & ' db dyn Db , docs : MemDocsInput ) -> Result < ModWrapper < ' db > , String > {
119
119
let path = search_config_file ( docs. file ( db) . to_string ( ) ) ;
120
120
if path. is_err ( ) {
121
121
log:: warn!( "lsp error: {}" , path. err( ) . unwrap( ) ) ;
@@ -148,7 +148,10 @@ pub fn compile_dry(db: &dyn Db, docs: MemDocsInput) -> Result<ModWrapper, String
148
148
/// compile_dry_file parses the file inside parser_entry into AST,
149
149
/// and then emit the llvm IR code represented by Mod according to the entry file AST.
150
150
#[ salsa:: tracked( recovery_fn=cycle_deps_recover) ]
151
- pub fn compile_dry_file ( db : & dyn Db , parser_entry : FileCompileInput ) -> Option < ModWrapper > {
151
+ pub fn compile_dry_file < ' db > (
152
+ db : & ' db dyn Db ,
153
+ parser_entry : FileCompileInput < ' db > ,
154
+ ) -> Option < ModWrapper < ' db > > {
152
155
if parser_entry. file ( db) . ends_with ( ".toml" ) {
153
156
log:: error!( "lsp error: toml file {}" , parser_entry. file( db) ) ;
154
157
// skip toml
@@ -197,7 +200,7 @@ pub fn process_llvm_ir<'a>(
197
200
) -> ( Module < ' a > , Vec < PathBuf > ) {
198
201
use inkwell:: memory_buffer:: MemoryBuffer ;
199
202
200
- let mods = compile_dry:: accumulated :: < ModBuffer > ( db, docs) ;
203
+ let mods: Vec < ModBuffer > = compile_dry:: accumulated :: < ModBuffer > ( db, docs) ;
201
204
202
205
let total_steps = 3 ;
203
206
let pb = ProgressBar :: hidden ( ) ;
@@ -211,6 +214,7 @@ pub fn process_llvm_ir<'a>(
211
214
let llvmmod = ctx. create_module ( "main" ) ;
212
215
213
216
for m in mods {
217
+ let m = m. 0 ;
214
218
pb. inc ( 1 ) ;
215
219
let mem = & m. buf ;
216
220
let m = m. path ;
@@ -370,7 +374,7 @@ pub fn pl_link(llvmmod: Module, oxbjs: Vec<PathBuf>, out: String, op: Options) {
370
374
371
375
#[ cfg( not( feature = "llvm" ) ) ]
372
376
#[ salsa:: tracked]
373
- pub fn compile ( db : & dyn Db , docs : MemDocsInput , out : String , op : Options ) {
377
+ pub fn compile ( db : & ' db dyn Db , docs : MemDocsInput , out : String , op : Options ) {
374
378
unimplemented ! ( )
375
379
}
376
380
0 commit comments