Rename EarlyErrorHandler
as EarlyDiagCtxt
.
This commit is contained in:
parent
45f347681d
commit
cce1701c4c
16 changed files with 77 additions and 88 deletions
|
@ -18,7 +18,7 @@ use rustc_query_system::query::print_query_stack;
|
|||
use rustc_session::config::{self, Cfg, CheckCfg, ExpectedValues, Input, OutFileName};
|
||||
use rustc_session::filesearch::sysroot_candidates;
|
||||
use rustc_session::parse::ParseSess;
|
||||
use rustc_session::{lint, CompilerIO, EarlyErrorHandler, Session};
|
||||
use rustc_session::{lint, CompilerIO, EarlyDiagCtxt, Session};
|
||||
use rustc_span::source_map::FileLoader;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::FileName;
|
||||
|
@ -317,7 +317,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
|||
rustc_data_structures::sync::set_dyn_thread_safe_mode(config.opts.unstable_opts.threads > 1);
|
||||
|
||||
// Check jobserver before run_in_thread_pool_with_globals, which call jobserver::acquire_thread
|
||||
let early_handler = EarlyErrorHandler::new(config.opts.error_format);
|
||||
let early_handler = EarlyDiagCtxt::new(config.opts.error_format);
|
||||
early_handler.initialize_checked_jobserver();
|
||||
|
||||
util::run_in_thread_pool_with_globals(
|
||||
|
@ -326,7 +326,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
|||
|| {
|
||||
crate::callbacks::setup_callbacks();
|
||||
|
||||
let early_handler = EarlyErrorHandler::new(config.opts.error_format);
|
||||
let early_handler = EarlyDiagCtxt::new(config.opts.error_format);
|
||||
|
||||
let codegen_backend = if let Some(make_codegen_backend) = config.make_codegen_backend {
|
||||
make_codegen_backend(&config.opts)
|
||||
|
|
|
@ -13,7 +13,7 @@ use rustc_session::config::{
|
|||
use rustc_session::lint::Level;
|
||||
use rustc_session::search_paths::SearchPath;
|
||||
use rustc_session::utils::{CanonicalizedPath, NativeLib, NativeLibKind};
|
||||
use rustc_session::{build_session, getopts, CompilerIO, EarlyErrorHandler, Session};
|
||||
use rustc_session::{build_session, getopts, CompilerIO, EarlyDiagCtxt, Session};
|
||||
use rustc_span::edition::{Edition, DEFAULT_EDITION};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{FileName, SourceFileHashAlgorithm};
|
||||
|
@ -25,7 +25,7 @@ use std::path::{Path, PathBuf};
|
|||
use std::sync::Arc;
|
||||
|
||||
fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
|
||||
let mut early_handler = EarlyErrorHandler::new(ErrorOutputType::default());
|
||||
let mut early_handler = EarlyDiagCtxt::new(ErrorOutputType::default());
|
||||
early_handler.initialize_checked_jobserver();
|
||||
|
||||
let registry = registry::Registry::new(&[]);
|
||||
|
@ -301,7 +301,7 @@ fn test_search_paths_tracking_hash_different_order() {
|
|||
let mut v3 = Options::default();
|
||||
let mut v4 = Options::default();
|
||||
|
||||
let handler = EarlyErrorHandler::new(JSON);
|
||||
let handler = EarlyDiagCtxt::new(JSON);
|
||||
const JSON: ErrorOutputType = ErrorOutputType::Json {
|
||||
pretty: false,
|
||||
json_rendered: HumanReadableErrorType::Default(ColorConfig::Never),
|
||||
|
@ -854,7 +854,7 @@ fn test_edition_parsing() {
|
|||
let options = Options::default();
|
||||
assert!(options.edition == DEFAULT_EDITION);
|
||||
|
||||
let mut handler = EarlyErrorHandler::new(ErrorOutputType::default());
|
||||
let mut handler = EarlyDiagCtxt::new(ErrorOutputType::default());
|
||||
|
||||
let matches = optgroups().parse(&["--edition=2018".to_string()]).unwrap();
|
||||
let sessopts = build_session_options(&mut handler, &matches);
|
||||
|
|
|
@ -14,7 +14,7 @@ use rustc_session::{filesearch, output, Session};
|
|||
use rustc_span::edit_distance::find_best_match_for_name;
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use session::EarlyErrorHandler;
|
||||
use session::EarlyDiagCtxt;
|
||||
use std::env;
|
||||
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
|
||||
use std::mem;
|
||||
|
@ -161,7 +161,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
|
|||
})
|
||||
}
|
||||
|
||||
fn load_backend_from_dylib(handler: &EarlyErrorHandler, path: &Path) -> MakeBackendFn {
|
||||
fn load_backend_from_dylib(handler: &EarlyDiagCtxt, path: &Path) -> MakeBackendFn {
|
||||
let lib = unsafe { Library::new(path) }.unwrap_or_else(|err| {
|
||||
let err = format!("couldn't load codegen backend {path:?}: {err}");
|
||||
handler.early_error(err);
|
||||
|
@ -185,7 +185,7 @@ fn load_backend_from_dylib(handler: &EarlyErrorHandler, path: &Path) -> MakeBack
|
|||
///
|
||||
/// A name of `None` indicates that the default backend should be used.
|
||||
pub fn get_codegen_backend(
|
||||
handler: &EarlyErrorHandler,
|
||||
handler: &EarlyDiagCtxt,
|
||||
maybe_sysroot: &Option<PathBuf>,
|
||||
backend_name: Option<&str>,
|
||||
) -> Box<dyn CodegenBackend> {
|
||||
|
@ -233,7 +233,7 @@ fn get_rustc_path_inner(bin_path: &str) -> Option<PathBuf> {
|
|||
}
|
||||
|
||||
fn get_codegen_sysroot(
|
||||
handler: &EarlyErrorHandler,
|
||||
handler: &EarlyDiagCtxt,
|
||||
maybe_sysroot: &Option<PathBuf>,
|
||||
backend_name: &str,
|
||||
) -> MakeBackendFn {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue