let place = try_validation!(
self.ecx.ref_to_mplace(value),
self.path,
- err_ub!(InvalidUndefBytes(..)) => { "uninitialized {}", kind },
+ err_ub!(InvalidUninitBytes(..)) => { "uninitialized {}", kind },
);
if place.layout.is_unsized() {
self.check_wide_ptr_meta(place.meta, place.layout)?;
if let Some(ptr) = ptr {
// not a ZST
// Skip validation entirely for some external statics
- let alloc_kind = self.ecx.tcx.alloc_map.lock().get(ptr.alloc_id);
+ let alloc_kind = self.ecx.tcx.get_global_alloc(ptr.alloc_id);
if let Some(GlobalAlloc::Static(did)) = alloc_kind {
// See const_eval::machine::MemoryExtra::can_access_statics for why
// this check is so important.
let place = try_validation!(
self.ecx.ref_to_mplace(self.ecx.read_immediate(value)?),
self.path,
- err_ub!(InvalidUndefBytes(..)) => { "uninitialized raw pointer" },
+ err_ub!(InvalidUninitBytes(..)) => { "uninitialized raw pointer" },
);
if place.layout.is_unsized() {
self.check_wide_ptr_meta(place.meta, place.layout)?;
let value = try_validation!(
value.not_undef(),
self.path,
- err_ub!(InvalidUndefBytes(..)) => { "{}", value }
+ err_ub!(InvalidUninitBytes(..)) => { "{}", value }
expected { "something {}", wrapping_range_format(valid_range, max_hi) },
);
let bits = match value.to_bits_or_ptr(op.layout.size, self.ecx) {
// For some errors we might be able to provide extra information.
// (This custom logic does not fit the `try_validation!` macro.)
match err.kind {
- err_ub!(InvalidUndefBytes(Some(ptr))) => {
+ err_ub!(InvalidUninitBytes(Some(ptr))) => {
// Some byte was uninitialized, determine which
// element that byte belongs to so we can
// provide an index.