diff options
| author | LeSeulArtichaut <leseulartichaut@gmail.com> | 2021-05-19 15:01:30 +0200 |
|---|---|---|
| committer | Alan Egerton <eggyal@gmail.com> | 2021-11-26 07:25:16 +0000 |
| commit | 6dc3dae46f600efe75627a7ad386e7462066e34d (patch) | |
| tree | 998df08bd8035cb6a9e2435d15a93fd0a4a0c450 /src/librustdoc | |
| parent | 6e3fa20b00d5b3713848aa162969d7a460bd194a (diff) | |
Adapt `TypeFolder` implementors to return a `Result`
Co-authored-by: Alan Egerton <eggyal@gmail.com>
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 2ccf17387d1..3a6f611660e 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -714,11 +714,11 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionReplacer<'a, 'tcx> { self.tcx } - fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { - (match *r { + fn fold_region(&mut self, r: ty::Region<'tcx>) -> Result<ty::Region<'tcx>, Self::Error> { + Ok((match *r { ty::ReVar(vid) => self.vid_to_region.get(&vid).cloned(), _ => None, }) - .unwrap_or_else(|| r.super_fold_with(self)) + .unwrap_or_else(|| r.super_fold_with(self).into_ok())) } } |
