1
Fork 0

Rename tcx.ensure() to tcx.ensure_ok()

This commit is contained in:
Zalathar 2025-01-30 16:20:09 +11:00
parent 854f22563c
commit 24cdaa146a
29 changed files with 186 additions and 160 deletions

View file

@ -317,7 +317,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
if let Some(pp_mode) = sess.opts.pretty {
if pp_mode.needs_ast_map() {
create_and_enter_global_ctxt(compiler, krate, |tcx| {
tcx.ensure().early_lint_checks(());
tcx.ensure_ok().early_lint_checks(());
pretty::print(sess, pp_mode, pretty::PrintExtra::NeedsAstMap { tcx });
passes::write_dep_info(tcx);
});
@ -365,7 +365,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
return early_exit();
}
tcx.ensure().analysis(());
tcx.ensure_ok().analysis(());
if callbacks.after_analysis(compiler, tcx) == Compilation::Stop {
return early_exit();

View file

@ -222,7 +222,7 @@ impl<'tcx> PrintExtra<'tcx> {
pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
if ppm.needs_analysis() {
ex.tcx().ensure().analysis(());
ex.tcx().ensure_ok().analysis(());
}
let (src, src_name) = get_source(sess);