1
Fork 0

Reformat use declarations.

The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
This commit is contained in:
Nicholas Nethercote 2024-07-29 08:13:50 +10:00
parent 118f9350c5
commit 84ac80f192
1865 changed files with 8367 additions and 9199 deletions

View file

@ -33,12 +33,12 @@
//! fn baz() { foo(); }
//! ```
use crate::errors;
use rustc_ast as ast;
use std::env;
use std::fs::{self, File};
use std::io::{BufWriter, Write};
use rustc_data_structures::fx::FxIndexSet;
use rustc_data_structures::graph::implementation::{Direction, NodeIndex, INCOMING, OUTGOING};
use rustc_graphviz as dot;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID};
use rustc_hir::intravisit::{self, Visitor};
use rustc_middle::dep_graph::{
@ -49,10 +49,10 @@ use rustc_middle::ty::TyCtxt;
use rustc_middle::{bug, span_bug};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use std::env;
use std::fs::{self, File};
use std::io::{BufWriter, Write};
use tracing::debug;
use {rustc_ast as ast, rustc_graphviz as dot, rustc_hir as hir};
use crate::errors;
#[allow(missing_docs)]
pub fn assert_dep_graph(tcx: TyCtxt<'_>) {

View file

@ -1,7 +1,9 @@
use rustc_macros::Diagnostic;
use rustc_span::{symbol::Ident, Span, Symbol};
use std::path::{Path, PathBuf};
use rustc_macros::Diagnostic;
use rustc_span::symbol::Ident;
use rustc_span::{Span, Symbol};
#[derive(Diagnostic)]
#[diag(incremental_unrecognized_depnode)]
pub struct UnrecognizedDepNode {

View file

@ -12,14 +12,10 @@ mod assert_dep_graph;
mod errors;
mod persist;
pub use persist::copy_cgu_workproduct_to_incr_comp_cache_dir;
pub use persist::finalize_session_directory;
pub use persist::in_incr_comp_dir;
pub use persist::in_incr_comp_dir_sess;
pub use persist::load_query_result_cache;
pub use persist::save_dep_graph;
pub use persist::save_work_product_index;
pub use persist::setup_dep_graph;
pub use persist::LoadResult;
pub use persist::{
copy_cgu_workproduct_to_incr_comp_cache_dir, finalize_session_directory, in_incr_comp_dir,
in_incr_comp_dir_sess, load_query_result_cache, save_dep_graph, save_work_product_index,
setup_dep_graph, LoadResult,
};
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

View file

@ -19,14 +19,11 @@
//! Errors are reported if we are in the suitable configuration but
//! the required condition is not met.
use crate::errors;
use rustc_ast::{self as ast, Attribute, NestedMetaItem};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::unord::UnordSet;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::intravisit;
use rustc_hir::Node as HirNode;
use rustc_hir::{ImplItemKind, ItemKind as HirItem, TraitItemKind};
use rustc_hir::{intravisit, ImplItemKind, ItemKind as HirItem, Node as HirNode, TraitItemKind};
use rustc_middle::dep_graph::{label_strs, DepNode, DepNodeExt};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::TyCtxt;
@ -35,6 +32,8 @@ use rustc_span::Span;
use thin_vec::ThinVec;
use tracing::debug;
use crate::errors;
const LOADED_FROM_DISK: Symbol = sym::loaded_from_disk;
const EXCEPT: Symbol = sym::except;
const CFG: Symbol = sym::cfg;

View file

@ -9,18 +9,19 @@
//! compiler versions don't change frequently for the typical user, being
//! conservative here practically has no downside.
use crate::errors;
use std::borrow::Cow;
use std::io::{self, Read};
use std::path::{Path, PathBuf};
use std::{env, fs};
use rustc_data_structures::memmap::Mmap;
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
use rustc_serialize::Encoder;
use rustc_session::Session;
use std::borrow::Cow;
use std::env;
use std::fs;
use std::io::{self, Read};
use std::path::{Path, PathBuf};
use tracing::debug;
use crate::errors;
/// The first few bytes of files generated by incremental compilation.
const FILE_MAGIC: &[u8] = b"RSIC";

View file

@ -103,30 +103,27 @@
//! unsupported file system and emit a warning in that case. This is not yet
//! implemented.
use crate::errors;
use rustc_data_structures::base_n;
use rustc_data_structures::base_n::BaseNString;
use rustc_data_structures::base_n::ToBaseN;
use rustc_data_structures::base_n::CASE_INSENSITIVE;
use rustc_data_structures::flock;
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
use rustc_data_structures::svh::Svh;
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_errors::ErrorGuaranteed;
use rustc_fs_util::{link_or_copy, try_canonicalize, LinkOrCopy};
use rustc_middle::bug;
use rustc_session::config::CrateType;
use rustc_session::output::{collect_crate_types, find_crate_name};
use rustc_session::{Session, StableCrateId};
use std::fs as std_fs;
use std::io::{self, ErrorKind};
use std::path::{Path, PathBuf};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use rand::{thread_rng, RngCore};
use rustc_data_structures::base_n::{BaseNString, ToBaseN, CASE_INSENSITIVE};
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
use rustc_data_structures::svh::Svh;
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_data_structures::{base_n, flock};
use rustc_errors::ErrorGuaranteed;
use rustc_fs_util::{link_or_copy, try_canonicalize, LinkOrCopy};
use rustc_middle::bug;
use rustc_session::config::CrateType;
use rustc_session::output::{collect_crate_types, find_crate_name};
use rustc_session::{Session, StableCrateId};
use tracing::debug;
use crate::errors;
#[cfg(test)]
mod tests;

View file

@ -1,6 +1,8 @@
//! Code to load the dep-graph from files.
use crate::errors;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::unord::UnordMap;
use rustc_middle::dep_graph::{DepGraph, DepsType, SerializedDepGraph, WorkProductMap};
@ -10,15 +12,13 @@ use rustc_serialize::Decodable;
use rustc_session::config::IncrementalStateAssertion;
use rustc_session::Session;
use rustc_span::ErrorGuaranteed;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use tracing::{debug, warn};
use super::data::*;
use super::file_format;
use super::fs::*;
use super::save::build_dep_graph;
use super::work_product;
use super::{file_format, work_product};
use crate::errors;
#[derive(Debug)]
/// Represents the result of an attempt to load incremental compilation data.

View file

@ -10,12 +10,7 @@ mod load;
mod save;
mod work_product;
pub use fs::finalize_session_directory;
pub use fs::in_incr_comp_dir;
pub use fs::in_incr_comp_dir_sess;
pub use load::load_query_result_cache;
pub use load::setup_dep_graph;
pub use load::LoadResult;
pub use save::save_dep_graph;
pub use save::save_work_product_index;
pub use fs::{finalize_session_directory, in_incr_comp_dir, in_incr_comp_dir_sess};
pub use load::{load_query_result_cache, setup_dep_graph, LoadResult};
pub use save::{save_dep_graph, save_work_product_index};
pub use work_product::copy_cgu_workproduct_to_incr_comp_cache_dir;

View file

@ -1,5 +1,6 @@
use crate::assert_dep_graph::assert_dep_graph;
use crate::errors;
use std::fs;
use std::sync::Arc;
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sync::join;
use rustc_middle::dep_graph::{
@ -9,15 +10,13 @@ use rustc_middle::ty::TyCtxt;
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
use rustc_serialize::Encodable as RustcEncodable;
use rustc_session::Session;
use std::fs;
use std::sync::Arc;
use tracing::debug;
use super::data::*;
use super::dirty_clean;
use super::file_format;
use super::fs::*;
use super::work_product;
use super::{dirty_clean, file_format, work_product};
use crate::assert_dep_graph::assert_dep_graph;
use crate::errors;
/// Saves and writes the [`DepGraph`] to the file system.
///

View file

@ -2,16 +2,18 @@
//!
//! [work products]: WorkProduct
use crate::errors;
use crate::persist::fs::*;
use std::fs as std_fs;
use std::path::Path;
use rustc_data_structures::unord::UnordMap;
use rustc_fs_util::link_or_copy;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_session::Session;
use std::fs as std_fs;
use std::path::Path;
use tracing::debug;
use crate::errors;
use crate::persist::fs::*;
/// Copies a CGU work product to the incremental compilation directory, so next compilation can
/// find and reuse it.
pub fn copy_cgu_workproduct_to_incr_comp_cache_dir(