Skip to content

Commit ee89c31

Browse files
Add comment about InternedString not being compared lexicographically.
1 parent a27fb55 commit ee89c31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libsyntax_pos/symbol.rs

+4
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ fn with_interner<T, F: FnOnce(&mut Interner) -> T>(f: F) -> T {
348348
/// interner lives for the life of the thread, this can be safely treated as an
349349
/// immortal string, as long as it never crosses between threads.
350350
///
351+
/// CAUTION: InternedStrings are *not* compared and hashed lexicographically!
352+
/// Instead their pointer values are compared/hashed, so cast to &str
353+
/// if you need things to be stable across process boundaries.
354+
///
351355
/// FIXME(pcwalton): You must be careful about what you do in the destructors
352356
/// of objects stored in TLS, because they may run after the interner is
353357
/// destroyed. In particular, they must not access string contents. This can

0 commit comments

Comments
 (0)