diff options
| author | marmeladema <xademax@gmail.com> | 2020-08-30 11:41:36 +0100 |
|---|---|---|
| committer | marmeladema <xademax@gmail.com> | 2020-09-01 22:06:39 +0100 |
| commit | bd49eec3d76d5894b539a28309c2fe24f915ee94 (patch) | |
| tree | 1ef506d158751a82f981fc0455ccb38573c11d3f /compiler/rustc_interface/src/util.rs | |
| parent | eb9e7c357e26bf41c47661720e46f4498de32b83 (diff) | |
| download | rust-bd49eec3d76d5894b539a28309c2fe24f915ee94.tar.gz rust-bd49eec3d76d5894b539a28309c2fe24f915ee94.zip | |
interface: use `OnceCell` from standard library
Diffstat (limited to 'compiler/rustc_interface/src/util.rs')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index 8816ba198cf..b1b39fd1ad2 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -25,6 +25,7 @@ use rustc_span::symbol::{sym, Symbol}; use smallvec::SmallVec; use std::env; use std::io::{self, Write}; +use std::lazy::SyncOnceCell; use std::mem; use std::ops::DerefMut; use std::path::{Path, PathBuf}; @@ -243,8 +244,7 @@ pub fn get_codegen_backend(sess: &Session) -> Box<dyn CodegenBackend> { // loading, so we leave the code here. It is potentially useful for other tools // that want to invoke the rustc binary while linking to rustc as well. pub fn rustc_path<'a>() -> Option<&'a Path> { - static RUSTC_PATH: once_cell::sync::OnceCell<Option<PathBuf>> = - once_cell::sync::OnceCell::new(); + static RUSTC_PATH: SyncOnceCell<Option<PathBuf>> = SyncOnceCell::new(); const BIN_PATH: &str = env!("RUSTC_INSTALL_BINDIR"); |
