Obtain an `Rc` handle to the current thread's `Symbols` instance, which will be shared between all `Symbols::get()` calls on the same thread. While this is relatively cheap, prefer caching it in e.g. `CodegenCx`, rather than calling `get()` every time a field of `Symbols` is needed.
()
| 412 | /// While this is relatively cheap, prefer caching it in e.g. `CodegenCx`, |
| 413 | /// rather than calling `get()` every time a field of `Symbols` is needed. |
| 414 | pub fn get() -> Rc<Self> { |
| 415 | thread_local!(static SYMBOLS: Rc<Symbols> = Rc::new(Symbols::new())); |
| 416 | SYMBOLS.with(Rc::clone) |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | // FIXME(eddyb) find something nicer for the error type. |
no outgoing calls
no test coverage detected