Skip to content

Commit 4761d5c

Browse files
committed
Fix rustdoc ICE
1 parent 6b53e88 commit 4761d5c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/safety/register_fit.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,22 @@ mod private {
1111
#[derive(PartialEq, Eq, core::marker::ConstParamTy)]
1212
pub enum TypeSize {
1313
TypeFitsInto64Bits,
14+
// FIXME: ConstParamTy variant with str ICEs in rustdoc
15+
#[cfg(not(doc))]
1416
TypeExeceeds64Bits(&'static str),
17+
#[cfg(doc)]
18+
TypeExeceeds64Bits,
1519
}
1620

1721
impl TypeSize {
1822
pub const fn check<T>() -> Self {
1923
if core::mem::size_of::<T>() <= core::mem::size_of::<u64>() {
2024
Self::TypeFitsInto64Bits
2125
} else {
22-
Self::TypeExeceeds64Bits(core::any::type_name::<T>())
26+
#[cfg(not(doc))]
27+
{ Self::TypeExeceeds64Bits(core::any::type_name::<T>()) }
28+
#[cfg(doc)]
29+
{ Self::TypeExeceeds64Bits }
2330
}
2431
}
2532
}

0 commit comments

Comments
 (0)