We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7fefc7 commit d8bd11aCopy full SHA for d8bd11a
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -336,13 +336,11 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
336
337
let alloc_id = mplace.ptr().provenance.unwrap();
338
339
- // Validation failed, report an error.
340
- if let Err(error) = validation {
341
- Err(const_report_error(&ecx, error, alloc_id))
342
- } else {
+ validation
+ // Validation failed, report an error.
+ .map_err(|error| const_report_error(&ecx, error, alloc_id))
343
// Convert to raw constant
344
- Ok(ConstAlloc { alloc_id, ty: mplace.layout.ty })
345
- }
+ .map(|()| ConstAlloc { alloc_id, ty: mplace.layout.ty })
346
}
347
348
0 commit comments