1
Fork 0

Remove Session methods that duplicate DiagCtxt methods.

Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
This commit is contained in:
Nicholas Nethercote 2023-12-18 22:21:37 +11:00
parent d51db05d7e
commit 99472c7049
298 changed files with 1806 additions and 2064 deletions

View file

@ -470,7 +470,7 @@ impl<'tcx> AdtDef<'tcx> {
Some(Discr { val: b, ty })
} else {
info!("invalid enum discriminant: {:#?}", val);
tcx.sess.emit_err(crate::error::ConstEvalNonIntError {
tcx.dcx().emit_err(crate::error::ConstEvalNonIntError {
span: tcx.def_span(expr_did),
});
None
@ -481,7 +481,7 @@ impl<'tcx> AdtDef<'tcx> {
ErrorHandled::Reported(..) => "enum discriminant evaluation failed",
ErrorHandled::TooGeneric(..) => "enum discriminant depends on generics",
};
tcx.sess.span_delayed_bug(tcx.def_span(expr_did), msg);
tcx.dcx().span_delayed_bug(tcx.def_span(expr_did), msg);
None
}
}