Skip to content

Commit a0622d6

Browse files
committed
Update Chalk
1 parent 4b64bc1 commit a0622d6

File tree

18 files changed

+51
-72
lines changed

18 files changed

+51
-72
lines changed

Cargo.lock

+12-8
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
496496

497497
[[package]]
498498
name = "chalk-derive"
499-
version = "0.47.0-dev.0"
500-
source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
499+
version = "0.55.0"
500+
source = "registry+https://github.com/rust-lang/crates.io-index"
501+
checksum = "3983193cacd81f0f924acb666b7fe5e1a0d81db9f113fa69203eda7ea8ce8b6c"
501502
dependencies = [
502503
"proc-macro2",
503504
"quote",
@@ -507,8 +508,9 @@ dependencies = [
507508

508509
[[package]]
509510
name = "chalk-engine"
510-
version = "0.47.0-dev.0"
511-
source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
511+
version = "0.55.0"
512+
source = "registry+https://github.com/rust-lang/crates.io-index"
513+
checksum = "05a171ce5abbf0fbd06f221ab80ab182c7ef78603d23b858bc44e7ce8a86a396"
512514
dependencies = [
513515
"chalk-derive",
514516
"chalk-ir",
@@ -519,8 +521,9 @@ dependencies = [
519521

520522
[[package]]
521523
name = "chalk-ir"
522-
version = "0.47.0-dev.0"
523-
source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
524+
version = "0.55.0"
525+
source = "registry+https://github.com/rust-lang/crates.io-index"
526+
checksum = "a522f53af971e7678f472d687e053120157b3ae26e2ebd5ecbc0f5ab124f2cb6"
524527
dependencies = [
525528
"bitflags",
526529
"chalk-derive",
@@ -529,8 +532,9 @@ dependencies = [
529532

530533
[[package]]
531534
name = "chalk-solve"
532-
version = "0.47.0-dev.0"
533-
source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
535+
version = "0.55.0"
536+
source = "registry+https://github.com/rust-lang/crates.io-index"
537+
checksum = "cdf79fb77a567e456a170f7ec84ea6584163d4ba3f13660cd182013d34ca667c"
534538
dependencies = [
535539
"chalk-derive",
536540
"chalk-ir",

compiler/rustc_middle/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ rustc_index = { path = "../rustc_index" }
2626
rustc_serialize = { path = "../rustc_serialize" }
2727
rustc_ast = { path = "../rustc_ast" }
2828
rustc_span = { path = "../rustc_span" }
29-
#chalk-ir = {"0.46.0"}
30-
chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
29+
chalk-ir = "0.55.0"
3130
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
3231
measureme = "9.0.0"
3332
rustc_session = { path = "../rustc_session" }

compiler/rustc_middle/src/traits/chalk.rs

+21-4
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,34 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
8787
write!(fmt, "{:?}", pci.consequence)?;
8888

8989
let conditions = pci.conditions.interned();
90+
let constraints = pci.constraints.interned();
9091

9192
let conds = conditions.len();
92-
if conds == 0 {
93+
let consts = constraints.len();
94+
if conds == 0 && consts == 0 {
9395
return Ok(());
9496
}
9597

9698
write!(fmt, " :- ")?;
97-
for cond in &conditions[..conds - 1] {
98-
write!(fmt, "{:?}, ", cond)?;
99+
100+
if conds != 0 {
101+
for cond in &conditions[..conds - 1] {
102+
write!(fmt, "{:?}, ", cond)?;
103+
}
104+
write!(fmt, "{:?}", conditions[conds - 1])?;
105+
}
106+
107+
if conds != 0 && consts != 0 {
108+
write!(fmt, " ; ")?;
99109
}
100-
write!(fmt, "{:?}", conditions[conds - 1])?;
110+
111+
if consts != 0 {
112+
for constraint in &constraints[..consts - 1] {
113+
write!(fmt, "{:?}, ", constraint)?;
114+
}
115+
write!(fmt, "{:?}", constraints[consts - 1])?;
116+
}
117+
101118
Ok(())
102119
};
103120
Some(write())

compiler/rustc_traits/Cargo.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ rustc_hir = { path = "../rustc_hir" }
1313
rustc_index = { path = "../rustc_index" }
1414
rustc_ast = { path = "../rustc_ast" }
1515
rustc_span = { path = "../rustc_span" }
16-
#chalk-ir = "0.46.0"
17-
chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
18-
#chalk-solve = "0.46.0"
19-
chalk-solve = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
20-
#chalk-engine = "0.46.0"
21-
chalk-engine = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
16+
chalk-ir = "0.55.0"
17+
chalk-solve = "0.55.0"
18+
chalk-engine = "0.55.0"
2219
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2320
rustc_infer = { path = "../rustc_infer" }
2421
rustc_trait_selection = { path = "../rustc_trait_selection" }

compiler/rustc_traits/src/chalk/db.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ impl<'tcx> chalk_ir::UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<
690690
def_id: chalk_ir::FnDefId<RustInterner<'tcx>>,
691691
) -> chalk_ir::Variances<RustInterner<'tcx>> {
692692
let variances = self.interner.tcx.variances_of(def_id.0);
693-
chalk_ir::Variances::from(
693+
chalk_ir::Variances::from_iter(
694694
&self.interner,
695695
variances.iter().map(|v| match v {
696696
ty::Variance::Invariant => chalk_ir::Variance::Invariant,
@@ -706,7 +706,7 @@ impl<'tcx> chalk_ir::UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<
706706
def_id: chalk_ir::AdtId<RustInterner<'tcx>>,
707707
) -> chalk_ir::Variances<RustInterner<'tcx>> {
708708
let variances = self.interner.tcx.variances_of(def_id.0.did);
709-
chalk_ir::Variances::from(
709+
chalk_ir::Variances::from_iter(
710710
&self.interner,
711711
variances.iter().map(|v| match v {
712712
ty::Variance::Invariant => chalk_ir::Variance::Invariant,

compiler/rustc_traits/src/chalk/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ crate fn evaluate_goal<'tcx>(
9797
use chalk_solve::Solver;
9898
let mut solver = chalk_engine::solve::SLGSolver::new(32, None);
9999
let db = ChalkRustIrDatabase { interner, reempty_placeholder };
100-
//dbg!("evaluate_goal_pre", &obligation, &lowered_goal);
101100
let solution = solver.solve(&db, &lowered_goal);
102101
debug!(?obligation, ?solution, "evaluate goal");
103102

src/doc/book

Submodule book updated 59 files

src/doc/embedded-book

src/llvm-project

Submodule llvm-project updated 190 files

src/test/ui/associated-type-bounds/atb.rs

-37
This file was deleted.

src/tools/cargo

Submodule cargo updated 165 files

src/tools/rustfmt

Submodule rustfmt updated 63 files

src/tools/tidy/src/extdeps.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crat
88

99
/// Checks for external package sources. `root` is the path to the directory that contains the
1010
/// workspace `Cargo.toml`.
11-
pub fn check(root: &Path, _bad: &mut bool) {
11+
pub fn check(root: &Path, bad: &mut bool) {
1212
// `Cargo.lock` of rust.
1313
let path = root.join("Cargo.lock");
1414

@@ -27,7 +27,7 @@ pub fn check(root: &Path, _bad: &mut bool) {
2727

2828
// Ensure source is allowed.
2929
if !ALLOWED_SOURCES.contains(&&*source) {
30-
//tidy_error!(bad, "invalid source: {}", source);
30+
tidy_error!(bad, "invalid source: {}", source);
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)