提交 0ae2aa23 编写于 作者: M Mark Rousskov

Use diagnostic API on Session

上级 a9093a4d
......@@ -965,7 +965,7 @@ pub fn codegen_units(&self) -> usize {
}
pub fn teach(&self, code: &DiagnosticId) -> bool {
self.opts.debugging_opts.teach && self.parse_sess.span_diagnostic.must_teach(code)
self.opts.debugging_opts.teach && self.diagnostic().must_teach(code)
}
/// Are we allowed to use features from the Rust 2018 edition?
......
......@@ -116,7 +116,7 @@ fn init(&self, sess: &Session) {
match *cty {
CrateType::Rlib | CrateType::Dylib | CrateType::Executable => {},
_ => {
sess.parse_sess.span_diagnostic.warn(
sess.diagnostic().warn(
&format!("LLVM unsupported, so output type {} is not supported", cty)
);
},
......
......@@ -1133,7 +1133,7 @@ pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>(
// Unresolved macros might be due to mistyped `#[macro_use]`,
// so abort after checking for unknown attributes. (#49074)
if resolver.found_unresolved_macro {
sess.parse_sess.span_diagnostic.abort_if_errors();
sess.diagnostic().abort_if_errors();
}
// Lower ast -> hir.
......
......@@ -32,7 +32,7 @@ struct AstValidator<'a> {
impl<'a> AstValidator<'a> {
fn err_handler(&self) -> &errors::Handler {
&self.session.parse_sess.span_diagnostic
&self.session.diagnostic()
}
fn check_lifetime(&self, ident: Ident) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册