Skip to content

Unexpected panic: assertion 'left= right failed: cannot change database mid-query #536

@Chronostasys

Description

@Chronostasys

Hi, I recently updated my project's salsa to the newest version, and everything works well in debug mode. But as
soon as I switched to the release build, a weird panic occurred:
5fdfa4e06b2fa8fd121d20b940e58245

You can see in the pic above that Rust is saying that two pointers with the address 0×14660cbb0 are not equal.

After some digging around, I found this issue: rust-lang/rust#107975

And this: rust-lang/rust#107975

I believe there's a mistake in the mid-query check, instead of checking the equivalent of two fat pointers, we shall check only the address.

salsa/src/local_state.rs

Lines 87 to 91 in e4ce917

assert_eq!(
current_db,
NonNull::from(db),
"cannot change database mid-query",
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions