Skip to content

Commit b87619e

Browse files
committed
auto merge of #18456 : gamazeps/rust/issue18449, r=thestinger
Made the fact that rodata is a section of the executable more explicit Closes #18449
2 parents a294b35 + 4ee0c4f commit b87619e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/libcollections/str.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@
3333
//! }
3434
//! ```
3535
//!
36-
//! From the example above, you can see that Rust's string literals have the
36+
//! From the example above, you can guess that Rust's string literals have the
3737
//! `'static` lifetime. This is akin to C's concept of a static string.
38-
//!
39-
//! String literals are allocated statically in the rodata of the
40-
//! executable/library. The string then has the type `&'static str` meaning that
41-
//! the string is valid for the `'static` lifetime, otherwise known as the
42-
//! lifetime of the entire program. As can be inferred from the type, these static
43-
//! strings are not mutable.
38+
//! More precisely, string literals are immutable views with a 'static lifetime
39+
//! (otherwise known as the lifetime of the entire program), and thus have the
40+
//! type `&'static str`.
4441
//!
4542
//! # Representation
4643
//!
4744
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a
4845
//! stream of UTF-8 bytes. All strings are guaranteed to be validly encoded UTF-8
49-
//! sequences. Additionally, strings are not null-terminated and can contain null
50-
//! bytes.
46+
//! sequences. Additionally, strings are not null-terminated and can thus contain
47+
//! null bytes.
5148
//!
5249
//! The actual representation of strings have direct mappings to slices: `&str`
5350
//! is the same as `&[u8]`.

0 commit comments

Comments
 (0)