Skip to content

Commit af2cba3

Browse files
committed
Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #124615 (coverage: Further simplify extraction of mapping info from MIR) - #124778 (Fix parse error message for meta items) - #124797 (Refactor float `Primitive`s to a separate `Float` type) - #124888 (Migrate `run-make/rustdoc-output-path` to rmake) - #124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e5500be + c3497e8 commit af2cba3

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

src/borrow_tracker/stacked_borrows/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl NewPermission {
136136
cx: &crate::MiriInterpCx<'_, 'tcx>,
137137
) -> Self {
138138
// `ty` is not the `Box` but the field of the Box with this pointer (due to allocator handling).
139-
let pointee = ty.builtin_deref(true).unwrap().ty;
139+
let pointee = ty.builtin_deref(true).unwrap();
140140
if pointee.is_unpin(*cx.tcx, cx.param_env()) {
141141
// A regular box. On `FnEntry` this is `noalias`, but not `dereferenceable` (hence only
142142
// a weak protector).

src/borrow_tracker/tree_borrows/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<'tcx> NewPermission {
173173
cx: &crate::MiriInterpCx<'_, 'tcx>,
174174
zero_size: bool,
175175
) -> Option<Self> {
176-
let pointee = ty.builtin_deref(true).unwrap().ty;
176+
let pointee = ty.builtin_deref(true).unwrap();
177177
pointee.is_unpin(*cx.tcx, cx.param_env()).then_some(()).map(|()| {
178178
// Regular `Unpin` box, give it `noalias` but only a weak protector
179179
// because it is valid to deallocate it within the function.

src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
117117

118118
"write_bytes" | "volatile_set_memory" => {
119119
let [ptr, val_byte, count] = check_arg_count(args)?;
120-
let ty = ptr.layout.ty.builtin_deref(true).unwrap().ty;
120+
let ty = ptr.layout.ty.builtin_deref(true).unwrap();
121121
let ty_layout = this.layout_of(ty)?;
122122
let val_byte = this.read_scalar(val_byte)?.to_u8()?;
123123
let ptr = this.read_pointer(ptr)?;

src/intrinsics/simd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267267
Op::WrappingOffset => {
268268
let ptr = left.to_scalar().to_pointer(this)?;
269269
let offset_count = right.to_scalar().to_target_isize(this)?;
270-
let pointee_ty = left.layout.ty.builtin_deref(true).unwrap().ty;
270+
let pointee_ty = left.layout.ty.builtin_deref(true).unwrap();
271271

272272
let pointee_size = i64::try_from(this.layout_of(pointee_ty)?.size.bytes()).unwrap();
273273
let offset_bytes = offset_count.wrapping_mul(pointee_size);

src/shims/unix/foreign_items.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
378378
.builtin_deref(true)
379379
.ok_or_else(|| err_ub_format!(
380380
"wrong signature used for `pthread_key_create`: first argument must be a raw pointer."
381-
))?
382-
.ty;
381+
))?;
383382
let key_layout = this.layout_of(key_type)?;
384383

385384
// Create key and write it into the memory where `key_ptr` wants it.

0 commit comments

Comments
 (0)