Skip to content

Commit f85f257

Browse files
committed
fix: update salsa to fix wasm build
Also updated Rust version to 1.80.0
1 parent 79809d2 commit f85f257

File tree

13 files changed

+120
-213
lines changed

13 files changed

+120
-213
lines changed

Cargo.lock

Lines changed: 11 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ lsp-server = "0.7"
4141
serde_json = "1.0"
4242
rustc-hash = "1.1"
4343
crossbeam-channel = "0.5"
44-
salsa = { package = "salsa", git = "https://github.com/Chronostasys/salsa", branch = "master" }
44+
salsa = { package = "salsa", git = "https://github.com/salsa-rs/salsa", branch = "master" }
4545
enum_dispatch = "0.3"
4646
threadpool = { version = "1.8", optional = true }
4747
dunce = "1.0"

immix

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.75.0"
2+
channel = "1.80.0"
33
components = ["rustfmt", "clippy"]

src/ast/accumulators.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub struct ModBuffer(pub PLModBuffer);
3535
pub struct PLModBuffer {
3636
pub path: PathBuf,
3737
pub buf: Vec<u8>,
38-
pub is_main: bool,
3938
pub name: String,
4039
}
4140

src/ast/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl FmtBuilder {
398398
}
399399
pub fn parse_take_op_node(&mut self, node: &TakeOpNode) {
400400
node.head.format(self);
401-
for id in &node.field {
401+
if let Some(id) = &node.field {
402402
self.dot();
403403
id.format(self);
404404
}

src/ast/node/program.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@ pub fn emit_file<'db>(
734734
ModBuffer(PLModBuffer {
735735
path: p.to_path_buf(),
736736
buf,
737-
is_main: builder.get_function("main").is_some(),
738737
name: program_emit_params.file(db).to_string(),
739738
})
740739
.accumulate(db);

src/ast/node/program/cycle.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ pub fn cycle_deps_recover<'db>(
2525
cycle: &salsa::Cycle,
2626
_: FileCompileInput,
2727
) -> Option<ModWrapper<'db>> {
28-
let key = cycle.all_participants(db.as_salsa_database());
28+
let key = cycle.all_participants(db.as_dyn_database());
2929
let mut files = FxHashMap::default();
3030
let mut prev_use_map = FxHashMap::default();
3131
let params = cycle
3232
.participant_keys()
3333
.enumerate()
3434
.filter(|(i, _)| {
3535
let key = key[*i];
36-
let name = db.lookup_ingredient(key.ingredient_index()).debug_name();
36+
let name = db.ingredient_debug_name(key.ingredient_index());
3737
name != "compile_dry_file"
3838
})
39-
.map(|(_, k)| Program::lookup_id(k.key_index(), db.as_salsa_database()))
39+
.map(|(_, k)| Program::lookup_id(k.key_index(), db.as_dyn_database()))
4040
.last()
4141
.unwrap();
4242
let src_file_path = params.params(db).file(db);
4343
let mut prev_file = src_file_path;
4444
build_init_params(params, db, &mut prev_use_map);
4545
let filtered = cycle.participant_keys().enumerate().filter(|(i, _)| {
4646
let key = key[*i];
47-
let name = db.lookup_ingredient(key.ingredient_index()).debug_name();
47+
let name = db.ingredient_debug_name(key.ingredient_index());
4848
name != "compile_dry_file"
4949
});
5050
let len = filtered.count();
@@ -54,10 +54,10 @@ pub fn cycle_deps_recover<'db>(
5454
.enumerate()
5555
.filter(|(i, _)| {
5656
let key = key[*i];
57-
let name = db.lookup_ingredient(key.ingredient_index()).debug_name();
57+
let name = db.ingredient_debug_name(key.ingredient_index());
5858
name != "compile_dry_file"
5959
})
60-
.map(|(u, k)| (u, Program::lookup_id(k.key_index(), db.as_salsa_database())))
60+
.map(|(u, k)| (u, Program::lookup_id(k.key_index(), db.as_dyn_database())))
6161
{
6262
let prog = match_node(p, db);
6363
if let Some(r) = prev_use_map.get(p.params(db).file(db)) {

src/db.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,28 @@ pub struct Database {
2929
// ANCHOR: db_impl
3030
#[salsa::db]
3131
impl salsa::Database for Database {
32-
fn salsa_event(&self, event: salsa::Event) {
32+
fn salsa_event(&self, event: &dyn Fn() -> salsa::Event) {
3333
// Log interesting events, if logging is enabled
3434
if let Some(logs) = &self.logs {
35+
let event = event();
3536
// don't log boring events
3637
if let salsa::EventKind::WillExecute { .. } = event.kind {
3738
logs.lock().unwrap().push(format!("Event: {:?}", event));
3839
}
3940
}
4041
}
4142
}
43+
44+
impl Clone for Database {
45+
fn clone(&self) -> Self {
46+
Self {
47+
storage: self.storage.clone(),
48+
logs: self.logs.clone(),
49+
ref_str: self.ref_str.clone(),
50+
module_map: self.module_map.clone(),
51+
}
52+
}
53+
}
4254
// // ANCHOR_END: db_impl
4355

4456
// // ANCHOR: par_db_impl

0 commit comments

Comments
 (0)