Skip to content

Commit 91a2c25

Browse files
committed
Add note to docs for &str that example is to demo internals only
1 parent 11f8805 commit 91a2c25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libstd/primitive_docs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ mod prim_slice { }
385385
///
386386
/// [`.as_ptr()`]: #method.as_ptr
387387
/// [`len()`]: #method.len
388+
///
389+
/// Note: This example shows the internals of `&str`. `unsafe` should not be
390+
/// used to get a string slice under normal circumstances.
388391
mod prim_str { }
389392

390393
#[doc(primitive = "tuple")]

0 commit comments

Comments
 (0)