Skip to content

Running sanitizer tests fails with mixed ABI errors #147394

@djc

Description

@djc

I tried this code:

RUSTFLAGS="-Z sanitizer=address -Cunsafe-allow-abi-mismatch=sanitizer" cargo +nightly -Z build-std test --target x86_64-unknown-linux-gnu --all-features

I expected to see this happen: tests pass/fail

Instead, this happened:

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `hashlink`
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=memory` in dependency `core`
  = help: set `-Zsanitizer=memory` in this crate or unset `-Zsanitizer` in `core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

Note that I already added the suppression option, but it doesn't seem to take effect here?

Meta

rustc --version --verbose:

rustc 1.92.0-nightly (839222065 2025-10-05)

(See CI: https://app.circleci.com/pipelines/github/djc/hashlink/189/workflows/58588dc4-d323-428f-a309-d950c5fa2b0f/jobs/180.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zbuild-stdUnstable cargo option: -Zbuild-stdA-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions