From 61b2a6f5e5ca52328b32cc919d1f2880489a2577 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Thu, 24 Sep 2020 16:49:02 +0200 Subject: [PATCH] Update chalk to 0.26.0 --- Cargo.lock | 16 ++++++++-------- compiler/rustc_middle/Cargo.toml | 2 +- compiler/rustc_traits/Cargo.toml | 6 +++--- compiler/rustc_traits/src/chalk/db.rs | 14 ++++++++------ compiler/rustc_traits/src/chalk/lowering.rs | 15 +++++++++------ 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3ed03ae678..fc20d70038a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -427,9 +427,9 @@ dependencies = [ [[package]] name = "chalk-derive" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624e14d3f029186e6ffd97081ffa082f98ddd5df20655b6f0e8efb83dd8ac8b4" +checksum = "72aade21de1aa12a31fc287ec9891915965b6d7caac1c5de5ea095b6b9bc4cc4" dependencies = [ "proc-macro2", "quote", @@ -439,9 +439,9 @@ dependencies = [ [[package]] name = "chalk-engine" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd172df00ff1de4789ed8971e1623afb10551041a9385d3b4e22fe6b1e8a0d1d" +checksum = "fcffc1240cc5f9c5d1d8028d35a293e193a647a71244d51d3d5b4295cbea0593" dependencies = [ "chalk-derive", "chalk-ir", @@ -452,9 +452,9 @@ dependencies = [ [[package]] name = "chalk-ir" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "118c68eccdda5604af50bbef84c94550f3854f76989cb03c36ffd36cc2ffe958" +checksum = "6b856e69b664ca362a30c21f477fe10f59f74458978bc9bfd667820549bc7758" dependencies = [ "chalk-derive", "lazy_static", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "chalk-solve" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45b235a1f568b28707f117b2d30eabbee9cbcfccaa0d6e9697300400c8ca0996" +checksum = "abae2ca9cca3b0a2f33fe946a688881a8b17b8edc088fe3820cb770275e965ed" dependencies = [ "chalk-derive", "chalk-ir", diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml index 3633166df7b..026f810fd79 100644 --- a/compiler/rustc_middle/Cargo.toml +++ b/compiler/rustc_middle/Cargo.toml @@ -26,7 +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.25.0" +chalk-ir = "0.26.0" smallvec = { version = "1.0", features = ["union", "may_dangle"] } measureme = "0.7.1" rustc_session = { path = "../rustc_session" } diff --git a/compiler/rustc_traits/Cargo.toml b/compiler/rustc_traits/Cargo.toml index 4377871602f..cd718def79b 100644 --- a/compiler/rustc_traits/Cargo.toml +++ b/compiler/rustc_traits/Cargo.toml @@ -12,9 +12,9 @@ rustc_hir = { path = "../rustc_hir" } rustc_index = { path = "../rustc_index" } rustc_ast = { path = "../rustc_ast" } rustc_span = { path = "../rustc_span" } -chalk-ir = "0.25.0" -chalk-solve = "0.25.0" -chalk-engine = "0.25.0" +chalk-ir = "0.26.0" +chalk-solve = "0.26.0" +chalk-engine = "0.26.0" smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc_infer = { path = "../rustc_infer" } rustc_trait_selection = { path = "../rustc_trait_selection" } diff --git a/compiler/rustc_traits/src/chalk/db.rs b/compiler/rustc_traits/src/chalk/db.rs index 2fad54013ad..5804296540a 100644 --- a/compiler/rustc_traits/src/chalk/db.rs +++ b/compiler/rustc_traits/src/chalk/db.rs @@ -11,7 +11,6 @@ use rustc_middle::ty::subst::{InternalSubsts, Subst, SubstsRef}; use rustc_middle::ty::{self, AssocItemContainer, AssocKind, TyCtxt, TypeFoldable}; use rustc_hir::def_id::DefId; -use rustc_hir::Unsafety; use rustc_span::symbol::sym; @@ -19,6 +18,7 @@ use std::fmt; use std::sync::Arc; use crate::chalk::lowering::{self, LowerInto}; +use rustc_hir::Unsafety; pub struct RustIrDatabase<'tcx> { pub(crate) interner: RustInterner<'tcx>, @@ -247,12 +247,14 @@ impl<'tcx> chalk_solve::RustIrDatabase> for RustIrDatabase<'t }; Arc::new(chalk_solve::rust_ir::FnDefDatum { id: fn_def_id, - abi: sig.abi(), - safety: match sig.unsafety() { - Unsafety::Normal => chalk_ir::Safety::Safe, - Unsafety::Unsafe => chalk_ir::Safety::Unsafe, + sig: chalk_ir::FnSig { + abi: sig.abi(), + safety: match sig.unsafety() { + Unsafety::Normal => chalk_ir::Safety::Safe, + Unsafety::Unsafe => chalk_ir::Safety::Unsafe, + }, + variadic: sig.c_variadic(), }, - variadic: sig.c_variadic(), binders: chalk_ir::Binders::new(binders, bound), }) } diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs index 650404e8ca6..3a84efb880b 100644 --- a/compiler/rustc_traits/src/chalk/lowering.rs +++ b/compiler/rustc_traits/src/chalk/lowering.rs @@ -340,18 +340,20 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty>> for Ty<'tcx> { collect_bound_vars(interner, interner.tcx, &sig.inputs_and_output()); TyData::Function(chalk_ir::FnPointer { num_binders: binders.len(interner), + sig: chalk_ir::FnSig { + abi: sig.abi(), + safety: match sig.unsafety() { + rustc_hir::Unsafety::Normal => chalk_ir::Safety::Safe, + rustc_hir::Unsafety::Unsafe => chalk_ir::Safety::Unsafe, + }, + variadic: sig.c_variadic(), + }, substitution: chalk_ir::Substitution::from_iter( interner, inputs_and_outputs.iter().map(|ty| { chalk_ir::GenericArgData::Ty(ty.lower_into(interner)).intern(interner) }), ), - abi: sig.abi(), - safety: match sig.unsafety() { - rustc_hir::Unsafety::Normal => chalk_ir::Safety::Safe, - rustc_hir::Unsafety::Unsafe => chalk_ir::Safety::Unsafe, - }, - variadic: sig.c_variadic(), }) .intern(interner) } @@ -480,6 +482,7 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty> { substs: application_ty.substitution.lower_into(interner), item_def_id: assoc_ty.0, }), + chalk_ir::TypeName::Foreign(def_id) => ty::Foreign(def_id.0), chalk_ir::TypeName::Error => unimplemented!(), }, TyData::Placeholder(placeholder) => ty::Placeholder(ty::Placeholder {