about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2024-02-14 18:56:21 -0500
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2024-02-20 01:11:16 -0500
commit377594dcedf812dab65adfe2f892a5438b780731 (patch)
treee0f46b2135a84098af82d468ae238b48131ebade
parentc50779fc78752c109d41108da0ef2b284d5a9462 (diff)
downloadrust-377594dcedf812dab65adfe2f892a5438b780731.tar.gz
rust-377594dcedf812dab65adfe2f892a5438b780731.zip
add safety text
-rw-r--r--library/core/src/fmt/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index 3c9cd093ad8..a1513515c09 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -444,6 +444,7 @@ impl<'a> Arguments<'a> {
     #[inline]
     const fn as_const_str(&self) -> Option<&'static str> {
         let s = self.as_str();
+        // SAFETY: both cases are valid as the result
         if unsafe { core::intrinsics::is_val_statically_known(s.is_some()) } { s } else { None }
     }
 }