raw_eq: using it on bytes with provenance is not UB (outside const-eval)
This commit is contained in:
parent
99322d84c4
commit
f97aba2271
7 changed files with 9 additions and 35 deletions
|
@ -301,9 +301,6 @@ const_eval_range_upper = less or equal to {$hi}
|
|||
const_eval_range_wrapping = less or equal to {$hi}, or greater or equal to {$lo}
|
||||
const_eval_raw_bytes = the raw bytes of the constant (size: {$size}, align: {$align}) {"{"}{$bytes}{"}"}
|
||||
|
||||
const_eval_raw_eq_with_provenance =
|
||||
`raw_eq` on bytes with provenance
|
||||
|
||||
const_eval_raw_ptr_comparison =
|
||||
pointers cannot be reliably compared during const eval
|
||||
.note = see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information
|
||||
|
|
|
@ -693,9 +693,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
|
|||
// zero-sized access
|
||||
return Ok(&[]);
|
||||
};
|
||||
if alloc_ref.has_provenance() {
|
||||
throw_ub_custom!(fluent::const_eval_raw_eq_with_provenance);
|
||||
}
|
||||
alloc_ref.get_bytes_strip_provenance()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue