Skip to content

Commit 6aa2e9d

Browse files
committed
Update chalk
1 parent 16dd584 commit 6aa2e9d

File tree

8 files changed

+219
-193
lines changed

8 files changed

+219
-193
lines changed

Cargo.lock

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,18 @@ dependencies = [
432432
"rustc-std-workspace-core",
433433
]
434434

435+
[[package]]
436+
name = "chalk-base"
437+
version = "0.10.1-dev"
438+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
439+
dependencies = [
440+
"lazy_static 1.4.0",
441+
]
442+
435443
[[package]]
436444
name = "chalk-derive"
437445
version = "0.10.1-dev"
438-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
446+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
439447
dependencies = [
440448
"proc-macro2 1.0.3",
441449
"quote 1.0.2",
@@ -446,52 +454,33 @@ dependencies = [
446454
[[package]]
447455
name = "chalk-engine"
448456
version = "0.10.1-dev"
449-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
457+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
450458
dependencies = [
451-
"chalk-macros",
459+
"chalk-base",
460+
"chalk-derive",
461+
"chalk-ir",
452462
"rustc-hash",
453463
]
454464

455465
[[package]]
456466
name = "chalk-ir"
457467
version = "0.10.1-dev"
458-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
459-
dependencies = [
460-
"chalk-derive",
461-
"chalk-engine",
462-
"chalk-macros",
463-
]
464-
465-
[[package]]
466-
name = "chalk-macros"
467-
version = "0.10.1-dev"
468-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
469-
dependencies = [
470-
"lazy_static",
471-
]
472-
473-
[[package]]
474-
name = "chalk-rust-ir"
475-
version = "0.10.1-dev"
476-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
468+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
477469
dependencies = [
470+
"chalk-base",
478471
"chalk-derive",
479-
"chalk-engine",
480-
"chalk-ir",
481-
"chalk-macros",
482472
]
483473

484474
[[package]]
485475
name = "chalk-solve"
486476
version = "0.10.1-dev"
487-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
477+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
488478
dependencies = [
479+
"chalk-base",
489480
"chalk-derive",
490481
"chalk-engine",
491482
"chalk-ir",
492-
"chalk-macros",
493-
"chalk-rust-ir",
494-
"ena 0.13.1",
483+
"ena 0.14.0",
495484
"itertools 0.9.0",
496485
"petgraph",
497486
"rustc-hash",
@@ -1175,9 +1164,9 @@ dependencies = [
11751164

11761165
[[package]]
11771166
name = "fixedbitset"
1178-
version = "0.1.9"
1167+
version = "0.2.0"
11791168
source = "registry+https://github.com/rust-lang/crates.io-index"
1180-
checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
1169+
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
11811170

11821171
[[package]]
11831172
name = "flate2"
@@ -2364,12 +2353,6 @@ dependencies = [
23642353
"vcpkg",
23652354
]
23662355

2367-
[[package]]
2368-
name = "ordermap"
2369-
version = "0.3.5"
2370-
source = "registry+https://github.com/rust-lang/crates.io-index"
2371-
checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
2372-
23732356
[[package]]
23742357
name = "ordslice"
23752358
version = "0.3.0"
@@ -2540,12 +2523,12 @@ dependencies = [
25402523

25412524
[[package]]
25422525
name = "petgraph"
2543-
version = "0.4.13"
2526+
version = "0.5.1"
25442527
source = "registry+https://github.com/rust-lang/crates.io-index"
2545-
checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
2528+
checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
25462529
dependencies = [
25472530
"fixedbitset",
2548-
"ordermap",
2531+
"indexmap",
25492532
]
25502533

25512534
[[package]]
@@ -3493,12 +3476,9 @@ dependencies = [
34933476

34943477
[[package]]
34953478
name = "rustc-hash"
3496-
version = "1.0.1"
3479+
version = "1.1.0"
34973480
source = "registry+https://github.com/rust-lang/crates.io-index"
3498-
checksum = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
3499-
dependencies = [
3500-
"byteorder",
3501-
]
3481+
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
35023482

35033483
[[package]]
35043484
name = "rustc-main"
@@ -4367,7 +4347,6 @@ name = "rustc_traits"
43674347
version = "0.0.0"
43684348
dependencies = [
43694349
"chalk-ir",
4370-
"chalk-rust-ir",
43714350
"chalk-solve",
43724351
"log",
43734352
"rustc_ast",

src/librustc_data_structures/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ crossbeam-utils = { version = "0.7", features = ["nightly"] }
2323
stable_deref_trait = "1.0.0"
2424
rayon = { version = "0.3.0", package = "rustc-rayon" }
2525
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
26-
rustc-hash = "1.0.1"
26+
rustc-hash = "1.1.0"
2727
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2828
rustc_index = { path = "../librustc_index", package = "rustc_index" }
2929
bitflags = "1.2.1"

src/librustc_middle/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc_serialize = { path = "../librustc_serialize" }
3030
rustc_ast = { path = "../librustc_ast" }
3131
rustc_span = { path = "../librustc_span" }
3232
byteorder = { version = "1.3" }
33-
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "3e9c2503ae9c5277c2acb74624dc267876dd89b3" }
33+
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "f4977ab4c781e4f3b7fdb9310edbdab6daf56e29" }
3434
#chalk-ir = "0.10.0"
3535
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
3636
measureme = "0.7.1"

src/librustc_middle/traits/chalk.rs

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! its name suggest, is to provide an abstraction boundary for creating
66
//! interned Chalk types.
77
8-
use chalk_ir::{GoalData, Parameter};
9-
108
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
119
use rustc_middle::ty::{self, Ty, TyCtxt};
1210

@@ -79,16 +77,19 @@ impl fmt::Debug for RustInterner<'_> {
7977
impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
8078
type InternedType = Box<chalk_ir::TyData<Self>>;
8179
type InternedLifetime = Box<chalk_ir::LifetimeData<Self>>;
82-
type InternedParameter = Box<chalk_ir::ParameterData<Self>>;
80+
type InternedConst = Box<chalk_ir::ConstData<Self>>;
81+
type InternedConcreteConst = u32;
82+
type InternedGenericArg = Box<chalk_ir::GenericArgData<Self>>;
8383
type InternedGoal = Box<chalk_ir::GoalData<Self>>;
8484
type InternedGoals = Vec<chalk_ir::Goal<Self>>;
85-
type InternedSubstitution = Vec<chalk_ir::Parameter<Self>>;
85+
type InternedSubstitution = Vec<chalk_ir::GenericArg<Self>>;
8686
type InternedProgramClause = Box<chalk_ir::ProgramClauseData<Self>>;
8787
type InternedProgramClauses = Vec<chalk_ir::ProgramClause<Self>>;
8888
type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>;
89-
type InternedParameterKinds = Vec<chalk_ir::ParameterKind<()>>;
90-
type InternedCanonicalVarKinds = Vec<chalk_ir::ParameterKind<chalk_ir::UniverseIndex>>;
89+
type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>;
90+
type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>;
9191
type DefId = RustDefId;
92+
type InternedAdtId = RustDefId;
9293
type Identifier = ();
9394

9495
fn debug_program_clause_implication(
@@ -202,25 +203,39 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
202203
&lifetime
203204
}
204205

205-
fn intern_parameter(
206+
fn intern_const(&self, constant: chalk_ir::ConstData<Self>) -> Self::InternedConst {
207+
Box::new(constant)
208+
}
209+
210+
fn const_data<'a>(&self, constant: &'a Self::InternedConst) -> &'a chalk_ir::ConstData<Self> {
211+
&constant
212+
}
213+
214+
fn const_eq(
206215
&self,
207-
parameter: chalk_ir::ParameterData<Self>,
208-
) -> Self::InternedParameter {
209-
Box::new(parameter)
216+
_ty: &Self::InternedType,
217+
c1: &Self::InternedConcreteConst,
218+
c2: &Self::InternedConcreteConst,
219+
) -> bool {
220+
c1 == c2
221+
}
222+
223+
fn intern_generic_arg(&self, data: chalk_ir::GenericArgData<Self>) -> Self::InternedGenericArg {
224+
Box::new(data)
210225
}
211226

212-
fn parameter_data<'a>(
227+
fn generic_arg_data<'a>(
213228
&self,
214-
parameter: &'a Self::InternedParameter,
215-
) -> &'a chalk_ir::ParameterData<Self> {
216-
&parameter
229+
data: &'a Self::InternedGenericArg,
230+
) -> &'a chalk_ir::GenericArgData<Self> {
231+
&data
217232
}
218233

219-
fn intern_goal(&self, goal: GoalData<Self>) -> Self::InternedGoal {
234+
fn intern_goal(&self, goal: chalk_ir::GoalData<Self>) -> Self::InternedGoal {
220235
Box::new(goal)
221236
}
222237

223-
fn goal_data<'a>(&self, goal: &'a Self::InternedGoal) -> &'a GoalData<Self> {
238+
fn goal_data<'a>(&self, goal: &'a Self::InternedGoal) -> &'a chalk_ir::GoalData<Self> {
224239
&goal
225240
}
226241

@@ -237,15 +252,15 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
237252

238253
fn intern_substitution<E>(
239254
&self,
240-
data: impl IntoIterator<Item = Result<chalk_ir::Parameter<Self>, E>>,
255+
data: impl IntoIterator<Item = Result<chalk_ir::GenericArg<Self>, E>>,
241256
) -> Result<Self::InternedSubstitution, E> {
242257
data.into_iter().collect::<Result<Vec<_>, _>>()
243258
}
244259

245260
fn substitution_data<'a>(
246261
&self,
247262
substitution: &'a Self::InternedSubstitution,
248-
) -> &'a [Parameter<Self>] {
263+
) -> &'a [chalk_ir::GenericArg<Self>] {
249264
substitution
250265
}
251266

@@ -291,31 +306,31 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
291306
clauses
292307
}
293308

294-
fn intern_parameter_kinds<E>(
309+
fn intern_generic_arg_kinds<E>(
295310
&self,
296-
data: impl IntoIterator<Item = Result<chalk_ir::ParameterKind<()>, E>>,
297-
) -> Result<Self::InternedParameterKinds, E> {
311+
data: impl IntoIterator<Item = Result<chalk_ir::VariableKind<Self>, E>>,
312+
) -> Result<Self::InternedVariableKinds, E> {
298313
data.into_iter().collect::<Result<Vec<_>, _>>()
299314
}
300315

301-
fn parameter_kinds_data<'a>(
316+
fn variable_kinds_data<'a>(
302317
&self,
303-
parameter_kinds: &'a Self::InternedParameterKinds,
304-
) -> &'a [chalk_ir::ParameterKind<()>] {
318+
parameter_kinds: &'a Self::InternedVariableKinds,
319+
) -> &'a [chalk_ir::VariableKind<Self>] {
305320
parameter_kinds
306321
}
307322

308323
fn intern_canonical_var_kinds<E>(
309324
&self,
310-
data: impl IntoIterator<Item = Result<chalk_ir::ParameterKind<chalk_ir::UniverseIndex>, E>>,
325+
data: impl IntoIterator<Item = Result<chalk_ir::CanonicalVarKind<Self>, E>>,
311326
) -> Result<Self::InternedCanonicalVarKinds, E> {
312327
data.into_iter().collect::<Result<Vec<_>, _>>()
313328
}
314329

315330
fn canonical_var_kinds_data<'a>(
316331
&self,
317332
canonical_var_kinds: &'a Self::InternedCanonicalVarKinds,
318-
) -> &'a [chalk_ir::ParameterKind<chalk_ir::UniverseIndex>] {
333+
) -> &'a [chalk_ir::CanonicalVarKind<Self>] {
319334
canonical_var_kinds
320335
}
321336
}

src/librustc_traits/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ rustc_span = { path = "../librustc_span" }
1919
#chalk-ir = "0.10.0"
2020
#chalk-rust-ir = "0.10.0"
2121
#chalk-solve = "0.10.0"
22-
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "3e9c2503ae9c5277c2acb74624dc267876dd89b3" }
23-
chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "3e9c2503ae9c5277c2acb74624dc267876dd89b3" }
24-
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "3e9c2503ae9c5277c2acb74624dc267876dd89b3" }
22+
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "f4977ab4c781e4f3b7fdb9310edbdab6daf56e29" }
23+
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "f4977ab4c781e4f3b7fdb9310edbdab6daf56e29" }
2524
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2625
rustc_infer = { path = "../librustc_infer" }
2726
rustc_trait_selection = { path = "../librustc_trait_selection" }

0 commit comments

Comments
 (0)