Skip to content

Commit 1154998

Browse files
authored
Merge pull request #4005 from rust-lang/rustup-2024-10-31
Automatic Rustup
2 parents b180ea2 + 8431ed8 commit 1154998

File tree

8 files changed

+23
-10
lines changed

8 files changed

+23
-10
lines changed

Diff for: rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16422dbd8958179379214e8f43fdb73a06b2eada
1+
75eff9a5749411ba5a0b37cc3299116c4e263075

Diff for: src/borrow_tracker/stacked_borrows/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use std::cell::RefCell;
99
use std::fmt::Write;
1010
use std::{cmp, mem};
1111

12+
use rustc_abi::{BackendRepr, Size};
1213
use rustc_data_structures::fx::FxHashSet;
1314
use rustc_middle::mir::{Mutability, RetagKind};
1415
use rustc_middle::ty::layout::HasParamEnv;
1516
use rustc_middle::ty::{self, Ty};
16-
use rustc_target::abi::{Abi, Size};
1717

1818
use self::diagnostics::{RetagCause, RetagInfo};
1919
pub use self::item::{Item, Permission};
@@ -972,7 +972,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
972972
RetagFields::OnlyScalar => {
973973
// Matching `ArgAbi::new` at the time of writing, only fields of
974974
// `Scalar` and `ScalarPair` ABI are considered.
975-
matches!(place.layout.abi, Abi::Scalar(..) | Abi::ScalarPair(..))
975+
matches!(
976+
place.layout.backend_repr,
977+
BackendRepr::Scalar(..) | BackendRepr::ScalarPair(..)
978+
)
976979
}
977980
};
978981
if recurse {

Diff for: src/borrow_tracker/tree_borrows/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use rustc_abi::{BackendRepr, Size};
12
use rustc_middle::mir::{Mutability, RetagKind};
23
use rustc_middle::ty::layout::HasParamEnv;
34
use rustc_middle::ty::{self, Ty};
45
use rustc_span::def_id::DefId;
5-
use rustc_target::abi::{Abi, Size};
66

77
use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
88
use crate::concurrency::data_race::NaReadType;
@@ -495,7 +495,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
495495
RetagFields::OnlyScalar => {
496496
// Matching `ArgAbi::new` at the time of writing, only fields of
497497
// `Scalar` and `ScalarPair` ABI are considered.
498-
matches!(place.layout.abi, Abi::Scalar(..) | Abi::ScalarPair(..))
498+
matches!(
499+
place.layout.backend_repr,
500+
BackendRepr::Scalar(..) | BackendRepr::ScalarPair(..)
501+
)
499502
}
500503
};
501504
if recurse {

Diff for: src/helpers.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
349349
i: impl Into<i128>,
350350
dest: &impl Writeable<'tcx, Provenance>,
351351
) -> InterpResult<'tcx> {
352-
assert!(dest.layout().abi.is_scalar(), "write_int on non-scalar type {}", dest.layout().ty);
353-
let val = if dest.layout().abi.is_signed() {
352+
assert!(
353+
dest.layout().backend_repr.is_scalar(),
354+
"write_int on non-scalar type {}",
355+
dest.layout().ty
356+
);
357+
let val = if dest.layout().backend_repr.is_signed() {
354358
Scalar::from_int(i, dest.layout().size)
355359
} else {
356360
// `unwrap` can only fail here if `i` is negative

Diff for: src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ extern crate either;
5555
extern crate tracing;
5656

5757
// The rustc crates we need
58+
extern crate rustc_abi;
5859
extern crate rustc_apfloat;
5960
extern crate rustc_ast;
6061
extern crate rustc_attr;

Diff for: src/operator.rs

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

2424
interp_ok(match bin_op {
2525
Eq | Ne | Lt | Le | Gt | Ge => {
26-
assert_eq!(left.layout.abi, right.layout.abi); // types can differ, e.g. fn ptrs with different `for`
26+
assert_eq!(left.layout.backend_repr, right.layout.backend_repr); // types can differ, e.g. fn ptrs with different `for`
2727
let size = this.pointer_size();
2828
// Just compare the bits. ScalarPairs are compared lexicographically.
2929
// We thus always compare pairs and simply fill scalars up with 0.

Diff for: src/shims/native_lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::ops::Deref;
33

44
use libffi::high::call as ffi;
55
use libffi::low::CodePtr;
6+
use rustc_abi::{BackendRepr, HasDataLayout};
67
use rustc_middle::ty::{self as ty, IntTy, UintTy};
78
use rustc_span::Symbol;
8-
use rustc_target::abi::{Abi, HasDataLayout};
99

1010
use crate::*;
1111

@@ -149,7 +149,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
149149
// Get the function arguments, and convert them to `libffi`-compatible form.
150150
let mut libffi_args = Vec::<CArg>::with_capacity(args.len());
151151
for arg in args.iter() {
152-
if !matches!(arg.layout.abi, Abi::Scalar(_)) {
152+
if !matches!(arg.layout.backend_repr, BackendRepr::Scalar(_)) {
153153
throw_unsup_format!("only scalar argument types are support for native calls")
154154
}
155155
libffi_args.push(imm_to_carg(this.read_immediate(arg)?, this)?);

Diff for: src/shims/x86/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ fn mask_load<'tcx>(
10001000
let dest = this.project_index(&dest, i)?;
10011001

10021002
if this.read_scalar(&mask)?.to_uint(mask_item_size)? >> high_bit_offset != 0 {
1003+
#[allow(clippy::arithmetic_side_effects)] // `Size` arithmetic is checked
10031004
let ptr = ptr.wrapping_offset(dest.layout.size * i, &this.tcx);
10041005
// Unaligned copy, which is what we want.
10051006
this.mem_copy(ptr, dest.ptr(), dest.layout.size, /*nonoverlapping*/ true)?;
@@ -1035,6 +1036,7 @@ fn mask_store<'tcx>(
10351036
if this.read_scalar(&mask)?.to_uint(mask_item_size)? >> high_bit_offset != 0 {
10361037
// *Non-inbounds* pointer arithmetic to compute the destination.
10371038
// (That's why we can't use a place projection.)
1039+
#[allow(clippy::arithmetic_side_effects)] // `Size` arithmetic is checked
10381040
let ptr = ptr.wrapping_offset(value.layout.size * i, &this.tcx);
10391041
// Deref the pointer *unaligned*, and do the copy.
10401042
let dest = this.ptr_to_mplace_unaligned(ptr, value.layout);

0 commit comments

Comments
 (0)