mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-21 04:55:31 +00:00
Update salsa (#19258)
## Summary Pulls in https://github.com/salsa-rs/salsa/pull/934.
This commit is contained in:
parent
64f9481fd0
commit
e6e029a8b7
7 changed files with 69 additions and 26 deletions
|
|
@ -32,10 +32,31 @@ pub fn version() -> String {
|
|||
.to_string()
|
||||
}
|
||||
|
||||
/// Perform global constructor initialization.
|
||||
#[cfg(target_family = "wasm")]
|
||||
#[expect(unsafe_code)]
|
||||
pub fn before_main() {
|
||||
unsafe extern "C" {
|
||||
fn __wasm_call_ctors();
|
||||
}
|
||||
|
||||
// Salsa uses the `inventory` crate, which registers global constructors that may need to be
|
||||
// called explicitly on WASM. See <https://github.com/dtolnay/inventory/blob/master/src/lib.rs#L105>
|
||||
// for details.
|
||||
unsafe {
|
||||
__wasm_call_ctors();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub fn before_main() {}
|
||||
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn run() {
|
||||
use log::Level;
|
||||
|
||||
before_main();
|
||||
|
||||
ruff_db::set_program_version(version()).unwrap();
|
||||
|
||||
// When the `console_error_panic_hook` feature is enabled, we can call the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue