diff options
| author | bors <bors@rust-lang.org> | 2021-12-02 19:12:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-02 19:12:00 +0000 |
| commit | acbe4443cc4c9695c0b74a7b64b60333c990a400 (patch) | |
| tree | a5e6d73ac55994cfb75162ec88240f1ddfa900ca /src | |
| parent | e5038e20999eef35260b070189883edc2a8a34b2 (diff) | |
| parent | cf683e644f1822400ea22c7da5de40b5b395a194 (diff) | |
| download | rust-acbe4443cc4c9695c0b74a7b64b60333c990a400.tar.gz rust-acbe4443cc4c9695c0b74a7b64b60333c990a400.zip | |
Auto merge of #91318 - eggyal:reduce-boilerplate-around-infallible-folders, r=jackh726
Reduce boilerplate around infallible folders Further to https://github.com/rust-lang/rust/pull/91230#issuecomment-981059666 r? `@jackh726`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 04fe1dccce4..2ccf17387d1 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -449,7 +449,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { _ => false, } }) - .map(|p| p.fold_with(&mut replacer).into_ok()); + .map(|p| p.fold_with(&mut replacer)); let mut generic_params = (tcx.generics_of(item_def_id), tcx.explicit_predicates_of(item_def_id)) @@ -714,11 +714,11 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionReplacer<'a, 'tcx> { self.tcx } - fn fold_region(&mut self, r: ty::Region<'tcx>) -> Result<ty::Region<'tcx>, Self::Error> { - Ok((match *r { + fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { + (match *r { ty::ReVar(vid) => self.vid_to_region.get(&vid).cloned(), _ => None, }) - .unwrap_or_else(|| r.super_fold_with(self).into_ok())) + .unwrap_or_else(|| r.super_fold_with(self)) } } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 6ba56fe01a9..b6311abb5c3 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -18,7 +18,6 @@ #![feature(type_ascription)] #![feature(iter_intersperse)] #![recursion_limit = "256"] -#![feature(unwrap_infallible)] #![warn(rustc::internal)] #[macro_use] |
