Skip to content

rustup; remove some intrinsics that are gone or moved to rustc #1681

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

Merged
merged 1 commit into from
Jan 18, 2021
Merged
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 @@
4e208f6a3afb42528878b0f3464e337c4bf3bbc8
0677d9729318441a1cdb0c74812ec4140fa4d35f
33 changes: 0 additions & 33 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}

// Raw memory accesses
#[rustfmt::skip]
| "copy"
| "copy_nonoverlapping"
=> {
let &[src, dest, count] = check_arg_count(args)?;
let elem_ty = instance.substs.type_at(0);
let elem_layout = this.layout_of(elem_ty)?;
let count = this.read_scalar(count)?.to_machine_usize(this)?;
let elem_align = elem_layout.align.abi;

let size = elem_layout.size.checked_mul(count, this)
.ok_or_else(|| err_ub_format!("overflow computing total size of `{}`", intrinsic_name))?;
let src = this.read_scalar(src)?.check_init()?;
let src = this.memory.check_ptr_access(src, size, elem_align)?;
let dest = this.read_scalar(dest)?.check_init()?;
let dest = this.memory.check_ptr_access(dest, size, elem_align)?;

if let (Some(src), Some(dest)) = (src, dest) {
this.memory.copy(
src,
dest,
size,
intrinsic_name.ends_with("_nonoverlapping"),
)?;
}
}

"move_val_init" => {
let &[place, dest] = check_arg_count(args)?;
let place = this.deref_operand(place)?;
this.copy_op(dest, place.into())?;
}

"volatile_load" => {
let &[place] = check_arg_count(args)?;
let place = this.deref_operand(place)?;
Expand Down