From 91a2c25e2e8dc641decb04aba4e0338f199c8785 Mon Sep 17 00:00:00 2001 From: JessRudder Date: Thu, 11 Aug 2016 18:44:19 -0400 Subject: Add note to docs for &str that example is to demo internals only --- src/libstd/primitive_docs.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index de891ea8918..6a470a52aa6 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -385,6 +385,9 @@ mod prim_slice { } /// /// [`.as_ptr()`]: #method.as_ptr /// [`len()`]: #method.len +/// +/// Note: This example shows the internals of `&str`. `unsafe` should not be +/// used to get a string slice under normal circumstances. mod prim_str { } #[doc(primitive = "tuple")] -- cgit 1.4.1-3-g733a5