Update Chalk
This commit is contained in:
parent
4b64bc1fc9
commit
a0622d60e0
18 changed files with 51 additions and 72 deletions
|
@ -26,8 +26,7 @@ rustc_index = { path = "../rustc_index" }
|
|||
rustc_serialize = { path = "../rustc_serialize" }
|
||||
rustc_ast = { path = "../rustc_ast" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
#chalk-ir = {"0.46.0"}
|
||||
chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
|
||||
chalk-ir = "0.55.0"
|
||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||
measureme = "9.0.0"
|
||||
rustc_session = { path = "../rustc_session" }
|
||||
|
|
|
@ -87,17 +87,34 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
|
|||
write!(fmt, "{:?}", pci.consequence)?;
|
||||
|
||||
let conditions = pci.conditions.interned();
|
||||
let constraints = pci.constraints.interned();
|
||||
|
||||
let conds = conditions.len();
|
||||
if conds == 0 {
|
||||
let consts = constraints.len();
|
||||
if conds == 0 && consts == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
write!(fmt, " :- ")?;
|
||||
for cond in &conditions[..conds - 1] {
|
||||
write!(fmt, "{:?}, ", cond)?;
|
||||
|
||||
if conds != 0 {
|
||||
for cond in &conditions[..conds - 1] {
|
||||
write!(fmt, "{:?}, ", cond)?;
|
||||
}
|
||||
write!(fmt, "{:?}", conditions[conds - 1])?;
|
||||
}
|
||||
write!(fmt, "{:?}", conditions[conds - 1])?;
|
||||
|
||||
if conds != 0 && consts != 0 {
|
||||
write!(fmt, " ; ")?;
|
||||
}
|
||||
|
||||
if consts != 0 {
|
||||
for constraint in &constraints[..consts - 1] {
|
||||
write!(fmt, "{:?}, ", constraint)?;
|
||||
}
|
||||
write!(fmt, "{:?}", constraints[consts - 1])?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
};
|
||||
Some(write())
|
||||
|
|
|
@ -13,12 +13,9 @@ rustc_hir = { path = "../rustc_hir" }
|
|||
rustc_index = { path = "../rustc_index" }
|
||||
rustc_ast = { path = "../rustc_ast" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
#chalk-ir = "0.46.0"
|
||||
chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
|
||||
#chalk-solve = "0.46.0"
|
||||
chalk-solve = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
|
||||
#chalk-engine = "0.46.0"
|
||||
chalk-engine = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
|
||||
chalk-ir = "0.55.0"
|
||||
chalk-solve = "0.55.0"
|
||||
chalk-engine = "0.55.0"
|
||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||
rustc_infer = { path = "../rustc_infer" }
|
||||
rustc_trait_selection = { path = "../rustc_trait_selection" }
|
||||
|
|
|
@ -690,7 +690,7 @@ impl<'tcx> chalk_ir::UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<
|
|||
def_id: chalk_ir::FnDefId<RustInterner<'tcx>>,
|
||||
) -> chalk_ir::Variances<RustInterner<'tcx>> {
|
||||
let variances = self.interner.tcx.variances_of(def_id.0);
|
||||
chalk_ir::Variances::from(
|
||||
chalk_ir::Variances::from_iter(
|
||||
&self.interner,
|
||||
variances.iter().map(|v| match v {
|
||||
ty::Variance::Invariant => chalk_ir::Variance::Invariant,
|
||||
|
@ -706,7 +706,7 @@ impl<'tcx> chalk_ir::UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<
|
|||
def_id: chalk_ir::AdtId<RustInterner<'tcx>>,
|
||||
) -> chalk_ir::Variances<RustInterner<'tcx>> {
|
||||
let variances = self.interner.tcx.variances_of(def_id.0.did);
|
||||
chalk_ir::Variances::from(
|
||||
chalk_ir::Variances::from_iter(
|
||||
&self.interner,
|
||||
variances.iter().map(|v| match v {
|
||||
ty::Variance::Invariant => chalk_ir::Variance::Invariant,
|
||||
|
|
|
@ -97,7 +97,6 @@ crate fn evaluate_goal<'tcx>(
|
|||
use chalk_solve::Solver;
|
||||
let mut solver = chalk_engine::solve::SLGSolver::new(32, None);
|
||||
let db = ChalkRustIrDatabase { interner, reempty_placeholder };
|
||||
//dbg!("evaluate_goal_pre", &obligation, &lowered_goal);
|
||||
let solution = solver.solve(&db, &lowered_goal);
|
||||
debug!(?obligation, ?solution, "evaluate goal");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue