Skip to content

Commit 6ba003e

Browse files
committed
Update chalk
1 parent 045dfc0 commit 6ba003e

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
@@ -426,10 +426,18 @@ dependencies = [
426426
"rustc-std-workspace-core",
427427
]
428428

429+
[[package]]
430+
name = "chalk-base"
431+
version = "0.10.1-dev"
432+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
433+
dependencies = [
434+
"lazy_static 1.4.0",
435+
]
436+
429437
[[package]]
430438
name = "chalk-derive"
431439
version = "0.10.1-dev"
432-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
440+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
433441
dependencies = [
434442
"proc-macro2 1.0.3",
435443
"quote 1.0.2",
@@ -440,52 +448,33 @@ dependencies = [
440448
[[package]]
441449
name = "chalk-engine"
442450
version = "0.10.1-dev"
443-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
451+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
444452
dependencies = [
445-
"chalk-macros",
453+
"chalk-base",
454+
"chalk-derive",
455+
"chalk-ir",
446456
"rustc-hash",
447457
]
448458

449459
[[package]]
450460
name = "chalk-ir"
451461
version = "0.10.1-dev"
452-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
453-
dependencies = [
454-
"chalk-derive",
455-
"chalk-engine",
456-
"chalk-macros",
457-
]
458-
459-
[[package]]
460-
name = "chalk-macros"
461-
version = "0.10.1-dev"
462-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
463-
dependencies = [
464-
"lazy_static",
465-
]
466-
467-
[[package]]
468-
name = "chalk-rust-ir"
469-
version = "0.10.1-dev"
470-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
462+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
471463
dependencies = [
464+
"chalk-base",
472465
"chalk-derive",
473-
"chalk-engine",
474-
"chalk-ir",
475-
"chalk-macros",
476466
]
477467

478468
[[package]]
479469
name = "chalk-solve"
480470
version = "0.10.1-dev"
481-
source = "git+https://github.com/rust-lang/chalk.git?rev=3e9c2503ae9c5277c2acb74624dc267876dd89b3#3e9c2503ae9c5277c2acb74624dc267876dd89b3"
471+
source = "git+https://github.com/rust-lang/chalk.git?rev=f4977ab4c781e4f3b7fdb9310edbdab6daf56e29#f4977ab4c781e4f3b7fdb9310edbdab6daf56e29"
482472
dependencies = [
473+
"chalk-base",
483474
"chalk-derive",
484475
"chalk-engine",
485476
"chalk-ir",
486-
"chalk-macros",
487-
"chalk-rust-ir",
488-
"ena 0.13.1",
477+
"ena 0.14.0",
489478
"itertools 0.9.0",
490479
"petgraph",
491480
"rustc-hash",
@@ -1169,9 +1158,9 @@ dependencies = [
11691158

11701159
[[package]]
11711160
name = "fixedbitset"
1172-
version = "0.1.9"
1161+
version = "0.2.0"
11731162
source = "registry+https://github.com/rust-lang/crates.io-index"
1174-
checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
1163+
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
11751164

11761165
[[package]]
11771166
name = "flate2"
@@ -2358,12 +2347,6 @@ dependencies = [
23582347
"vcpkg",
23592348
]
23602349

2361-
[[package]]
2362-
name = "ordermap"
2363-
version = "0.3.5"
2364-
source = "registry+https://github.com/rust-lang/crates.io-index"
2365-
checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
2366-
23672350
[[package]]
23682351
name = "ordslice"
23692352
version = "0.3.0"
@@ -2534,12 +2517,12 @@ dependencies = [
25342517

25352518
[[package]]
25362519
name = "petgraph"
2537-
version = "0.4.13"
2520+
version = "0.5.1"
25382521
source = "registry+https://github.com/rust-lang/crates.io-index"
2539-
checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
2522+
checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
25402523
dependencies = [
25412524
"fixedbitset",
2542-
"ordermap",
2525+
"indexmap",
25432526
]
25442527

25452528
[[package]]
@@ -3487,12 +3470,9 @@ dependencies = [
34873470

34883471
[[package]]
34893472
name = "rustc-hash"
3490-
version = "1.0.1"
3473+
version = "1.1.0"
34913474
source = "registry+https://github.com/rust-lang/crates.io-index"
3492-
checksum = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
3493-
dependencies = [
3494-
"byteorder",
3495-
]
3475+
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
34963476

34973477
[[package]]
34983478
name = "rustc-main"
@@ -4361,7 +4341,6 @@ name = "rustc_traits"
43614341
version = "0.0.0"
43624342
dependencies = [
43634343
"chalk-ir",
4364-
"chalk-rust-ir",
43654344
"chalk-solve",
43664345
"log",
43674346
"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)