Skip to content

Commit

Permalink
Auto merge of #1681 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
rustup; remove some intrinsics that are gone or moved to rustc
  • Loading branch information
bors committed Jan 18, 2021
2 parents d814eaa + 3d01ba1 commit 903bfd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
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

0 comments on commit 903bfd8

Please sign in to comment.