Skip to content

Commit 9c14eaa

Browse files
committed
1 parent 559efa9 commit 9c14eaa

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# NOTE: Keep in sync with nightly date on README
22
[toolchain]
3-
channel = "nightly-2021-11-30"
3+
channel = "nightly-2021-12-05"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/translate.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
166166
use rustc_middle::ty::TypeAndMut;
167167
use rustc_middle::ty::{AdtDef, Binder, ExistentialProjection, ExistentialTraitRef};
168168

169-
let Ok(result) = orig.fold_with(&mut BottomUpFolder {
169+
let result = orig.fold_with(&mut BottomUpFolder {
170170
tcx: self.tcx,
171171
ty_op: |ty| {
172172
match *ty.kind() {
@@ -559,12 +559,12 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
559559
self.infcx.tcx
560560
}
561561

562-
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
562+
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
563563
use rustc_middle::ty::TyKind;
564564
use rustc_middle::ty::TypeAndMut;
565565

566-
let t1 = ty.super_fold_with(self)?;
567-
Ok(match *t1.kind() {
566+
let t1 = ty.super_fold_with(self);
567+
match *t1.kind() {
568568
TyKind::Ref(region, ty, mutbl) if region.needs_infer() => {
569569
let ty_and_mut = TypeAndMut { ty, mutbl };
570570
self.infcx
@@ -573,15 +573,15 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
573573
}
574574
TyKind::Infer(_) => self.infcx.tcx.ty_error(),
575575
_ => t1,
576-
})
576+
}
577577
}
578578

579-
fn fold_region(&mut self, r: Region<'tcx>) -> Result<Region<'tcx>, Self::Error> {
580-
let r1 = r.super_fold_with(self)?;
581-
Ok(if r1.needs_infer() {
579+
fn fold_region(&mut self, r: Region<'tcx>) -> Region<'tcx> {
580+
let r1 = r.super_fold_with(self);
581+
if r1.needs_infer() {
582582
self.infcx.tcx.lifetimes.re_erased
583583
} else {
584584
r1
585-
})
585+
}
586586
}
587587
}

src/typeck.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
254254
RegionckMode::default(),
255255
);
256256

257-
let Ok(folded) = self
257+
let err = self
258258
.infcx
259259
.resolve_vars_if_possible(err)
260-
.fold_with(&mut self.folder.clone());
261-
let err = folded.lift_to_tcx(lift_tcx).unwrap();
260+
.fold_with(&mut self.folder.clone())
261+
.lift_to_tcx(lift_tcx)
262+
.unwrap();
262263

263264
Some(err)
264265
} else {
@@ -287,11 +288,11 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
287288
errors
288289
.iter()
289290
.map(|err| {
290-
let Ok(folded) = self
291-
.infcx
291+
self.infcx
292292
.resolve_vars_if_possible(err.obligation.predicate)
293-
.fold_with(&mut self.folder.clone());
294-
folded.lift_to_tcx(lift_tcx).unwrap()
293+
.fold_with(&mut self.folder.clone())
294+
.lift_to_tcx(lift_tcx)
295+
.unwrap()
295296
})
296297
.collect()
297298
})

0 commit comments

Comments
 (0)