Rename EarlyDiagCtxt methods to match DiagCtxt.
- `early_error_no_abort` -> `early_err` - `early_error` -> `early_fatal` - `early_struct_error` -> `early_struct_fatal`
This commit is contained in:
@@ -347,7 +347,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
||||
) {
|
||||
Ok(bundle) => bundle,
|
||||
Err(e) => {
|
||||
early_dcx.early_error(format!("failed to load fluent bundle: {e}"));
|
||||
early_dcx.early_fatal(format!("failed to load fluent bundle: {e}"));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -164,13 +164,13 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
|
||||
fn load_backend_from_dylib(early_dcx: &EarlyDiagCtxt, path: &Path) -> MakeBackendFn {
|
||||
let lib = unsafe { Library::new(path) }.unwrap_or_else(|err| {
|
||||
let err = format!("couldn't load codegen backend {path:?}: {err}");
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
});
|
||||
|
||||
let backend_sym = unsafe { lib.get::<MakeBackendFn>(b"__rustc_codegen_backend") }
|
||||
.unwrap_or_else(|e| {
|
||||
let err = format!("couldn't load codegen backend: {e}");
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
});
|
||||
|
||||
// Intentionally leak the dynamic library. We can't ever unload it
|
||||
@@ -271,7 +271,7 @@ fn get_codegen_sysroot(
|
||||
"failed to find a `codegen-backends` folder \
|
||||
in the sysroot candidates:\n* {candidates}"
|
||||
);
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
});
|
||||
info!("probing {} for a codegen backend", sysroot.display());
|
||||
|
||||
@@ -282,7 +282,7 @@ fn get_codegen_sysroot(
|
||||
sysroot.display(),
|
||||
e
|
||||
);
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
});
|
||||
|
||||
let mut file: Option<PathBuf> = None;
|
||||
@@ -310,7 +310,7 @@ fn get_codegen_sysroot(
|
||||
prev.display(),
|
||||
path.display()
|
||||
);
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
}
|
||||
file = Some(path.clone());
|
||||
}
|
||||
@@ -319,7 +319,7 @@ fn get_codegen_sysroot(
|
||||
Some(ref s) => load_backend_from_dylib(early_dcx, s),
|
||||
None => {
|
||||
let err = format!("unsupported builtin codegen backend `{backend_name}`");
|
||||
early_dcx.early_error(err);
|
||||
early_dcx.early_fatal(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user