Skip to content

Commit a7580f7

Browse files
committedMar 14, 2020
Auto merge of #1228 - RalfJung:typo, r=RalfJung
fix typo and deduplicate comment
2 parents 2a056a7 + a92b227 commit a7580f7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎src/shims/intrinsics.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -443,16 +443,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
443443
"assert_uninit_valid" => {
444444
let ty = substs.type_at(0);
445445
let layout = this.layout_of(ty)?;
446+
// Return here because we panicked instead of returning normally from the intrinsic.
446447
if layout.abi.is_uninhabited() {
447-
// Return here because we paniced instead of returning normally from the intrinsic.
448448
return this.start_panic(&format!("attempted to instantiate uninhabited type `{}`", ty), unwind);
449449
}
450450
if intrinsic_name == "assert_zero_valid" && !layout.might_permit_raw_init(this, /*zero:*/ true).unwrap() {
451-
// Return here because we paniced instead of returning normally from the intrinsic.
452451
return this.start_panic(&format!("attempted to zero-initialize type `{}`, which is invalid", ty), unwind);
453452
}
454453
if intrinsic_name == "assert_uninit_valid" && !layout.might_permit_raw_init(this, /*zero:*/ false).unwrap() {
455-
// Return here because we paniced instead of returning normally from the intrinsic.
456454
return this.start_panic(&format!("attempted to leave type `{}` uninitialized, which is invalid", ty), unwind);
457455
}
458456
}

0 commit comments

Comments
 (0)
Please sign in to comment.