diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-10-04 14:11:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-04 14:11:34 -0700 |
| commit | 47b681d2762a04fcdc1367c4479ea7d54035ef64 (patch) | |
| tree | b3e0d796b2414e0c7f084837c8486b36eda39fc9 /compiler/rustc_codegen_llvm/src | |
| parent | 743623d4f7a4e26e519fc0981e5b2a195af9760d (diff) | |
| parent | d232d094b8e2776a6a1e88f478442fd98e2e70b4 (diff) | |
| download | rust-47b681d2762a04fcdc1367c4479ea7d54035ef64.tar.gz rust-47b681d2762a04fcdc1367c4479ea7d54035ef64.zip | |
Rollup merge of #130518 - scottmcm:stabilize-controlflow-extra, r=dtolnay
Stabilize the `map`/`value` methods on `ControlFlow`
And fix the stability attribute on the `pub use` in `core::ops`.
libs-api in https://github.com/rust-lang/rust/issues/75744#issuecomment-2231214910 seemed reasonably happy with naming for these, so let's try for an FCP.
Summary:
```rust
impl<B, C> ControlFlow<B, C> {
pub fn break_value(self) -> Option<B>;
pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C>;
pub fn continue_value(self) -> Option<C>;
pub fn map_continue<T>(self, f: impl FnOnce(C) -> T) -> ControlFlow<B, T>;
}
```
Resolves #75744
``@rustbot`` label +needs-fcp +t-libs-api -t-libs
---
Aside, in case it keeps someone else from going down the same dead end: I looked at the `{break,continue}_value` methods and tried to make them `const` as part of this, but that's disallowed because of not having `const Drop`, so put it back to not even unstably-const.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
