We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ebf5e6 commit d9087cbCopy full SHA for d9087cb
src/libcore/mem/maybe_uninit.rs
@@ -571,6 +571,7 @@ impl<T> MaybeUninit<T> {
571
#[unstable(feature = "maybe_uninit_ref", issue = "63568")]
572
#[inline(always)]
573
pub unsafe fn get_ref(&self) -> &T {
574
+ intrinsics::panic_if_uninhabited::<T>();
575
&*self.value
576
}
577
@@ -690,6 +691,7 @@ impl<T> MaybeUninit<T> {
690
691
692
693
pub unsafe fn get_mut(&mut self) -> &mut T {
694
695
&mut *self.value
696
697
0 commit comments