Skip to content

Commit b7b0197

Browse files
committed
Auto merge of #154588 - JonathanBrouwer:rollup-BYI2Oee, r=<try>
Rollup of 5 pull requests try-job: dist-x86_64-linux
2 parents cf7da0b + 978bb83 commit b7b0197

File tree

86 files changed

+1193
-586
lines changed

Some content is hidden

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

86 files changed

+1193
-586
lines changed

‎Cargo.lock‎

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,14 +3421,14 @@ dependencies = [
34213421

34223422
[[package]]
34233423
name = "rustc-build-sysroot"
3424-
version = "0.5.11"
3424+
version = "0.5.12"
34253425
source = "registry+https://github.com/rust-lang/crates.io-index"
3426-
checksum = "3b881c015c729b43105bbd3702a9bdecee28fafaa21126d1d62e454ec011a4b7"
3426+
checksum = "eec3905e8201688412f6f4b1f6c86d38b3ee6578f59ba85f41330a3af61e8365"
34273427
dependencies = [
34283428
"anyhow",
34293429
"rustc_version",
34303430
"tempfile",
3431-
"toml 0.8.23",
3431+
"toml 1.1.0+spec-1.1.0",
34323432
"walkdir",
34333433
]
34343434

@@ -5195,9 +5195,9 @@ dependencies = [
51955195

51965196
[[package]]
51975197
name = "serde_spanned"
5198-
version = "1.0.3"
5198+
version = "1.1.0"
51995199
source = "registry+https://github.com/rust-lang/crates.io-index"
5200-
checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392"
5200+
checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98"
52015201
dependencies = [
52025202
"serde_core",
52035203
]
@@ -5693,7 +5693,6 @@ version = "0.8.23"
56935693
source = "registry+https://github.com/rust-lang/crates.io-index"
56945694
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
56955695
dependencies = [
5696-
"indexmap",
56975696
"serde",
56985697
"serde_spanned 0.6.9",
56995698
"toml_datetime 0.6.11",
@@ -5708,13 +5707,28 @@ checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"
57085707
dependencies = [
57095708
"indexmap",
57105709
"serde_core",
5711-
"serde_spanned 1.0.3",
5710+
"serde_spanned 1.1.0",
57125711
"toml_datetime 0.7.3",
57135712
"toml_parser",
57145713
"toml_writer",
57155714
"winnow 0.7.13",
57165715
]
57175716

5717+
[[package]]
5718+
name = "toml"
5719+
version = "1.1.0+spec-1.1.0"
5720+
source = "registry+https://github.com/rust-lang/crates.io-index"
5721+
checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc"
5722+
dependencies = [
5723+
"indexmap",
5724+
"serde_core",
5725+
"serde_spanned 1.1.0",
5726+
"toml_datetime 1.1.0+spec-1.1.0",
5727+
"toml_parser",
5728+
"toml_writer",
5729+
"winnow 1.0.0",
5730+
]
5731+
57185732
[[package]]
57195733
name = "toml_datetime"
57205734
version = "0.6.11"
@@ -5733,6 +5747,15 @@ dependencies = [
57335747
"serde_core",
57345748
]
57355749

5750+
[[package]]
5751+
name = "toml_datetime"
5752+
version = "1.1.0+spec-1.1.0"
5753+
source = "registry+https://github.com/rust-lang/crates.io-index"
5754+
checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f"
5755+
dependencies = [
5756+
"serde_core",
5757+
]
5758+
57365759
[[package]]
57375760
name = "toml_edit"
57385761
version = "0.19.15"
@@ -5762,11 +5785,11 @@ dependencies = [
57625785

57635786
[[package]]
57645787
name = "toml_parser"
5765-
version = "1.0.4"
5788+
version = "1.1.0+spec-1.1.0"
57665789
source = "registry+https://github.com/rust-lang/crates.io-index"
5767-
checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e"
5790+
checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011"
57685791
dependencies = [
5769-
"winnow 0.7.13",
5792+
"winnow 1.0.0",
57705793
]
57715794

57725795
[[package]]
@@ -5777,9 +5800,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
57775800

57785801
[[package]]
57795802
name = "toml_writer"
5780-
version = "1.0.4"
5803+
version = "1.1.0+spec-1.1.0"
57815804
source = "registry+https://github.com/rust-lang/crates.io-index"
5782-
checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
5805+
checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed"
57835806

57845807
[[package]]
57855808
name = "tracing"
@@ -6765,6 +6788,12 @@ dependencies = [
67656788
"memchr",
67666789
]
67676790

6791+
[[package]]
6792+
name = "winnow"
6793+
version = "1.0.0"
6794+
source = "registry+https://github.com/rust-lang/crates.io-index"
6795+
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
6796+
67686797
[[package]]
67696798
name = "winsplit"
67706799
version = "0.1.0"

‎compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub(super) struct Canonicalizer<'a, D: SolverDelegate<Interner = I>, I: Interner
7878

7979
/// We can simply cache based on the ty itself, because we use
8080
/// `ty::BoundVarIndexKind::Canonical`.
81-
cache: HashMap<I::Ty, I::Ty>,
81+
cache: HashMap<ty::Ty<I>, ty::Ty<I>>,
8282
}
8383

8484
impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
@@ -316,7 +316,7 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
316316
(max_universe, self.variables, var_kinds)
317317
}
318318

319-
fn inner_fold_ty(&mut self, t: I::Ty) -> I::Ty {
319+
fn inner_fold_ty(&mut self, t: ty::Ty<I>) -> ty::Ty<I> {
320320
let kind = match t.kind() {
321321
ty::Infer(i) => match i {
322322
ty::TyVar(vid) => {
@@ -475,7 +475,7 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for Canonicaliz
475475
Region::new_canonical_bound(self.cx(), var)
476476
}
477477

478-
fn fold_ty(&mut self, t: I::Ty) -> I::Ty {
478+
fn fold_ty(&mut self, t: ty::Ty<I>) -> ty::Ty<I> {
479479
if !t.flags().intersects(NEEDS_CANONICAL) {
480480
t
481481
} else if let Some(&ty) = self.cache.get(&t) {

‎compiler/rustc_next_trait_solver/src/canonical/mod.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_index::IndexVec;
1616
use rustc_type_ir::inherent::*;
1717
use rustc_type_ir::relate::solver_relating::RelateExt;
1818
use rustc_type_ir::{
19-
self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, InferCtxtLike, Interner,
19+
self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, InferCtxtLike, Interner, Ty,
2020
TypeFoldable,
2121
};
2222
use tracing::instrument;
@@ -53,7 +53,7 @@ impl<I: Interner, T> ResponseT<I> for inspect::State<I, T> {
5353
pub(super) fn canonicalize_goal<D, I>(
5454
delegate: &D,
5555
goal: Goal<I, I::Predicate>,
56-
opaque_types: &[(ty::OpaqueTypeKey<I>, I::Ty)],
56+
opaque_types: &[(ty::OpaqueTypeKey<I>, Ty<I>)],
5757
) -> (Vec<I::GenericArg>, CanonicalInput<I, I::Predicate>)
5858
where
5959
D: SolverDelegate<Interner = I>,
@@ -264,7 +264,7 @@ fn register_region_constraints<D, I>(
264264

265265
fn register_new_opaque_types<D, I>(
266266
delegate: &D,
267-
opaque_types: &[(ty::OpaqueTypeKey<I>, I::Ty)],
267+
opaque_types: &[(ty::OpaqueTypeKey<I>, Ty<I>)],
268268
span: I::Span,
269269
) where
270270
D: SolverDelegate<Interner = I>,

‎compiler/rustc_next_trait_solver/src/coherence.rs‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub enum Conflict {
4747
pub fn trait_ref_is_knowable<Infcx, I, E>(
4848
infcx: &Infcx,
4949
trait_ref: ty::TraitRef<I>,
50-
mut lazily_normalize_ty: impl FnMut(I::Ty) -> Result<I::Ty, E>,
50+
mut lazily_normalize_ty: impl FnMut(ty::Ty<I>) -> Result<ty::Ty<I>, E>,
5151
) -> Result<Result<(), Conflict>, E>
5252
where
5353
Infcx: InferCtxtLike<Interner = I>,
@@ -115,14 +115,14 @@ impl From<bool> for IsFirstInputType {
115115

116116
#[derive_where(Debug; I: Interner, T: Debug)]
117117
pub enum OrphanCheckErr<I: Interner, T> {
118-
NonLocalInputType(Vec<(I::Ty, IsFirstInputType)>),
118+
NonLocalInputType(Vec<(ty::Ty<I>, IsFirstInputType)>),
119119
UncoveredTyParams(UncoveredTyParams<I, T>),
120120
}
121121

122122
#[derive_where(Debug; I: Interner, T: Debug)]
123123
pub struct UncoveredTyParams<I: Interner, T> {
124124
pub uncovered: T,
125-
pub local_ty: Option<I::Ty>,
125+
pub local_ty: Option<ty::Ty<I>>,
126126
}
127127

128128
/// Checks whether a trait-ref is potentially implementable by a crate.
@@ -222,8 +222,8 @@ pub fn orphan_check_trait_ref<Infcx, I, E: Debug>(
222222
infcx: &Infcx,
223223
trait_ref: ty::TraitRef<I>,
224224
in_crate: InCrate,
225-
lazily_normalize_ty: impl FnMut(I::Ty) -> Result<I::Ty, E>,
226-
) -> Result<Result<(), OrphanCheckErr<I, I::Ty>>, E>
225+
lazily_normalize_ty: impl FnMut(ty::Ty<I>) -> Result<ty::Ty<I>, E>,
226+
) -> Result<Result<(), OrphanCheckErr<I, ty::Ty<I>>>, E>
227227
where
228228
Infcx: InferCtxtLike<Interner = I>,
229229
I: Interner,
@@ -262,14 +262,14 @@ struct OrphanChecker<'a, Infcx, I: Interner, F> {
262262
lazily_normalize_ty: F,
263263
/// Ignore orphan check failures and exclusively search for the first local type.
264264
search_first_local_ty: bool,
265-
non_local_tys: Vec<(I::Ty, IsFirstInputType)>,
265+
non_local_tys: Vec<(ty::Ty<I>, IsFirstInputType)>,
266266
}
267267

268268
impl<'a, Infcx, I, F, E> OrphanChecker<'a, Infcx, I, F>
269269
where
270270
Infcx: InferCtxtLike<Interner = I>,
271271
I: Interner,
272-
F: FnOnce(I::Ty) -> Result<I::Ty, E>,
272+
F: FnOnce(ty::Ty<I>) -> Result<ty::Ty<I>, E>,
273273
{
274274
fn new(infcx: &'a Infcx, in_crate: InCrate, lazily_normalize_ty: F) -> Self {
275275
OrphanChecker {
@@ -282,12 +282,15 @@ where
282282
}
283283
}
284284

285-
fn found_non_local_ty(&mut self, t: I::Ty) -> ControlFlow<OrphanCheckEarlyExit<I, E>> {
285+
fn found_non_local_ty(&mut self, t: ty::Ty<I>) -> ControlFlow<OrphanCheckEarlyExit<I, E>> {
286286
self.non_local_tys.push((t, self.in_self_ty.into()));
287287
ControlFlow::Continue(())
288288
}
289289

290-
fn found_uncovered_ty_param(&mut self, ty: I::Ty) -> ControlFlow<OrphanCheckEarlyExit<I, E>> {
290+
fn found_uncovered_ty_param(
291+
&mut self,
292+
ty: ty::Ty<I>,
293+
) -> ControlFlow<OrphanCheckEarlyExit<I, E>> {
291294
if self.search_first_local_ty {
292295
return ControlFlow::Continue(());
293296
}
@@ -305,23 +308,23 @@ where
305308

306309
enum OrphanCheckEarlyExit<I: Interner, E> {
307310
NormalizationFailure(E),
308-
UncoveredTyParam(I::Ty),
309-
LocalTy(I::Ty),
311+
UncoveredTyParam(ty::Ty<I>),
312+
LocalTy(ty::Ty<I>),
310313
}
311314

312315
impl<'a, Infcx, I, F, E> TypeVisitor<I> for OrphanChecker<'a, Infcx, I, F>
313316
where
314317
Infcx: InferCtxtLike<Interner = I>,
315318
I: Interner,
316-
F: FnMut(I::Ty) -> Result<I::Ty, E>,
319+
F: FnMut(ty::Ty<I>) -> Result<ty::Ty<I>, E>,
317320
{
318321
type Result = ControlFlow<OrphanCheckEarlyExit<I, E>>;
319322

320323
fn visit_region(&mut self, _r: I::Region) -> Self::Result {
321324
ControlFlow::Continue(())
322325
}
323326

324-
fn visit_ty(&mut self, ty: I::Ty) -> Self::Result {
327+
fn visit_ty(&mut self, ty: ty::Ty<I>) -> Self::Result {
325328
let ty = self.infcx.shallow_resolve(ty);
326329
let ty = match (self.lazily_normalize_ty)(ty) {
327330
Ok(norm_ty) if norm_ty.is_ty_var() => ty,

‎compiler/rustc_next_trait_solver/src/delegate.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ops::Deref;
22

33
use rustc_type_ir::solve::{Certainty, Goal, NoSolution};
4-
use rustc_type_ir::{self as ty, InferCtxtLike, Interner, TypeFoldable};
4+
use rustc_type_ir::{self as ty, InferCtxtLike, Interner, Ty, TypeFoldable};
55

66
pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
77
type Infcx: InferCtxtLike<Interner = Self::Interner>;
@@ -70,7 +70,7 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
7070
def_id: <Self::Interner as Interner>::DefId,
7171
args: <Self::Interner as Interner>::GenericArgs,
7272
param_env: <Self::Interner as Interner>::ParamEnv,
73-
hidden_ty: <Self::Interner as Interner>::Ty,
73+
hidden_ty: Ty<Self::Interner>,
7474
goals: &mut Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>,
7575
);
7676

@@ -86,8 +86,8 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
8686

8787
fn is_transmutable(
8888
&self,
89-
src: <Self::Interner as Interner>::Ty,
90-
dst: <Self::Interner as Interner>::Ty,
89+
src: Ty<Self::Interner>,
90+
dst: Ty<Self::Interner>,
9191
assume: <Self::Interner as Interner>::Const,
9292
) -> Result<Certainty, NoSolution>;
9393
}

‎compiler/rustc_next_trait_solver/src/placeholder.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ where
113113
}
114114
}
115115

116-
fn fold_ty(&mut self, t: I::Ty) -> I::Ty {
116+
fn fold_ty(&mut self, t: ty::Ty<I>) -> ty::Ty<I> {
117117
match t.kind() {
118118
ty::Bound(ty::BoundVarIndexKind::Bound(debruijn), _)
119119
if debruijn.as_usize() + 1

‎compiler/rustc_next_trait_solver/src/resolve.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_type_ir::data_structures::DelayedMap;
22
use rustc_type_ir::inherent::*;
33
use rustc_type_ir::{
4-
self as ty, InferCtxtLike, Interner, TypeFoldable, TypeFolder, TypeSuperFoldable,
4+
self as ty, InferCtxtLike, Interner, Ty, TypeFoldable, TypeFolder, TypeSuperFoldable,
55
TypeVisitableExt,
66
};
77

@@ -19,7 +19,7 @@ where
1919
delegate: &'a D,
2020
/// We're able to use a cache here as the folder does not have any
2121
/// mutable state.
22-
cache: DelayedMap<I::Ty, I::Ty>,
22+
cache: DelayedMap<Ty<I>, Ty<I>>,
2323
}
2424

2525
pub fn eager_resolve_vars<D: SolverDelegate, T: TypeFoldable<D::Interner>>(
@@ -45,7 +45,7 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for EagerResolv
4545
self.delegate.cx()
4646
}
4747

48-
fn fold_ty(&mut self, t: I::Ty) -> I::Ty {
48+
fn fold_ty(&mut self, t: Ty<I>) -> Ty<I> {
4949
match t.kind() {
5050
ty::Infer(ty::TyVar(vid)) => {
5151
let resolved = self.delegate.opportunistic_resolve_ty_var(vid);

‎compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ where
4646
D: SolverDelegate<Interner = I>,
4747
I: Interner,
4848
{
49-
fn self_ty(self) -> I::Ty;
49+
fn self_ty(self) -> ty::Ty<I>;
5050

5151
fn trait_ref(self, cx: I) -> ty::TraitRef<I>;
5252

53-
fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self;
53+
fn with_replaced_self_ty(self, cx: I, self_ty: ty::Ty<I>) -> Self;
5454

5555
fn trait_def_id(self, cx: I) -> I::TraitId;
5656

@@ -683,7 +683,7 @@ where
683683
// hitting another overflow error something. Add a depth parameter needed later.
684684
fn assemble_alias_bound_candidates_recur<G: GoalKind<D>>(
685685
&mut self,
686-
self_ty: I::Ty,
686+
self_ty: ty::Ty<I>,
687687
goal: Goal<I, G>,
688688
candidates: &mut Vec<Candidate<I>>,
689689
consider_self_bounds: AliasBoundKind,
@@ -1017,13 +1017,13 @@ where
10171017
struct ReplaceOpaque<I: Interner> {
10181018
cx: I,
10191019
alias_ty: ty::AliasTy<I>,
1020-
self_ty: I::Ty,
1020+
self_ty: ty::Ty<I>,
10211021
}
10221022
impl<I: Interner> TypeFolder<I> for ReplaceOpaque<I> {
10231023
fn cx(&self) -> I {
10241024
self.cx
10251025
}
1026-
fn fold_ty(&mut self, ty: I::Ty) -> I::Ty {
1026+
fn fold_ty(&mut self, ty: ty::Ty<I>) -> ty::Ty<I> {
10271027
if let ty::Alias(ty::Opaque, alias_ty) = ty.kind() {
10281028
if alias_ty == self.alias_ty {
10291029
return self.self_ty;
@@ -1280,7 +1280,7 @@ where
12801280
ControlFlow::Continue(())
12811281
}
12821282

1283-
fn visit_ty(&mut self, ty: I::Ty) -> Self::Result {
1283+
fn visit_ty(&mut self, ty: ty::Ty<I>) -> Self::Result {
12841284
let ty = self.ecx.replace_bound_vars(ty, &mut self.universes);
12851285
let Ok(ty) = self.ecx.structurally_normalize_ty(self.param_env, ty) else {
12861286
return ControlFlow::Break(Err(NoSolution));

0 commit comments

Comments
 (0)