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.
std::mem::transmute_copy
debug_assert!
1 parent c9575a6 commit 3f1825aCopy full SHA for 3f1825a
library/core/src/mem/mod.rs
@@ -1053,7 +1053,7 @@ pub const fn copy<T: Copy>(x: &T) -> T {
1053
#[stable(feature = "rust1", since = "1.0.0")]
1054
#[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")]
1055
pub const unsafe fn transmute_copy<Src: ?Sized, Dst>(src: &Src) -> Dst {
1056
- assert!(
+ debug_assert!(
1057
size_of_val(src) >= size_of::<Dst>(),
1058
"cannot transmute_copy if Dst is larger than Src"
1059
);
0 commit comments