Skip to content

Commit 377594d

Browse files
committed
add safety text
1 parent c50779f commit 377594d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/fmt/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ impl<'a> Arguments<'a> {
444444
#[inline]
445445
const fn as_const_str(&self) -> Option<&'static str> {
446446
let s = self.as_str();
447+
// SAFETY: both cases are valid as the result
447448
if unsafe { core::intrinsics::is_val_statically_known(s.is_some()) } { s } else { None }
448449
}
449450
}

0 commit comments

Comments
 (0)