Trevor Gross
19f6c17df4
Stabilize const_option
This makes the following API stable in const contexts:
impl<T> Option<T> {
pub const fn as_mut(&mut self) -> Option<&mut T>;
pub const fn expect(self, msg: &str) -> T;
pub const fn unwrap(self) -> T;
pub const unsafe fn unwrap_unchecked(self) -> T;
pub const fn take(&mut self) -> Option<T>;
pub const fn replace(&mut self, value: T) -> Option<T>;
}
impl<T> Option<&T> {
pub const fn copied(self) -> Option<T>
where T: Copy;
}
impl<T> Option<&mut T> {
pub const fn copied(self) -> Option<T>
where T: Copy;
}
impl<T, E> Option<Result<T, E>> {
pub const fn transpose(self) -> Result<Option<T>, E>
}
impl<T> Option<Option<T>> {
pub const fn flatten(self) -> Option<T>;
}
The following functions make use of the unstable
`const_precise_live_drops` feature:
- `expect`
- `unwrap`
- `unwrap_unchecked`
- `transpose`
- `flatten`
Fixes: <https://github.com/rust-lang/rust/issues/67441>
2024-10-12 17:07:13 -04:00
..
2024-10-11 13:11:13 +00:00
2024-10-11 13:11:13 +00:00
2024-10-11 13:11:13 +00:00
2024-10-11 13:11:13 +00:00
2024-10-06 23:28:30 +09:00
2024-10-12 10:59:12 +02:00
2024-10-12 10:59:12 +02:00
2024-10-11 15:32:56 -06:00
2024-10-11 15:32:56 -06:00
2024-10-12 23:02:15 +08:00
2024-10-11 15:36:51 +02:00
2024-10-10 12:49:19 +02:00
2024-10-07 11:10:53 -07:00
2024-10-09 10:28:16 -07:00
2024-10-07 12:23:54 +02:00
2024-10-07 08:59:55 +00:00
2024-10-11 13:11:13 +00:00
2024-10-10 12:49:18 +02:00
2024-10-11 15:32:56 -06:00
2024-10-04 23:28:22 +00:00
2024-10-11 13:11:13 +00:00
2024-10-06 23:28:30 +09:00
2024-10-10 12:49:18 +02:00
2024-10-10 06:07:52 -04:00
2024-10-05 10:01:27 +03:00
2024-10-08 18:21:16 -06:00
2024-10-11 23:57:47 -04:00
2024-10-08 18:21:16 -06:00
2024-10-11 16:53:50 -05:00
2024-10-11 13:11:13 +00:00
2024-10-12 17:07:13 -04:00
2024-10-11 13:11:13 +00:00
2024-10-07 08:59:55 +00:00
2024-10-08 11:15:26 +08:00
2024-10-04 14:06:48 +02:00
2024-10-11 10:41:10 +00:00
2024-10-12 11:08:42 -05:00
2024-10-11 13:11:13 +00:00
2024-10-04 23:31:55 +00:00
2024-10-11 13:11:13 +00:00
2024-10-04 14:02:09 -04:00
2024-10-12 17:07:13 -04:00
2024-10-10 11:46:11 +02:00
2024-10-06 19:00:09 +02:00
2024-10-11 15:32:56 -06:00
2024-10-11 23:57:46 -04:00
2024-10-11 10:41:10 +00:00
2024-10-04 14:02:09 -04:00
2024-10-08 18:24:38 -07:00
2024-10-10 11:46:48 -07:00
2024-10-05 12:19:14 +02:00