Skip to content

Commit 4a1466a

Browse files
committed
Sync from rust 3f28fe1
2 parents 9d98f79 + eeb3db1 commit 4a1466a

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ pub(crate) fn compile_fn(
176176
match module.define_function(codegened_func.func_id, context) {
177177
Ok(()) => {}
178178
Err(ModuleError::Compilation(CodegenError::ImplLimitExceeded)) => {
179-
let handler = rustc_session::EarlyErrorHandler::new(
179+
let early_dcx = rustc_session::EarlyDiagCtxt::new(
180180
rustc_session::config::ErrorOutputType::default(),
181181
);
182-
handler.early_error(format!(
182+
early_dcx.early_error(format!(
183183
"backend implementation limit exceeded while compiling {name}",
184184
name = codegened_func.symbol_name
185185
));

src/concurrency_limiter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl ConcurrencyLimiter {
4646
}
4747
}
4848

49-
pub(super) fn acquire(&mut self, handler: &rustc_errors::Handler) -> ConcurrencyLimiterToken {
49+
pub(super) fn acquire(&mut self, dcx: &rustc_errors::DiagCtxt) -> ConcurrencyLimiterToken {
5050
let mut state = self.state.lock().unwrap();
5151
loop {
5252
state.assert_invariants();
@@ -64,7 +64,7 @@ impl ConcurrencyLimiter {
6464
// Make sure to drop the mutex guard first to prevent poisoning the mutex.
6565
drop(state);
6666
if let Some(err) = err {
67-
handler.fatal(err);
67+
dcx.fatal(err);
6868
} else {
6969
// The error was already emitted, but compilation continued. Raise a silent
7070
// fatal error.

src/driver/aot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ pub(crate) fn run_aot(
422422
backend_config.clone(),
423423
global_asm_config.clone(),
424424
cgu.name(),
425-
concurrency_limiter.acquire(tcx.sess.diagnostic()),
425+
concurrency_limiter.acquire(tcx.sess.dcx()),
426426
),
427427
module_codegen,
428428
Some(rustc_middle::dep_graph::hash_result),

src/pretty_clif.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,8 @@ pub(crate) fn write_ir_file(
231231
let res = std::fs::File::create(clif_file_name).and_then(|mut file| write(&mut file));
232232
if let Err(err) = res {
233233
// Using early_warn as no Session is available here
234-
let handler = rustc_session::EarlyErrorHandler::new(
235-
rustc_session::config::ErrorOutputType::default(),
236-
);
234+
let handler =
235+
rustc_session::EarlyDiagCtxt::new(rustc_session::config::ErrorOutputType::default());
237236
handler.early_warn(format!("error writing ir file: {}", err));
238237
}
239238
}

0 commit comments

Comments
 (0)