1
Fork 0

make return type of get_alloc_info a struct, and reduce some code duplication with validity checking

This commit is contained in:
Ralf Jung 2024-11-09 13:13:31 +01:00
parent 30a2ae6f05
commit 4a54ec8c18
11 changed files with 190 additions and 177 deletions

View file

@ -472,8 +472,9 @@ fn report_validation_error<'tcx>(
backtrace.print_backtrace();
let bytes = ecx.print_alloc_bytes_for_diagnostics(alloc_id);
let (size, align, ..) = ecx.get_alloc_info(alloc_id);
let raw_bytes = errors::RawBytesNote { size: size.bytes(), align: align.bytes(), bytes };
let info = ecx.get_alloc_info(alloc_id);
let raw_bytes =
errors::RawBytesNote { size: info.size.bytes(), align: info.align.bytes(), bytes };
crate::const_eval::report(
*ecx.tcx,