3c43a60d06
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> |
||
---|---|---|
.. | ||
doc_lazy_blockquote.fixed | ||
doc_lazy_blockquote.rs | ||
doc_lazy_blockquote.stderr | ||
doc_lazy_list.fixed | ||
doc_lazy_list.rs | ||
doc_lazy_list.stderr | ||
doc_markdown-issue_13097.fixed | ||
doc_markdown-issue_13097.rs | ||
doc_markdown-issue_13097.stderr | ||
doc-fixable.fixed | ||
doc-fixable.rs | ||
doc-fixable.stderr | ||
footnote_issue_13183.rs | ||
issue_902.rs | ||
issue_1832.rs | ||
issue_9473.fixed | ||
issue_9473.rs | ||
issue_9473.stderr | ||
issue_10262.fixed | ||
issue_10262.rs | ||
issue_10262.stderr | ||
issue_12795.fixed | ||
issue_12795.rs | ||
issue_12795.stderr | ||
needless_doctest_main.rs | ||
unbalanced_ticks.rs | ||
unbalanced_ticks.stderr |