Skip to content

Commit

Permalink
Update hasher
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Jan 16, 2025
1 parent 4ad8bdc commit ece9c2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion generate/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(is_sorted)]
#![feature(exact_size_is_empty)]
#![feature(iter_advance_by)]
#![feature(variant_count)]
Expand Down
13 changes: 7 additions & 6 deletions mir/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,16 +718,17 @@ impl Program {
pub const FUNCTION_ATTRIBUTE: &'static str =
"#[custom_mir(dialect = \"runtime\", phase = \"initial\")]";
pub const HEADER: &'static str = "#![recursion_limit = \"1024\"]
#![feature(custom_mir, core_intrinsics, const_hash)]
#![feature(custom_mir, core_intrinsics, lazy_get)]
#![allow(unused_parens, unused_assignments, overflowing_literals)]
extern crate core;
use core::intrinsics::mir::*;\n";

pub const DUMPER: &'static str = r#"
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::sync::LazyLock;
static mut H: DefaultHasher = DefaultHasher::new();
static mut H: LazyLock<DefaultHasher> = LazyLock::new(|| DefaultHasher::new());
#[inline(never)]
fn dump_var(
Expand All @@ -737,10 +738,10 @@ impl Program {
val3: impl Hash,
) {
unsafe {
val0.hash(&mut H);
val1.hash(&mut H);
val2.hash(&mut H);
val3.hash(&mut H);
val0.hash(LazyLock::force_mut(&mut H));
val1.hash(LazyLock::force_mut(&mut H));
val2.hash(LazyLock::force_mut(&mut H));
val3.hash(LazyLock::force_mut(&mut H));
}
}
"#;
Expand Down

0 comments on commit ece9c2f

Please sign in to comment.