Skip to content

Commit

Permalink
Rollup merge of #128453 - RalfJung:raw_eq, r=saethlin
Browse files Browse the repository at this point in the history
raw_eq: using it on bytes with provenance is not UB (outside const-eval)

The current behavior of raw_eq violates provenance monotonicity. See rust-lang/rust#124921 for an explanation of provenance monotonicity. It is violated in raw_eq because comparing bytes without provenance is well-defined, but adding provenance makes the operation UB.

So remove the no-provenance requirement from raw_eq. However, the requirement stays in-place for compile-time invocations of raw_eq, that indeed cannot deal with provenance.

Cc `@rust-lang/opsem`
  • Loading branch information
matthiaskrgr committed Aug 2, 2024
2 parents 2fd25ce + 8afbb19 commit 0f589e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions tests/fail/intrinsics/raw_eq_on_ptr.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/raw_eq_on_ptr.stderr

This file was deleted.

0 comments on commit 0f589e2

Please sign in to comment.