Trevor Gross 3c43a60d06 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-12 17:07:13 -04:00
2024-04-24 13:12:33 +01:00
2024-05-08 21:37:55 +02:00
2024-05-08 21:37:55 +02:00
2024-05-08 21:37:55 +02:00
2024-04-27 10:54:35 +03:00
2024-07-04 22:31:53 +02:00
2024-07-04 21:27:52 +02:00
2024-07-04 22:31:53 +02:00
2024-10-05 00:19:43 +00:00
2024-10-05 00:19:43 +00:00
2024-10-05 00:19:43 +00:00
2024-04-27 10:54:35 +03:00
2024-04-24 13:12:33 +01:00
2024-06-13 12:24:31 +02:00
2024-06-13 12:24:31 +02:00
2024-04-24 13:12:33 +01:00
2024-09-01 12:38:59 +02:00
2024-06-09 07:47:42 +01:00