Re-exportsΒ§
use std::path::Path;πuse std::path::PathBuf;πuse std::fs;πuse std::io;πuse rustc_data_structures::temp_dir::MaybeTempDir;πuse rustc_fs_util::TempDirBuilder;πuse rustc_middle::ty::TyCtxt;πuse rustc_session::Session;πuse rustc_session::config::OutFileName;πuse rustc_session::config::OutputType;πuse rustc_session::output::filename_for_metadata;πuse rustc_span::ErrorGuaranteed;πuse rustc_structures::CrateType;πuse crate::diagnostics::BinaryOutputToTty;πuse crate::diagnostics::FailedCopyToStdout;πuse crate::diagnostics::FailedCreateEncodedMetadata;πuse crate::diagnostics::FailedCreateFile;πuse crate::diagnostics::FailedCreateTempdir;πuse crate::diagnostics::FailedWriteError;πuse crate::EncodedMetadata;πuse crate::encode_metadata;π
ConstantsΒ§
FunctionsΒ§
- copy_
to_ stdout - emit_
wrapper_ file - We use a temp directory here to avoid races between concurrent rustc processes,
such as builds in the same directory using the same filename for metadata while
building an
.rlib(stomping over one another), or writing an.rmetainto a directory being searched forextern crate(observing an incomplete file). The returned path is the temporary file containing the complete metadata. - encode_
and_ write_ metadata - non_
durable_ rename - This function attempts to bypass the auto_da_alloc heuristic implemented by some filesystems such as btrfs and ext4. When renaming over a file that already exists then they will βhelpfullyβ write back the source file before committing the rename in case a developer forgot some of the fsyncs in the open/write/fsync(file)/rename/fsync(dir) dance for atomic file updates.