diff options
Diffstat (limited to 'vendor/chalk-engine')
-rw-r--r-- | vendor/chalk-engine/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/chalk-engine/Cargo.toml | 22 | ||||
-rw-r--r-- | vendor/chalk-engine/src/lib.rs | 10 | ||||
-rw-r--r-- | vendor/chalk-engine/src/normalize_deep.rs | 46 | ||||
-rw-r--r-- | vendor/chalk-engine/src/slg/resolvent.rs | 10 | ||||
-rw-r--r-- | vendor/chalk-engine/src/strand.rs | 13 |
6 files changed, 54 insertions, 49 deletions
diff --git a/vendor/chalk-engine/.cargo-checksum.json b/vendor/chalk-engine/.cargo-checksum.json index 93c5b694a..62892242b 100644 --- a/vendor/chalk-engine/.cargo-checksum.json +++ b/vendor/chalk-engine/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f0bf3c13da236bb4ee2b8f5f35ae43dbcc155258f2aeba875fc0891b90dcc822","README.md":"d8d9a21a6700b554e110030288fb94ca98fa6c6398fa6a5a1dafa52b3f7dd545","src/README.md":"6606b446db6a271e99f1019cd6e59a44af50e7b1ee995718d30fde11c09bbc80","src/context.rs":"89dcf1a74cb22604f32265bcce7f93376cf299101337368d0191f4d1cd598de7","src/derived.rs":"a59fe981325e664865bf21407e4a24e317b00cc2545b380d1140b4fddc86ede3","src/forest.rs":"d6d59557b8ff4fbdcdd3474d214b6e455993996224a14773929ee0e295c02984","src/lib.rs":"3c1a331575ede17623bbbb9eb4e6bb49497b41f805b317d91895718cb886fcaf","src/logic.rs":"45747ba7d9a7b14f8c652659ac2e31854f962c613346c23ba55b972fdd548c75","src/normalize_deep.rs":"d1663c7bb5fc16be8b414f188a982cd6b21ad7fa9185f72a0476dba9e4756472","src/simplify.rs":"fbc006c2974dfef17d8849b6cd21b9510805bafce1217721eb43479cf02572d1","src/slg.rs":"2fbdce2aaebe3342f3af5d7b4ccbdef969009c0e0d302c9201bf30b7efb1ae5f","src/slg/aggregate.rs":"52b51f86e837b8219bb84935f870d47f6c5c0c1765cfea3e32a75b1055fa0761","src/slg/resolvent.rs":"476b5efa99711fd1739e2e21ca6d7918c5546d849c96b26e4bd6260852ad1fc9","src/solve.rs":"ed054d4a9b132fa8c5a6ff1c8c4a435207412eaee30fc992ed0d4a668543584c","src/stack.rs":"0eb11b6f40575aff6784ab10d5f027a9e52ee05e818d7c77fdccf9a59fd18a60","src/strand.rs":"3006dab840a6a3cf48bf45a14fa9d117d06dfeb53d8e36301b5b43cef07b648e","src/table.rs":"253197ca4a700cdc8132e04171a00603c65d5db6794e7779073a8412131dd7cf","src/tables.rs":"c140ea3b7ada35c097f578dc81873164c2c36f41adfb5f7d0d71cd9978974a23"},"package":"c44ee96f2d67cb5193d1503f185db1abad9933a1c6e6b4169c176f90baecd393"}
\ No newline at end of file +{"files":{"Cargo.toml":"94f6635bf5c8c722968aa645a87788dbc784f776008bf048ebab99e421a250a3","README.md":"d8d9a21a6700b554e110030288fb94ca98fa6c6398fa6a5a1dafa52b3f7dd545","src/README.md":"6606b446db6a271e99f1019cd6e59a44af50e7b1ee995718d30fde11c09bbc80","src/context.rs":"89dcf1a74cb22604f32265bcce7f93376cf299101337368d0191f4d1cd598de7","src/derived.rs":"a59fe981325e664865bf21407e4a24e317b00cc2545b380d1140b4fddc86ede3","src/forest.rs":"d6d59557b8ff4fbdcdd3474d214b6e455993996224a14773929ee0e295c02984","src/lib.rs":"3b3e9fd0210471f42d1d1a405877aa248dcf6194099461637cfdce7bed07000b","src/logic.rs":"45747ba7d9a7b14f8c652659ac2e31854f962c613346c23ba55b972fdd548c75","src/normalize_deep.rs":"3fb8ab2f1e2bd2c65b739f57d1b18175205bdba30dee8c04033180cb9ea4d975","src/simplify.rs":"fbc006c2974dfef17d8849b6cd21b9510805bafce1217721eb43479cf02572d1","src/slg.rs":"2fbdce2aaebe3342f3af5d7b4ccbdef969009c0e0d302c9201bf30b7efb1ae5f","src/slg/aggregate.rs":"52b51f86e837b8219bb84935f870d47f6c5c0c1765cfea3e32a75b1055fa0761","src/slg/resolvent.rs":"5edb5247e842379313b4162bf07c7417d5b2453a40ed38ceabaa97e111e24230","src/solve.rs":"ed054d4a9b132fa8c5a6ff1c8c4a435207412eaee30fc992ed0d4a668543584c","src/stack.rs":"0eb11b6f40575aff6784ab10d5f027a9e52ee05e818d7c77fdccf9a59fd18a60","src/strand.rs":"c7f3b68ba182f046112c100c4d2192f3928f4d5c3bf63c39ae29393741da520a","src/table.rs":"253197ca4a700cdc8132e04171a00603c65d5db6794e7779073a8412131dd7cf","src/tables.rs":"c140ea3b7ada35c097f578dc81873164c2c36f41adfb5f7d0d71cd9978974a23"},"package":"7e54ac43048cb31c470d7b3e3acd409090ef4a5abddfe02455187aebc3d6879f"}
\ No newline at end of file diff --git a/vendor/chalk-engine/Cargo.toml b/vendor/chalk-engine/Cargo.toml index 413af5387..7497cac9e 100644 --- a/vendor/chalk-engine/Cargo.toml +++ b/vendor/chalk-engine/Cargo.toml @@ -12,21 +12,29 @@ [package] edition = "2018" name = "chalk-engine" -version = "0.80.0" -authors = ["Rust Compiler Team", "Chalk developers"] +version = "0.87.0" +authors = [ + "Rust Compiler Team", + "Chalk developers", +] description = "Core trait engine from Chalk project" readme = "README.md" -keywords = ["compiler", "traits", "prolog"] -license = "Apache-2.0/MIT" +keywords = [ + "compiler", + "traits", + "prolog", +] +license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/chalk" + [dependencies.chalk-derive] -version = "=0.80.0" +version = "=0.87.0" [dependencies.chalk-ir] -version = "=0.80.0" +version = "=0.87.0" [dependencies.chalk-solve] -version = "=0.80.0" +version = "=0.87.0" [dependencies.rustc-hash] version = "1.1.0" diff --git a/vendor/chalk-engine/src/lib.rs b/vendor/chalk-engine/src/lib.rs index 499b33e4f..f139f5cc0 100644 --- a/vendor/chalk-engine/src/lib.rs +++ b/vendor/chalk-engine/src/lib.rs @@ -56,7 +56,7 @@ use std::cmp::min; use std::usize; -use chalk_derive::{Fold, HasInterner, Visit}; +use chalk_derive::{HasInterner, TypeFoldable, TypeVisitable}; use chalk_ir::interner::Interner; use chalk_ir::{ AnswerSubst, Canonical, ConstrainedSubst, Constraint, DebruijnIndex, Goal, InEnvironment, @@ -78,13 +78,13 @@ mod table; mod tables; index_struct! { - pub struct TableIndex { // FIXME: pub b/c Fold + pub struct TableIndex { // FIXME: pub b/c TypeFoldable value: usize, } } /// The paper describes these as `A :- D | G`. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Fold, Visit, HasInterner)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, TypeFoldable, TypeVisitable, HasInterner)] pub struct ExClause<I: Interner> { /// The substitution which, applied to the goal of our table, /// would yield A. @@ -168,7 +168,7 @@ impl TimeStamp { /// /// trying to solve `?T: Foo` would immediately require solving `?T: /// Sized`, and hence would flounder. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Fold, Visit)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, TypeFoldable, TypeVisitable)] pub struct FlounderedSubgoal<I: Interner> { /// Literal that floundered. pub floundered_literal: Literal<I>, @@ -209,7 +209,7 @@ pub struct CompleteAnswer<I: Interner> { } /// Either `A` or `~A`, where `A` is a `Env |- Goal`. -#[derive(Clone, Debug, Fold, Visit)] +#[derive(Clone, Debug, TypeFoldable, TypeVisitable)] pub enum Literal<I: Interner> { // FIXME: pub b/c fold Positive(InEnvironment<Goal<I>>), diff --git a/vendor/chalk-engine/src/normalize_deep.rs b/vendor/chalk-engine/src/normalize_deep.rs index 0c4a01ccb..9f36f3ce5 100644 --- a/vendor/chalk-engine/src/normalize_deep.rs +++ b/vendor/chalk-engine/src/normalize_deep.rs @@ -1,9 +1,11 @@ +use chalk_derive::FallibleTypeFolder; use chalk_ir::fold::shift::Shift; -use chalk_ir::fold::{Fold, Folder}; +use chalk_ir::fold::{TypeFoldable, TypeFolder}; use chalk_ir::interner::Interner; use chalk_ir::*; use chalk_solve::infer::InferenceTable; +#[derive(FallibleTypeFolder)] pub(crate) struct DeepNormalizer<'table, I: Interner> { table: &'table mut InferenceTable<I>, interner: I, @@ -21,13 +23,13 @@ impl<I: Interner> DeepNormalizer<'_, I> { /// See also `InferenceTable::canonicalize`, which -- during real /// processing -- is often used to capture the "current state" of /// variables. - pub fn normalize_deep<T: Fold<I>>( + pub fn normalize_deep<T: TypeFoldable<I>>( table: &mut InferenceTable<I>, interner: I, value: T, - ) -> T::Result { + ) -> T { value - .fold_with( + .try_fold_with( &mut DeepNormalizer { interner, table }, DebruijnIndex::INNERMOST, ) @@ -35,10 +37,8 @@ impl<I: Interner> DeepNormalizer<'_, I> { } } -impl<I: Interner> Folder<I> for DeepNormalizer<'_, I> { - type Error = NoSolution; - - fn as_dyn(&mut self) -> &mut dyn Folder<I, Error = Self::Error> { +impl<I: Interner> TypeFolder<I> for DeepNormalizer<'_, I> { + fn as_dyn(&mut self) -> &mut dyn TypeFolder<I> { self } @@ -47,18 +47,18 @@ impl<I: Interner> Folder<I> for DeepNormalizer<'_, I> { var: InferenceVar, kind: TyVariableKind, _outer_binder: DebruijnIndex, - ) -> Fallible<Ty<I>> { + ) -> Ty<I> { let interner = self.interner; match self.table.probe_var(var) { - Some(ty) => Ok(ty + Some(ty) => ty .assert_ty_ref(interner) .clone() - .fold_with(self, DebruijnIndex::INNERMOST)? - .shifted_in(interner)), // FIXME shift + .fold_with(self, DebruijnIndex::INNERMOST) + .shifted_in(interner), // FIXME shift None => { // Normalize all inference vars which have been unified into a // single variable. Ena calls this the "root" variable. - Ok(self.table.inference_var_root(var).to_ty(interner, kind)) + self.table.inference_var_root(var).to_ty(interner, kind) } } } @@ -67,15 +67,15 @@ impl<I: Interner> Folder<I> for DeepNormalizer<'_, I> { &mut self, var: InferenceVar, _outer_binder: DebruijnIndex, - ) -> Fallible<Lifetime<I>> { + ) -> Lifetime<I> { let interner = self.interner; match self.table.probe_var(var) { - Some(l) => Ok(l + Some(l) => l .assert_lifetime_ref(interner) .clone() - .fold_with(self, DebruijnIndex::INNERMOST)? - .shifted_in(interner)), - None => Ok(var.to_lifetime(interner)), // FIXME shift + .fold_with(self, DebruijnIndex::INNERMOST) + .shifted_in(interner), + None => var.to_lifetime(interner), // FIXME shift } } @@ -84,15 +84,15 @@ impl<I: Interner> Folder<I> for DeepNormalizer<'_, I> { ty: Ty<I>, var: InferenceVar, _outer_binder: DebruijnIndex, - ) -> Fallible<Const<I>> { + ) -> Const<I> { let interner = self.interner; match self.table.probe_var(var) { - Some(c) => Ok(c + Some(c) => c .assert_const_ref(interner) .clone() - .fold_with(self, DebruijnIndex::INNERMOST)? - .shifted_in(interner)), - None => Ok(var.to_const(interner, ty)), // FIXME shift + .fold_with(self, DebruijnIndex::INNERMOST) + .shifted_in(interner), + None => var.to_const(interner, ty), // FIXME shift } } diff --git a/vendor/chalk-engine/src/slg/resolvent.rs b/vendor/chalk-engine/src/slg/resolvent.rs index c6d0f8d5c..3863fc429 100644 --- a/vendor/chalk-engine/src/slg/resolvent.rs +++ b/vendor/chalk-engine/src/slg/resolvent.rs @@ -3,7 +3,7 @@ use crate::slg::ResolventOps; use crate::{ExClause, Literal, TimeStamp}; use chalk_ir::cast::Caster; use chalk_ir::fold::shift::Shift; -use chalk_ir::fold::Fold; +use chalk_ir::fold::TypeFoldable; use chalk_ir::interner::{HasInterner, Interner}; use chalk_ir::zip::{Zip, Zipper}; use chalk_ir::*; @@ -614,8 +614,7 @@ impl<'i, I: Interner> Zipper<I> for AnswerSubstitutor<'i, I> { (LifetimeData::Static, LifetimeData::Static) | (LifetimeData::Placeholder(_), LifetimeData::Placeholder(_)) - | (LifetimeData::Erased, LifetimeData::Erased) - | (LifetimeData::Empty(_), LifetimeData::Empty(_)) => { + | (LifetimeData::Erased, LifetimeData::Erased) => { assert_eq!(answer, pending); Ok(()) } @@ -628,8 +627,7 @@ impl<'i, I: Interner> Zipper<I> for AnswerSubstitutor<'i, I> { (LifetimeData::Static, _) | (LifetimeData::BoundVar(_), _) | (LifetimeData::Placeholder(_), _) - | (LifetimeData::Erased, _) - | (LifetimeData::Empty(_), _) => panic!( + | (LifetimeData::Erased, _) => panic!( "structural mismatch between answer `{:?}` and pending goal `{:?}`", answer, pending, ), @@ -708,7 +706,7 @@ impl<'i, I: Interner> Zipper<I> for AnswerSubstitutor<'i, I> { pending: &Binders<T>, ) -> Fallible<()> where - T: HasInterner<Interner = I> + Zip<I> + Fold<I, Result = T>, + T: HasInterner<Interner = I> + Zip<I> + TypeFoldable<I>, { self.outer_binder.shift_in(); Zip::zip_with( diff --git a/vendor/chalk-engine/src/strand.rs b/vendor/chalk-engine/src/strand.rs index 91196ec94..da25a778d 100644 --- a/vendor/chalk-engine/src/strand.rs +++ b/vendor/chalk-engine/src/strand.rs @@ -3,7 +3,7 @@ use crate::{ExClause, TableIndex, TimeStamp}; use std::fmt::Debug; use chalk_derive::HasInterner; -use chalk_ir::fold::{Fold, Folder}; +use chalk_ir::fold::{FallibleTypeFolder, TypeFoldable}; use chalk_ir::interner::Interner; use chalk_ir::{Canonical, DebruijnIndex, UniverseMap}; @@ -35,15 +35,14 @@ pub(crate) struct SelectedSubgoal { pub(crate) universe_map: UniverseMap, } -impl<I: Interner> Fold<I> for Strand<I> { - type Result = Strand<I>; - fn fold_with<E>( +impl<I: Interner> TypeFoldable<I> for Strand<I> { + fn try_fold_with<E>( self, - folder: &mut dyn Folder<I, Error = E>, + folder: &mut dyn FallibleTypeFolder<I, Error = E>, outer_binder: DebruijnIndex, - ) -> Result<Self::Result, E> { + ) -> Result<Self, E> { Ok(Strand { - ex_clause: self.ex_clause.fold_with(folder, outer_binder)?, + ex_clause: self.ex_clause.try_fold_with(folder, outer_binder)?, last_pursued_time: self.last_pursued_time, selected_subgoal: self.selected_subgoal, }) |