diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-09-03 10:33:04 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-03 10:33:04 +0530 |
| commit | 2ed716a81d36c0779bb132031fc9ef0b9e7f4212 (patch) | |
| tree | 789f4f9b6602e768a2fe1ba4b186fbdf8aff7252 /src/test/debuginfo/enum-thinlto.rs | |
| parent | 0209485578807b8084127f12d57771300edff87a (diff) | |
| parent | 773df6788018b2cd6267b82bd2b5712cbd223f44 (diff) | |
| download | rust-2ed716a81d36c0779bb132031fc9ef0b9e7f4212.tar.gz rust-2ed716a81d36c0779bb132031fc9ef0b9e7f4212.zip | |
Rollup merge of #99736 - lopopolo:lopopolo/gh-80996-partial-stabilization-bounds-as-ref, r=dtolnay
Partially stabilize `bound_as_ref` by stabilizing `Bound::as_ref`
Stabilizing `Bound::as_ref` will simplify the implementation for `RangeBounds<usize>` for custom range types:
```rust
impl RangeBounds<usize> for Region {
fn start_bound(&self) -> Bound<&usize> {
// TODO: Use `self.start.as_ref()` when upstream `std` stabilizes:
// https://github.com/rust-lang/rust/issues/80996
match self.start {
Bound::Included(ref bound) => Bound::Included(bound),
Bound::Excluded(ref bound) => Bound::Excluded(bound),
Bound::Unbounded => Bound::Unbounded,
}
}
fn end_bound(&self) -> Bound<&usize> {
// TODO: Use `self.end.as_ref()` when upstream `std` stabilizes:
// https://github.com/rust-lang/rust/issues/80996
match self.end {
Bound::Included(ref bound) => Bound::Included(bound),
Bound::Excluded(ref bound) => Bound::Excluded(bound),
Bound::Unbounded => Bound::Unbounded,
}
}
}
```
See:
- #80996
- https://github.com/rust-lang/rust/issues/80996#issuecomment-1194575470
cc `@yaahc` who suggested partial stabilization.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions
