Skip to content

Commit ea2a2bd

Browse files
authored
Merge pull request #4229 from rust-lang/rustup-2025-03-16
Automatic Rustup
2 parents b724fab + 17ae00d commit ea2a2bd

File tree

469 files changed

+2635
-1842
lines changed

Some content is hidden

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

469 files changed

+2635
-1842
lines changed

.github/workflows/post-merge.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ jobs:
3535
3636
cd src/ci/citool
3737
38-
echo "Post-merge analysis result" > output.log
38+
printf "*This is an experimental post-merge analysis report. You can ignore it.*\n\n" > output.log
39+
printf "<details>\n<summary>Post-merge report</summary>\n\n" >> output.log
40+
3941
cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log
42+
43+
printf "</details>\n" >> output.log
44+
4045
cat output.log
4146
4247
gh pr comment ${HEAD_PR} -F output.log

Cargo.lock

-8
Original file line numberDiff line numberDiff line change
@@ -3440,7 +3440,6 @@ dependencies = [
34403440
"rustc_symbol_mangling",
34413441
"rustc_target",
34423442
"rustc_trait_selection",
3443-
"rustc_type_ir",
34443443
"serde_json",
34453444
"smallvec",
34463445
"tempfile",
@@ -3473,7 +3472,6 @@ dependencies = [
34733472
"rustc_span",
34743473
"rustc_target",
34753474
"rustc_trait_selection",
3476-
"rustc_type_ir",
34773475
"tracing",
34783476
]
34793477

@@ -3736,7 +3734,6 @@ dependencies = [
37363734
"rustc_span",
37373735
"rustc_target",
37383736
"rustc_trait_selection",
3739-
"rustc_type_ir",
37403737
"smallvec",
37413738
"tracing",
37423739
]
@@ -3775,7 +3772,6 @@ dependencies = [
37753772
"rustc_session",
37763773
"rustc_span",
37773774
"rustc_trait_selection",
3778-
"rustc_type_ir",
37793775
"smallvec",
37803776
"tracing",
37813777
]
@@ -3922,7 +3918,6 @@ dependencies = [
39223918
"rustc_span",
39233919
"rustc_target",
39243920
"rustc_trait_selection",
3925-
"rustc_type_ir",
39263921
"smallvec",
39273922
"tracing",
39283923
"unicode-security",
@@ -3998,7 +3993,6 @@ dependencies = [
39983993
"rustc_session",
39993994
"rustc_span",
40003995
"rustc_target",
4001-
"rustc_type_ir",
40023996
"tempfile",
40033997
"tracing",
40043998
]
@@ -4114,7 +4108,6 @@ dependencies = [
41144108
"rustc_span",
41154109
"rustc_target",
41164110
"rustc_trait_selection",
4117-
"rustc_type_ir",
41184111
"smallvec",
41194112
"tracing",
41204113
]
@@ -4538,7 +4531,6 @@ dependencies = [
45384531
"rustc_span",
45394532
"rustc_target",
45404533
"rustc_trait_selection",
4541-
"rustc_type_ir",
45424534
"tracing",
45434535
]
45444536

compiler/rustc_abi/src/lib.rs

+25-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use rustc_data_structures::stable_hasher::StableOrd;
5252
use rustc_hashes::Hash64;
5353
use rustc_index::{Idx, IndexSlice, IndexVec};
5454
#[cfg(feature = "nightly")]
55-
use rustc_macros::{Decodable_Generic, Encodable_Generic, HashStable_Generic};
55+
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_Generic};
5656

5757
mod callconv;
5858
mod layout;
@@ -74,7 +74,10 @@ pub use layout::{LayoutCalculator, LayoutCalculatorError};
7474
pub trait HashStableContext {}
7575

7676
#[derive(Clone, Copy, PartialEq, Eq, Default)]
77-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
77+
#[cfg_attr(
78+
feature = "nightly",
79+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
80+
)]
7881
pub struct ReprFlags(u8);
7982

8083
bitflags! {
@@ -106,7 +109,10 @@ impl std::fmt::Debug for ReprFlags {
106109
}
107110

108111
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
109-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
112+
#[cfg_attr(
113+
feature = "nightly",
114+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
115+
)]
110116
pub enum IntegerType {
111117
/// Pointer-sized integer type, i.e. `isize` and `usize`. The field shows signedness, e.g.
112118
/// `Pointer(true)` means `isize`.
@@ -127,7 +133,10 @@ impl IntegerType {
127133

128134
/// Represents the repr options provided by the user.
129135
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
130-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
136+
#[cfg_attr(
137+
feature = "nightly",
138+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
139+
)]
131140
pub struct ReprOptions {
132141
pub int: Option<IntegerType>,
133142
pub align: Option<Align>,
@@ -487,7 +496,10 @@ impl FromStr for Endian {
487496

488497
/// Size of a type in bytes.
489498
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
490-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
499+
#[cfg_attr(
500+
feature = "nightly",
501+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
502+
)]
491503
pub struct Size {
492504
raw: u64,
493505
}
@@ -713,7 +725,10 @@ impl Step for Size {
713725

714726
/// Alignment of a type in bytes (always a power of two).
715727
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
716-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
728+
#[cfg_attr(
729+
feature = "nightly",
730+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
731+
)]
717732
pub struct Align {
718733
pow2: u8,
719734
}
@@ -872,7 +887,10 @@ impl AbiAndPrefAlign {
872887

873888
/// Integers, also used for enum discriminants.
874889
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
875-
#[cfg_attr(feature = "nightly", derive(Encodable_Generic, Decodable_Generic, HashStable_Generic))]
890+
#[cfg_attr(
891+
feature = "nightly",
892+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic)
893+
)]
876894
pub enum Integer {
877895
I8,
878896
I16,

compiler/rustc_ast_ir/src/lib.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
// tidy-alphabetical-end
1313

1414
#[cfg(feature = "nightly")]
15-
use rustc_macros::{Decodable, Encodable, HashStable_NoContext};
15+
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext};
1616

1717
pub mod visit;
1818

1919
/// The movability of a coroutine / closure literal:
2020
/// whether a coroutine contains self-references, causing it to be `!Unpin`.
2121
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
22-
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
22+
#[cfg_attr(
23+
feature = "nightly",
24+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
25+
)]
2326
pub enum Movability {
2427
/// May contain self-references, `!Unpin`.
2528
Static,
@@ -28,7 +31,10 @@ pub enum Movability {
2831
}
2932

3033
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
31-
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
34+
#[cfg_attr(
35+
feature = "nightly",
36+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
37+
)]
3238
pub enum Mutability {
3339
// N.B. Order is deliberate, so that Not < Mut
3440
Not,
@@ -87,7 +93,10 @@ impl Mutability {
8793
}
8894

8995
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
90-
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
96+
#[cfg_attr(
97+
feature = "nightly",
98+
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
99+
)]
91100
pub enum Pinnedness {
92101
Not,
93102
Pinned,

compiler/rustc_ast_lowering/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15161516
fn lower_fn_params_to_names(&mut self, decl: &FnDecl) -> &'hir [Ident] {
15171517
self.arena.alloc_from_iter(decl.inputs.iter().map(|param| match param.pat.kind {
15181518
PatKind::Ident(_, ident, _) => self.lower_ident(ident),
1519-
_ => Ident::new(kw::Empty, self.lower_span(param.pat.span)),
1519+
PatKind::Wild => Ident::new(kw::Underscore, self.lower_span(param.pat.span)),
1520+
_ => {
1521+
self.dcx().span_delayed_bug(
1522+
param.pat.span,
1523+
"non-ident/wild param pat must trigger an error",
1524+
);
1525+
Ident::new(kw::Empty, self.lower_span(param.pat.span))
1526+
}
15201527
}))
15211528
}
15221529

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use rustc_infer::infer::{NllRegionVariableOrigin, RelateParamBound};
1414
use rustc_middle::bug;
1515
use rustc_middle::hir::place::PlaceBase;
1616
use rustc_middle::mir::{AnnotationSource, ConstraintCategory, ReturnConstraint};
17-
use rustc_middle::ty::fold::fold_regions;
1817
use rustc_middle::ty::{
19-
self, GenericArgs, Region, RegionVid, Ty, TyCtxt, TypeFoldable, TypeVisitor,
18+
self, GenericArgs, Region, RegionVid, Ty, TyCtxt, TypeFoldable, TypeVisitor, fold_regions,
2019
};
2120
use rustc_span::{Ident, Span, kw};
2221
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;

compiler/rustc_borrowck/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ use rustc_infer::infer::{
3535
};
3636
use rustc_middle::mir::*;
3737
use rustc_middle::query::Providers;
38-
use rustc_middle::ty::fold::fold_regions;
39-
use rustc_middle::ty::{self, ParamEnv, RegionVid, TyCtxt, TypingMode};
38+
use rustc_middle::ty::{self, ParamEnv, RegionVid, TyCtxt, TypingMode, fold_regions};
4039
use rustc_middle::{bug, span_bug};
4140
use rustc_mir_dataflow::impls::{
4241
EverInitializedPlaces, MaybeInitializedPlaces, MaybeUninitializedPlaces,

compiler/rustc_borrowck/src/region_infer/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use rustc_middle::mir::{
1818
ReturnConstraint, TerminatorKind,
1919
};
2020
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
21-
use rustc_middle::ty::fold::fold_regions;
22-
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt, TypeFoldable, UniverseIndex};
21+
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt, TypeFoldable, UniverseIndex, fold_regions};
2322
use rustc_mir_dataflow::points::DenseLocationMap;
2423
use rustc_span::hygiene::DesugaringKind;
2524
use rustc_span::{DUMMY_SP, Span};

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ use rustc_hir::def_id::LocalDefId;
55
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
66
use rustc_infer::infer::{InferCtxt, NllRegionVariableOrigin, TyCtxtInferExt as _};
77
use rustc_macros::extension;
8-
use rustc_middle::ty::fold::fold_regions;
9-
use rustc_middle::ty::visit::TypeVisitableExt;
108
use rustc_middle::ty::{
119
self, GenericArgKind, GenericArgs, OpaqueHiddenType, OpaqueTypeKey, Ty, TyCtxt, TypeFoldable,
12-
TypingMode,
10+
TypeVisitableExt, TypingMode, fold_regions,
1311
};
1412
use rustc_span::Span;
1513
use rustc_trait_selection::regions::OutlivesEnvironmentBuildExt;

compiler/rustc_borrowck/src/renumber.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use rustc_index::IndexSlice;
22
use rustc_infer::infer::NllRegionVariableOrigin;
33
use rustc_middle::mir::visit::{MutVisitor, TyContext};
44
use rustc_middle::mir::{Body, ConstOperand, Location, Promoted};
5-
use rustc_middle::ty::fold::fold_regions;
6-
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeFoldable};
5+
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeFoldable, fold_regions};
76
use rustc_span::Symbol;
87
use tracing::{debug, instrument};
98

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ use rustc_infer::infer::{self, InferCtxt, SubregionOrigin};
77
use rustc_infer::traits::query::type_op::DeeplyNormalize;
88
use rustc_middle::bug;
99
use rustc_middle::mir::{ClosureOutlivesSubject, ClosureRegionRequirements, ConstraintCategory};
10-
use rustc_middle::ty::fold::fold_regions;
11-
use rustc_middle::ty::{self, GenericArgKind, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
10+
use rustc_middle::ty::{
11+
self, GenericArgKind, Ty, TyCtxt, TypeFoldable, TypeVisitableExt, fold_regions,
12+
};
1213
use rustc_span::Span;
1314
use rustc_trait_selection::traits::query::type_op::{TypeOp, TypeOpOutput};
1415
use tracing::{debug, instrument};

compiler/rustc_borrowck/src/type_check/liveness/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use rustc_middle::mir::visit::{TyContext, Visitor};
44
use rustc_middle::mir::{Body, Local, Location, SourceInfo};
55
use rustc_middle::span_bug;
66
use rustc_middle::ty::relate::Relate;
7-
use rustc_middle::ty::visit::TypeVisitable;
8-
use rustc_middle::ty::{GenericArgsRef, Region, RegionVid, Ty, TyCtxt};
7+
use rustc_middle::ty::{GenericArgsRef, Region, RegionVid, Ty, TyCtxt, TypeVisitable};
98
use rustc_mir_dataflow::ResultsCursor;
109
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
1110
use rustc_mir_dataflow::move_paths::MoveData;

compiler/rustc_borrowck/src/type_check/mod.rs

+18-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ use rustc_middle::mir::*;
2424
use rustc_middle::traits::query::NoSolution;
2525
use rustc_middle::ty::adjustment::PointerCoercion;
2626
use rustc_middle::ty::cast::CastTy;
27-
use rustc_middle::ty::fold::fold_regions;
28-
use rustc_middle::ty::visit::TypeVisitableExt;
2927
use rustc_middle::ty::{
3028
self, Binder, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, CoroutineArgsExt,
31-
Dynamic, GenericArgsRef, OpaqueHiddenType, OpaqueTypeKey, RegionVid, Ty, TyCtxt, UserArgs,
32-
UserTypeAnnotationIndex,
29+
Dynamic, GenericArgsRef, OpaqueHiddenType, OpaqueTypeKey, RegionVid, Ty, TyCtxt,
30+
TypeVisitableExt, UserArgs, UserTypeAnnotationIndex, fold_regions,
3331
};
3432
use rustc_middle::{bug, span_bug};
3533
use rustc_mir_dataflow::ResultsCursor;
@@ -1773,6 +1771,22 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
17731771
{
17741772
span_mirbug!(self, constant, "bad static type {:?} ({:?})", constant, terr);
17751773
}
1774+
} else if let Const::Ty(_, ct) = constant.const_
1775+
&& let ty::ConstKind::Param(p) = ct.kind()
1776+
{
1777+
let body_def_id = self.universal_regions.defining_ty.def_id();
1778+
let const_param = tcx.generics_of(body_def_id).const_param(p, tcx);
1779+
self.ascribe_user_type(
1780+
constant.const_.ty(),
1781+
ty::UserType::new(ty::UserTypeKind::TypeOf(
1782+
const_param.def_id,
1783+
UserArgs {
1784+
args: self.universal_regions.defining_ty.args(),
1785+
user_self_ty: None,
1786+
},
1787+
)),
1788+
locations.span(self.body),
1789+
);
17761790
}
17771791

17781792
if let ty::FnDef(def_id, args) = *constant.const_.ty().kind() {

compiler/rustc_borrowck/src/type_check/opaque_types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ use std::iter;
22

33
use rustc_data_structures::fx::FxIndexMap;
44
use rustc_middle::span_bug;
5-
use rustc_middle::ty::fold::fold_regions;
65
use rustc_middle::ty::{
76
self, GenericArgKind, OpaqueHiddenType, OpaqueTypeKey, Ty, TyCtxt, TypeSuperVisitable,
8-
TypeVisitable, TypeVisitableExt, TypeVisitor,
7+
TypeVisitable, TypeVisitableExt, TypeVisitor, fold_regions,
98
};
109
use tracing::{debug, trace};
1110

compiler/rustc_borrowck/src/type_check/relate_tys.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ use rustc_middle::mir::ConstraintCategory;
1010
use rustc_middle::span_bug;
1111
use rustc_middle::traits::ObligationCause;
1212
use rustc_middle::traits::query::NoSolution;
13-
use rustc_middle::ty::fold::FnMutDelegate;
1413
use rustc_middle::ty::relate::combine::{super_combine_consts, super_combine_tys};
15-
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
14+
use rustc_middle::ty::{self, FnMutDelegate, Ty, TyCtxt, TypeVisitableExt};
1615
use rustc_span::{Span, Symbol, sym};
1716
use tracing::{debug, instrument};
1817

compiler/rustc_borrowck/src/universal_regions.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ use rustc_hir::lang_items::LangItem;
2727
use rustc_index::IndexVec;
2828
use rustc_infer::infer::NllRegionVariableOrigin;
2929
use rustc_macros::extension;
30-
use rustc_middle::ty::fold::{TypeFoldable, fold_regions};
3130
use rustc_middle::ty::print::with_no_trimmed_paths;
3231
use rustc_middle::ty::{
3332
self, GenericArgs, GenericArgsRef, InlineConstArgs, InlineConstArgsParts, RegionVid, Ty,
34-
TyCtxt, TypeVisitableExt,
33+
TyCtxt, TypeFoldable, TypeVisitableExt, fold_regions,
3534
};
3635
use rustc_middle::{bug, span_bug};
3736
use rustc_span::{ErrorGuaranteed, kw, sym};
@@ -184,6 +183,20 @@ impl<'tcx> DefiningTy<'tcx> {
184183
| DefiningTy::GlobalAsm(def_id) => def_id,
185184
}
186185
}
186+
187+
/// Returns the args of the `DefiningTy`. These are equivalent to the identity
188+
/// substs of the body, but replaced with region vids.
189+
pub(crate) fn args(&self) -> ty::GenericArgsRef<'tcx> {
190+
match *self {
191+
DefiningTy::Closure(_, args)
192+
| DefiningTy::Coroutine(_, args)
193+
| DefiningTy::CoroutineClosure(_, args)
194+
| DefiningTy::FnDef(_, args)
195+
| DefiningTy::Const(_, args)
196+
| DefiningTy::InlineConst(_, args) => args,
197+
DefiningTy::GlobalAsm(_) => ty::List::empty(),
198+
}
199+
}
187200
}
188201

189202
#[derive(Debug)]

compiler/rustc_codegen_ssa/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ rustc_span = { path = "../rustc_span" }
4040
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
4141
rustc_target = { path = "../rustc_target" }
4242
rustc_trait_selection = { path = "../rustc_trait_selection" }
43-
rustc_type_ir = { path = "../rustc_type_ir" }
4443
serde_json = "1.0.59"
4544
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
4645
tempfile = "3.2"

0 commit comments

Comments
 (0)