diff --git a/src/collections/string_pool.rs b/src/collections/string_pool.rs index fb897861609d1cef87d11cc845c627fd07d968c8..2b9f7856adfdc27897aa5027b8f5bbb8d55d1255 100644 --- a/src/collections/string_pool.rs +++ b/src/collections/string_pool.rs @@ -152,6 +152,13 @@ impl Drop for StringPool { } } +// String pool cannot be cloned, and the created `StringRef` instances remain +// allocated until the end of the program, so it is always safe to send. It is +// also sync in the sense that it becomes an immutable thing after compilation, +// but lets not derive that if we would ever become a multithreaded compiler in +// the future. +unsafe impl Send for StringPool {} + #[cfg(test)] mod tests { use super::*;