Skip to content

Commit 4f8492c

Browse files
authored
Merge pull request rust-lang#4162 from rust-lang/rustup-2025-01-29
Automatic Rustup
2 parents b1d927e + bf1e4a1 commit 4f8492c

File tree

512 files changed

+8991
-3430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

512 files changed

+8991
-3430
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,6 @@ checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f"
18591859
dependencies = [
18601860
"equivalent",
18611861
"hashbrown 0.15.2",
1862-
"rustc-rayon",
18631862
"serde",
18641863
]
18651864

@@ -3240,11 +3239,12 @@ dependencies = [
32403239

32413240
[[package]]
32423241
name = "rustc-rayon"
3243-
version = "0.5.0"
3242+
version = "0.5.1"
32443243
source = "registry+https://github.com/rust-lang/crates.io-index"
3245-
checksum = "eb81aadc8837ca6ecebe0fe1353f15df83b3b3cc2cf7a8afd571bc22aa121710"
3244+
checksum = "2cd9fb077db982d7ceb42a90471e5a69a990b58f71e06f0d8340bb2cf35eb751"
32463245
dependencies = [
32473246
"either",
3247+
"indexmap",
32483248
"rustc-rayon-core",
32493249
]
32503250

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl<'tcx> TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx> {
310310
let (infcx, key, _) =
311311
mbcx.infcx.tcx.infer_ctxt().build_with_canonical(cause.span, &self.canonical_query);
312312
let ocx = ObligationCtxt::new(&infcx);
313-
type_op_ascribe_user_type_with_span(&ocx, key, Some(cause.span)).ok()?;
313+
type_op_ascribe_user_type_with_span(&ocx, key, cause.span).ok()?;
314314
let diag = try_extract_error_from_fulfill_cx(
315315
&ocx,
316316
mbcx.mir_def_id(),

compiler/rustc_borrowck/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,15 +1284,18 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
12841284
);
12851285
}
12861286

1287-
&Rvalue::RawPtr(mutability, place) => {
1288-
let access_kind = match mutability {
1289-
Mutability::Mut => (
1287+
&Rvalue::RawPtr(kind, place) => {
1288+
let access_kind = match kind {
1289+
RawPtrKind::Mut => (
12901290
Deep,
12911291
Write(WriteKind::MutableBorrow(BorrowKind::Mut {
12921292
kind: MutBorrowKind::Default,
12931293
})),
12941294
),
1295-
Mutability::Not => (Deep, Read(ReadKind::Borrow(BorrowKind::Shared))),
1295+
RawPtrKind::Const => (Deep, Read(ReadKind::Borrow(BorrowKind::Shared))),
1296+
RawPtrKind::FakeForPtrMetadata => {
1297+
(Shallow(Some(ArtificialField::ArrayLength)), Read(ReadKind::Copy))
1298+
}
12961299
};
12971300

12981301
self.access_place(

compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ use std::ops::ControlFlow;
33
use rustc_data_structures::graph::dominators::Dominators;
44
use rustc_middle::bug;
55
use rustc_middle::mir::visit::Visitor;
6-
use rustc_middle::mir::{
7-
self, BasicBlock, Body, BorrowKind, FakeBorrowKind, InlineAsmOperand, Location, Mutability,
8-
NonDivergingIntrinsic, Operand, Place, Rvalue, Statement, StatementKind, Terminator,
9-
TerminatorKind,
10-
};
6+
use rustc_middle::mir::*;
117
use rustc_middle::ty::TyCtxt;
128
use tracing::debug;
139

@@ -60,7 +56,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'a, 'tcx> {
6056
StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => {
6157
self.consume_operand(location, op);
6258
}
63-
StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(mir::CopyNonOverlapping {
59+
StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(CopyNonOverlapping {
6460
src,
6561
dst,
6662
count,
@@ -273,15 +269,18 @@ impl<'a, 'tcx> LoanInvalidationsGenerator<'a, 'tcx> {
273269
self.access_place(location, place, access_kind, LocalMutationIsAllowed::No);
274270
}
275271

276-
&Rvalue::RawPtr(mutability, place) => {
277-
let access_kind = match mutability {
278-
Mutability::Mut => (
272+
&Rvalue::RawPtr(kind, place) => {
273+
let access_kind = match kind {
274+
RawPtrKind::Mut => (
279275
Deep,
280276
Write(WriteKind::MutableBorrow(BorrowKind::Mut {
281-
kind: mir::MutBorrowKind::Default,
277+
kind: MutBorrowKind::Default,
282278
})),
283279
),
284-
Mutability::Not => (Deep, Read(ReadKind::Borrow(BorrowKind::Shared))),
280+
RawPtrKind::Const => (Deep, Read(ReadKind::Borrow(BorrowKind::Shared))),
281+
RawPtrKind::FakeForPtrMetadata => {
282+
(Shallow(Some(ArtificialField::ArrayLength)), Read(ReadKind::Copy))
283+
}
285284
};
286285

287286
self.access_place(location, place, access_kind, LocalMutationIsAllowed::No);

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
349349
let tcx = self.tcx();
350350
let maybe_uneval = match constant.const_ {
351351
Const::Ty(_, ct) => match ct.kind() {
352-
ty::ConstKind::Unevaluated(_) => {
353-
bug!("should not encounter unevaluated Const::Ty here, got {:?}", ct)
352+
ty::ConstKind::Unevaluated(uv) => {
353+
Some(UnevaluatedConst { def: uv.def, args: uv.args, promoted: None })
354354
}
355355
_ => None,
356356
},

compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
126126
&mut self,
127127
name: &str,
128128
params: Vec<AbiParam>,
129-
returns: Vec<AbiParam>,
129+
mut returns: Vec<AbiParam>,
130130
args: &[Value],
131131
) -> Cow<'_, [Value]> {
132132
// Pass i128 arguments by-ref on Windows.
@@ -150,15 +150,19 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
150150
(params, args.into())
151151
};
152152

153-
// Return i128 using a return area pointer on Windows and s390x.
154-
let adjust_ret_param =
155-
if self.tcx.sess.target.is_like_windows || self.tcx.sess.target.arch == "s390x" {
156-
returns.len() == 1 && returns[0].value_type == types::I128
157-
} else {
158-
false
159-
};
153+
let ret_single_i128 = returns.len() == 1 && returns[0].value_type == types::I128;
154+
if ret_single_i128 && self.tcx.sess.target.is_like_windows {
155+
// Return i128 using the vector ABI on Windows
156+
returns[0].value_type = types::I64X2;
157+
158+
let ret = self.lib_call_unadjusted(name, params, returns, &args)[0];
160159

161-
if adjust_ret_param {
160+
// FIXME(bytecodealliance/wasmtime#6104) use bitcast instead of store to get from i64x2 to i128
161+
let ret_ptr = self.create_stack_slot(16, 16);
162+
ret_ptr.store(self, ret, MemFlags::trusted());
163+
Cow::Owned(vec![ret_ptr.load(self, types::I128, MemFlags::trusted())])
164+
} else if ret_single_i128 && self.tcx.sess.target.arch == "s390x" {
165+
// Return i128 using a return area pointer on s390x.
162166
let mut params = params;
163167
let mut args = args.to_vec();
164168

compiler/rustc_codegen_cranelift/src/cast.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,9 @@ pub(crate) fn clif_int_or_float_cast(
9696
},
9797
);
9898

99-
if fx.tcx.sess.target.is_like_windows {
100-
let ret = fx.lib_call(
101-
&name,
102-
vec![AbiParam::new(from_ty)],
103-
vec![AbiParam::new(types::I64X2)],
104-
&[from],
105-
)[0];
106-
// FIXME(bytecodealliance/wasmtime#6104) use bitcast instead of store to get from i64x2 to i128
107-
let ret_ptr = fx.create_stack_slot(16, 16);
108-
ret_ptr.store(fx, ret, MemFlags::trusted());
109-
ret_ptr.load(fx, types::I128, MemFlags::trusted())
110-
} else {
111-
fx.lib_call(
112-
&name,
113-
vec![AbiParam::new(from_ty)],
114-
vec![AbiParam::new(types::I128)],
115-
&[from],
116-
)[0]
117-
}
99+
fx.lib_call(&name, vec![AbiParam::new(from_ty)], vec![AbiParam::new(types::I128)], &[
100+
from,
101+
])[0]
118102
} else if to_ty == types::I8 || to_ty == types::I16 {
119103
// FIXME implement fcvt_to_*int_sat.i8/i16
120104
let val = if to_signed {

compiler/rustc_codegen_cranelift/src/codegen_i128.rs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,14 @@ pub(crate) fn maybe_codegen<'tcx>(
3333
(BinOp::Rem, true) => "__modti3",
3434
_ => unreachable!(),
3535
};
36-
if fx.tcx.sess.target.is_like_windows {
37-
let args = [lhs.load_scalar(fx), rhs.load_scalar(fx)];
38-
let ret = fx.lib_call(
39-
name,
40-
vec![AbiParam::new(types::I128), AbiParam::new(types::I128)],
41-
vec![AbiParam::new(types::I64X2)],
42-
&args,
43-
)[0];
44-
// FIXME(bytecodealliance/wasmtime#6104) use bitcast instead of store to get from i64x2 to i128
45-
let ret_place = CPlace::new_stack_slot(fx, lhs.layout());
46-
ret_place.to_ptr().store(fx, ret, MemFlags::trusted());
47-
Some(ret_place.to_cvalue(fx))
48-
} else {
49-
let args = [lhs.load_scalar(fx), rhs.load_scalar(fx)];
50-
let ret_val = fx.lib_call(
51-
name,
52-
vec![AbiParam::new(types::I128), AbiParam::new(types::I128)],
53-
vec![AbiParam::new(types::I128)],
54-
&args,
55-
)[0];
56-
Some(CValue::by_val(ret_val, lhs.layout()))
57-
}
36+
let args = [lhs.load_scalar(fx), rhs.load_scalar(fx)];
37+
let ret_val = fx.lib_call(
38+
name,
39+
vec![AbiParam::new(types::I128), AbiParam::new(types::I128)],
40+
vec![AbiParam::new(types::I128)],
41+
&args,
42+
)[0];
43+
Some(CValue::by_val(ret_val, lhs.layout()))
5844
}
5945
BinOp::Lt | BinOp::Le | BinOp::Eq | BinOp::Ge | BinOp::Gt | BinOp::Ne | BinOp::Cmp => None,
6046
BinOp::Shl | BinOp::ShlUnchecked | BinOp::Shr | BinOp::ShrUnchecked => None,

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
612612
mir::Rvalue::CopyForDeref(place) => {
613613
self.codegen_operand(bx, &mir::Operand::Copy(place))
614614
}
615-
mir::Rvalue::RawPtr(mutability, place) => {
616-
let mk_ptr =
617-
move |tcx: TyCtxt<'tcx>, ty: Ty<'tcx>| Ty::new_ptr(tcx, ty, mutability);
615+
mir::Rvalue::RawPtr(kind, place) => {
616+
let mk_ptr = move |tcx: TyCtxt<'tcx>, ty: Ty<'tcx>| {
617+
Ty::new_ptr(tcx, ty, kind.to_mutbl_lossy())
618+
};
618619
self.codegen_place_to_pointer(bx, place, mk_ptr)
619620
}
620621

compiler/rustc_const_eval/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ const_eval_uninhabited_enum_variant_read =
403403
const_eval_uninhabited_enum_variant_written =
404404
writing discriminant of an uninhabited enum variant
405405
406-
const_eval_unmarked_const_fn_exposed = `{$def_path}` cannot be (indirectly) exposed to stable
406+
const_eval_unmarked_const_item_exposed = `{$def_path}` cannot be (indirectly) exposed to stable
407407
.help = either mark the callee as `#[rustc_const_stable_indirect]`, or the caller as `#[rustc_const_unstable]`
408408
const_eval_unmarked_intrinsic_exposed = intrinsic `{$def_path}` cannot be (indirectly) exposed to stable
409409
.help = mark the caller as `#[rustc_const_unstable]`, or mark the intrinsic `#[rustc_intrinsic_const_stable_indirect]` (but this requires team approval)
@@ -414,6 +414,7 @@ const_eval_unreachable_unwind =
414414
415415
const_eval_unsized_local = unsized locals are not supported
416416
const_eval_unstable_const_fn = `{$def_path}` is not yet stable as a const fn
417+
const_eval_unstable_const_trait = `{$def_path}` is not yet stable as a const trait
417418
const_eval_unstable_in_stable_exposed =
418419
const function that might be (indirectly) exposed to stable cannot use `#[feature({$gate})]`
419420
.is_function_call = mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features

0 commit comments

Comments
 (0)