From a61f675005cc6f6c1e9b4cc53b28b260a944671e Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 1 Apr 2021 04:55:55 +0900 Subject: [PATCH] Update to `nightly-2020-12-20` Rustup to rust-lang/rust#80106 --- README.md | 6 +++--- rust-toolchain | 2 +- src/mismatch.rs | 2 +- src/translate.rs | 20 ++++++++++---------- src/typeck.rs | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b5aec57e..9e54e29b 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2020-12-19` toolchain. -You can install it by using `rustup install nightly-2020-12-19` if you already have rustup. +It's recommended to use `nightly-2020-12-20` toolchain. +You can install it by using `rustup install nightly-2020-12-20` if you already have rustup. Then you can do: ```sh $ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2020-11-19 -$ cargo +nightly-2020-12-19 install --git https://github.com/rust-lang/rust-semverver +$ cargo +nightly-2020-12-20 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit diff --git a/rust-toolchain b/rust-toolchain index 620a952f..c332df8c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2020-12-19" +channel = "nightly-2020-12-20" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/mismatch.rs b/src/mismatch.rs index ba9a2784..365e2b04 100644 --- a/src/mismatch.rs +++ b/src/mismatch.rs @@ -308,7 +308,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { a: ty::Binder, b: ty::Binder, ) -> RelateResult<'tcx, ty::Binder> { - Ok(ty::Binder::bind( + Ok(a.rebind( self.relate(a.skip_binder(), b.skip_binder())?, )) } diff --git a/src/translate.rs b/src/translate.rs index b7ee509f..69b6c864 100644 --- a/src/translate.rs +++ b/src/translate.rs @@ -376,12 +376,12 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { predicate: Predicate<'tcx>, ) -> Option> { use rustc_middle::ty::{ - OutlivesPredicate, PredicateAtom, PredicateKind, ProjectionPredicate, ProjectionTy, - SubtypePredicate, ToPredicate, TraitPredicate, WithOptConstParam, + Binder, OutlivesPredicate, PredicateAtom, PredicateKind, ProjectionPredicate, + ProjectionTy, SubtypePredicate, ToPredicate, TraitPredicate, WithOptConstParam, }; Some(match predicate.skip_binders() { - PredicateAtom::Trait(pred, constness) => PredicateAtom::Trait( + PredicateAtom::Trait(pred, constness) => Binder::bind(PredicateAtom::Trait( if let Some((target_def_id, target_substs)) = self.translate_orig_substs( index_map, pred.trait_ref.def_id, @@ -397,21 +397,21 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { return None; }, constness, - ) + )) .potentially_quantified(self.tcx, PredicateKind::ForAll), - PredicateAtom::RegionOutlives(pred) => PredicateAtom::RegionOutlives({ + PredicateAtom::RegionOutlives(pred) => Binder::bind(PredicateAtom::RegionOutlives({ let l = self.translate_region(pred.0); let r = self.translate_region(pred.1); OutlivesPredicate(l, r) - }) + })) .potentially_quantified(self.tcx, PredicateKind::ForAll), - PredicateAtom::TypeOutlives(pred) => PredicateAtom::TypeOutlives({ + PredicateAtom::TypeOutlives(pred) => Binder::bind(PredicateAtom::TypeOutlives({ let l = self.translate(index_map, pred.0); let r = self.translate_region(pred.1); OutlivesPredicate(l, r) - }) + })) .potentially_quantified(self.tcx, PredicateKind::ForAll), - PredicateAtom::Projection(pred) => PredicateAtom::Projection( + PredicateAtom::Projection(pred) => Binder::bind(PredicateAtom::Projection( if let Some((target_def_id, target_substs)) = self.translate_orig_substs( index_map, pred.projection_ty.item_def_id, @@ -427,7 +427,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { } else { return None; }, - ) + )) .potentially_quantified(self.tcx, PredicateKind::ForAll), PredicateAtom::WellFormed(ty) => { PredicateAtom::WellFormed(self.translate(index_map, ty)).to_predicate(self.tcx) diff --git a/src/typeck.rs b/src/typeck.rs index 968b1f3e..eb7181b5 100644 --- a/src/typeck.rs +++ b/src/typeck.rs @@ -74,14 +74,14 @@ impl<'a, 'tcx> BoundContext<'a, 'tcx> { /// Register the trait bound represented by a `TraitRef`. pub fn register_trait_ref(&mut self, checked_trait_ref: TraitRef<'tcx>) { use rustc_hir::Constness; - use rustc_middle::ty::TraitPredicate; + use rustc_middle::ty::{Binder, TraitPredicate}; - let predicate = PredicateAtom::Trait( + let predicate = Binder::bind(PredicateAtom::Trait( TraitPredicate { trait_ref: checked_trait_ref, }, Constness::NotConst, - ) + )) .potentially_quantified(self.infcx.tcx, PredicateKind::ForAll); let obligation = Obligation::new(ObligationCause::dummy(), self.given_param_env, predicate); self.fulfill_cx