diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-03-27 13:11:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-27 13:11:18 -0400 |
| commit | 10debec01a2b86fc8c26f25d1ba19f7ea6e8cc42 (patch) | |
| tree | dc29aa172c16d6c78edde7010a2132237dcc6e61 /src | |
| parent | 3a8621d681ab14db5cf928b2122c97872d57e291 (diff) | |
| parent | 5a6ed74a6cae1b8bd994a9b2738896b425726c52 (diff) | |
| download | rust-10debec01a2b86fc8c26f25d1ba19f7ea6e8cc42.tar.gz rust-10debec01a2b86fc8c26f25d1ba19f7ea6e8cc42.zip | |
Rollup merge of #138926 - nnethercote:less-kw-Empty-rustc_middle, r=lcnr
Remove `kw::Empty` uses from `rustc_middle`. There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks. r? `@lcnr`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 6f660df4d7d..5e7a49f82c7 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1943,14 +1943,11 @@ fn clean_trait_object_lifetime_bound<'tcx>( // latter contrary to `clean_middle_region`. match *region { ty::ReStatic => Some(Lifetime::statik()), - ty::ReEarlyParam(region) if region.name != kw::Empty => Some(Lifetime(region.name)), - ty::ReBound(_, ty::BoundRegion { kind: ty::BoundRegionKind::Named(_, name), .. }) - if name != kw::Empty => - { + ty::ReEarlyParam(region) => Some(Lifetime(region.name)), + ty::ReBound(_, ty::BoundRegion { kind: ty::BoundRegionKind::Named(_, name), .. }) => { Some(Lifetime(name)) } - ty::ReEarlyParam(_) - | ty::ReBound(..) + ty::ReBound(..) | ty::ReLateParam(_) | ty::ReVar(_) | ty::RePlaceholder(_) |
