Files
rust/tests/ui/consts
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-09-14 18:07:06 +02:00
2024-09-15 09:51:32 +02:00
2024-09-15 10:20:47 +02:00
2024-01-13 12:46:58 -05:00
2024-09-15 09:51:32 +02:00
2024-08-18 19:46:53 +02:00
2023-01-11 09:32:08 +00:00
2024-04-24 13:12:33 +01:00
2024-06-21 11:57:24 +00:00
2024-02-07 10:42:01 +08:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-09-15 09:51:32 +02:00
2024-09-15 09:51:32 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-09-15 09:51:32 +02:00
2024-09-15 09:51:32 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-06-28 10:57:35 +00:00
2024-10-12 17:07:13 -04:00
2024-10-12 17:07:13 -04:00
2024-09-15 09:51:32 +02:00
2024-09-15 09:51:32 +02:00
2023-01-11 09:32:08 +00:00
2023-11-12 04:33:19 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-31 17:26:06 +00:00
2024-01-13 12:46:58 -05:00
2024-02-25 12:03:48 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-04-16 11:38:52 +00:00
2023-07-27 15:51:02 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-04-03 15:59:21 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-07-27 15:51:02 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-04-03 15:59:21 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-09-15 09:51:32 +02:00
2024-04-24 13:12:33 +01:00
2023-10-08 10:06:17 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-10-07 16:29:52 +00:00
2024-01-24 07:56:23 +01:00
2024-01-24 07:56:23 +01:00
2023-01-11 09:32:08 +00:00
2024-09-15 09:51:32 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-15 19:46:20 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-09-14 18:07:06 +02:00
2024-01-13 12:46:58 -05:00