@@ -52,6 +52,7 @@ pub mod unit_dependencies;
5252pub mod unit_graph;
5353
5454use std:: borrow:: Cow ;
55+ use std:: cell:: OnceCell ;
5556use std:: collections:: { BTreeMap , HashMap , HashSet } ;
5657use std:: env;
5758use std:: ffi:: { OsStr , OsString } ;
@@ -66,7 +67,6 @@ use annotate_snippets::{AnnotationKind, Group, Level, Renderer, Snippet};
6667use anyhow:: { Context as _, Error } ;
6768use cargo_platform:: { Cfg , Platform } ;
6869use itertools:: Itertools ;
69- use lazycell:: LazyCell ;
7070use regex:: Regex ;
7171use tracing:: { debug, instrument, trace} ;
7272
@@ -95,6 +95,7 @@ pub use crate::core::compiler::unit::{Unit, UnitInterner};
9595use crate :: core:: manifest:: TargetSourcePath ;
9696use crate :: core:: profiles:: { PanicStrategy , Profile , StripInner } ;
9797use crate :: core:: { Feature , PackageId , Target , Verbosity } ;
98+ use crate :: util:: OnceExt ;
9899use crate :: util:: context:: WarningHandling ;
99100use crate :: util:: errors:: { CargoResult , VerboseError } ;
100101use crate :: util:: interning:: InternedString ;
@@ -1897,7 +1898,7 @@ struct OutputOptions {
18971898 /// is fresh. The file is created lazily so that in the normal case, lots
18981899 /// of empty files are not created. If this is None, the output will not
18991900 /// be cached (such as when replaying cached messages).
1900- cache_cell : Option < ( PathBuf , LazyCell < File > ) > ,
1901+ cache_cell : Option < ( PathBuf , OnceCell < File > ) > ,
19011902 /// If `true`, display any diagnostics.
19021903 /// Other types of JSON messages are processed regardless
19031904 /// of the value of this flag.
@@ -1917,7 +1918,7 @@ impl OutputOptions {
19171918 let path = build_runner. files ( ) . message_cache_path ( unit) ;
19181919 // Remove old cache, ignore ENOENT, which is the common case.
19191920 drop ( fs:: remove_file ( & path) ) ;
1920- let cache_cell = Some ( ( path, LazyCell :: new ( ) ) ) ;
1921+ let cache_cell = Some ( ( path, OnceCell :: new ( ) ) ) ;
19211922 let show_diagnostics =
19221923 build_runner. bcx . gctx . warning_handling ( ) . unwrap_or_default ( ) != WarningHandling :: Allow ;
19231924 OutputOptions {
0 commit comments