Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup #1929

Merged
merged 1 commit into from
Nov 30, 2021
Merged

rustup #1929

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
58f9efd36de5669ab731ec7ebf565999ff17b159
1c0287830e0fb3c4007afea2819ba03766da6e9c
31 changes: 0 additions & 31 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,37 +550,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
"atomic_umax_relaxed" =>
this.atomic_op(args, dest, AtomicOp::Max, AtomicRwOp::Relaxed)?,

// Query type information
"assert_zero_valid" | "assert_uninit_valid" => {
let &[] = check_arg_count(args)?;
let ty = instance.substs.type_at(0);
let layout = this.layout_of(ty)?;
// Abort here because the caller might not be panic safe.
if layout.abi.is_uninhabited() {
// Use this message even for the other intrinsics, as that's what codegen does
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to instantiate uninhabited type `{}`",
ty
)))
}
if intrinsic_name == "assert_zero_valid"
&& !layout.might_permit_raw_init(this, /*zero:*/ true)
{
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to zero-initialize type `{}`, which is invalid",
ty
)))
}
if intrinsic_name == "assert_uninit_valid"
&& !layout.might_permit_raw_init(this, /*zero:*/ false)
{
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to leave type `{}` uninitialized, which is invalid",
ty
)))
}
}

// Other
"exact_div" => {
let &[ref num, ref denom] = check_arg_count(args)?;
Expand Down