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:
parent
118f9350c5
commit
84ac80f192
1865 changed files with 8367 additions and 9199 deletions
|
@ -9,12 +9,13 @@
|
|||
//! The functions in this file should fall back to the default set in their
|
||||
//! origin crate when the `TyCtxt` is not present in TLS.
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use rustc_errors::{DiagInner, TRACK_DIAGNOSTIC};
|
||||
use rustc_middle::dep_graph::{DepNodeExt, TaskDepsRef};
|
||||
use rustc_middle::ty::tls;
|
||||
use rustc_query_system::dep_graph::dep_node::default_dep_kind_debug;
|
||||
use rustc_query_system::dep_graph::{DepContext, DepKind, DepNode};
|
||||
use std::fmt;
|
||||
|
||||
fn track_span_parent(def_id: rustc_span::def_id::LocalDefId) {
|
||||
tls::with_opt(|tcx| {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use rustc_macros::Diagnostic;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(interface_ferris_identifier)]
|
||||
pub struct FerrisIdentifier {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use crate::util;
|
||||
use std::path::PathBuf;
|
||||
use std::result;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustc_ast::token;
|
||||
use rustc_ast::{LitKind, MetaItemKind};
|
||||
use rustc_ast::{token, LitKind, MetaItemKind};
|
||||
use rustc_codegen_ssa::traits::CodegenBackend;
|
||||
use rustc_data_structures::defer;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::jobserver;
|
||||
use rustc_data_structures::stable_hasher::StableHasher;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_data_structures::{defer, jobserver};
|
||||
use rustc_errors::registry::Registry;
|
||||
use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed};
|
||||
use rustc_lint::LintStore;
|
||||
|
@ -24,11 +24,10 @@ use rustc_session::{lint, CompilerIO, EarlyDiagCtxt, Session};
|
|||
use rustc_span::source_map::{FileLoader, RealFileLoader, SourceMapInputs};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::FileName;
|
||||
use std::path::PathBuf;
|
||||
use std::result;
|
||||
use std::sync::Arc;
|
||||
use tracing::trace;
|
||||
|
||||
use crate::util;
|
||||
|
||||
pub type Result<T> = result::Result<T, ErrorGuaranteed>;
|
||||
|
||||
/// Represents a compiler session. Note that every `Compiler` contains a
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
use crate::errors;
|
||||
use crate::interface::{Compiler, Result};
|
||||
use crate::proc_macro_decls;
|
||||
use crate::util;
|
||||
use std::any::Any;
|
||||
use std::ffi::OsString;
|
||||
use std::io::{self, BufWriter, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Arc, LazyLock};
|
||||
use std::{env, fs, iter};
|
||||
|
||||
use rustc_ast::{self as ast, visit};
|
||||
use rustc_codegen_ssa::traits::CodegenBackend;
|
||||
|
@ -27,23 +29,18 @@ use rustc_resolve::Resolver;
|
|||
use rustc_session::code_stats::VTableSizeInfo;
|
||||
use rustc_session::config::{CrateType, Input, OutFileName, OutputFilenames, OutputType};
|
||||
use rustc_session::cstore::Untracked;
|
||||
use rustc_session::output::filename_for_input;
|
||||
use rustc_session::output::{collect_crate_types, find_crate_name};
|
||||
use rustc_session::output::{collect_crate_types, filename_for_input, find_crate_name};
|
||||
use rustc_session::search_paths::PathKind;
|
||||
use rustc_session::{Limit, Session};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::FileName;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
use rustc_trait_selection::traits;
|
||||
|
||||
use std::any::Any;
|
||||
use std::ffi::OsString;
|
||||
use std::io::{self, BufWriter, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Arc, LazyLock};
|
||||
use std::{env, fs, iter};
|
||||
use tracing::{info, instrument};
|
||||
|
||||
use crate::interface::{Compiler, Result};
|
||||
use crate::{errors, proc_macro_decls, util};
|
||||
|
||||
pub(crate) fn parse<'a>(sess: &'a Session) -> Result<ast::Crate> {
|
||||
let krate = sess
|
||||
.time("parse_crate", || {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::errors::FailedWritingFile;
|
||||
use crate::interface::{Compiler, Result};
|
||||
use crate::{errors, passes};
|
||||
use std::any::Any;
|
||||
use std::cell::{RefCell, RefMut};
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_codegen_ssa::traits::CodegenBackend;
|
||||
|
@ -15,9 +15,10 @@ use rustc_middle::ty::{GlobalCtxt, TyCtxt};
|
|||
use rustc_serialize::opaque::FileEncodeResult;
|
||||
use rustc_session::config::{self, OutputFilenames, OutputType};
|
||||
use rustc_session::Session;
|
||||
use std::any::Any;
|
||||
use std::cell::{RefCell, RefMut};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::errors::FailedWritingFile;
|
||||
use crate::interface::{Compiler, Result};
|
||||
use crate::{errors, passes};
|
||||
|
||||
/// Represent the result of a query.
|
||||
///
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
#![allow(rustc::bad_opt_access)]
|
||||
use crate::interface::{initialize_checked_jobserver, parse_cfg};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::num::NonZero;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustc_data_structures::profiling::TimePassesFormat;
|
||||
use rustc_errors::{emitter::HumanReadableErrorType, registry, ColorConfig};
|
||||
use rustc_session::config::{build_configuration, build_session_options, rustc_optgroups};
|
||||
use rustc_errors::emitter::HumanReadableErrorType;
|
||||
use rustc_errors::{registry, ColorConfig};
|
||||
use rustc_session::config::{
|
||||
BranchProtection, CFGuard, Cfg, CollapseMacroDebuginfo, CoverageLevel, CoverageOptions,
|
||||
DebugInfo, DumpMonoStatsFormat, ErrorOutputType,
|
||||
};
|
||||
use rustc_session::config::{
|
||||
ExternEntry, ExternLocation, Externs, FunctionReturn, InliningThreshold, Input,
|
||||
InstrumentCoverage, InstrumentXRay, LinkSelfContained, LinkerPluginLto,
|
||||
};
|
||||
use rustc_session::config::{
|
||||
LocationDetail, LtoCli, NextSolverConfig, OomStrategy, Options, OutFileName, OutputType,
|
||||
OutputTypes, PAuthKey, PacRet, Passes, PatchableFunctionEntry,
|
||||
};
|
||||
use rustc_session::config::{
|
||||
Polonius, ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion,
|
||||
WasiExecModel,
|
||||
build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg,
|
||||
CollapseMacroDebuginfo, CoverageLevel, CoverageOptions, DebugInfo, DumpMonoStatsFormat,
|
||||
ErrorOutputType, ExternEntry, ExternLocation, Externs, FunctionReturn, InliningThreshold,
|
||||
Input, InstrumentCoverage, InstrumentXRay, LinkSelfContained, LinkerPluginLto, LocationDetail,
|
||||
LtoCli, NextSolverConfig, OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey,
|
||||
PacRet, Passes, PatchableFunctionEntry, Polonius, ProcMacroExecutionStrategy, Strip,
|
||||
SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
|
||||
};
|
||||
use rustc_session::lint::Level;
|
||||
use rustc_session::search_paths::SearchPath;
|
||||
|
@ -31,10 +28,8 @@ use rustc_target::spec::{
|
|||
CodeModel, FramePointer, LinkerFlavorCli, MergeFunctions, OnBrokenPipe, PanicStrategy,
|
||||
RelocModel, RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TlsModel, WasmCAbi,
|
||||
};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::num::NonZero;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::interface::{initialize_checked_jobserver, parse_cfg};
|
||||
|
||||
fn sess_and_cfg<F>(args: &[&'static str], f: F)
|
||||
where
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
use crate::errors;
|
||||
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::OnceLock;
|
||||
use std::{env, iter, thread};
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_codegen_ssa::traits::CodegenBackend;
|
||||
#[cfg(parallel_compiler)]
|
||||
|
@ -16,14 +21,10 @@ use rustc_span::edition::Edition;
|
|||
use rustc_span::source_map::SourceMapInputs;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_target::spec::Target;
|
||||
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::OnceLock;
|
||||
use std::thread;
|
||||
use std::{env, iter};
|
||||
use tracing::info;
|
||||
|
||||
use crate::errors;
|
||||
|
||||
/// Function pointer type that constructs a new CodegenBackend.
|
||||
pub type MakeBackendFn = fn() -> Box<dyn CodegenBackend>;
|
||||
|
||||
|
@ -136,11 +137,13 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
|
|||
sm_inputs: SourceMapInputs,
|
||||
f: F,
|
||||
) -> R {
|
||||
use rustc_data_structures::{defer, jobserver, sync::FromDyn};
|
||||
use std::process;
|
||||
|
||||
use rustc_data_structures::sync::FromDyn;
|
||||
use rustc_data_structures::{defer, jobserver};
|
||||
use rustc_middle::ty::tls;
|
||||
use rustc_query_impl::QueryCtxt;
|
||||
use rustc_query_system::query::{break_query_cycles, QueryContext};
|
||||
use std::process;
|
||||
|
||||
let thread_stack_size = init_stack_size(thread_builder_diag);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue