mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Auto merge of #1681 - RalfJung:rustup, r=RalfJung
rustup; remove some intrinsics that are gone or moved to rustc
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
4e208f6a3afb42528878b0f3464e337c4bf3bbc8
|
||||
0677d9729318441a1cdb0c74812ec4140fa4d35f
|
||||
|
||||
@@ -51,39 +51,6 @@ fn call_intrinsic(
|
||||
}
|
||||
|
||||
// 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)?;
|
||||
|
||||
Reference in New Issue
Block a user