Skip to content

Commit

Permalink
Use diagnostic API on Session
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Aug 4, 2018
1 parent a9093a4 commit 0ae2aa2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Expand Up @@ -965,7 +965,7 @@ impl Session {
}

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?
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_utils/codegen_backend.rs
Expand Up @@ -116,7 +116,7 @@ impl CodegenBackend for MetadataOnlyCodegenBackend {
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)
);
},
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/driver.rs
Expand Up @@ -1133,7 +1133,7 @@ where
// 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.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_passes/ast_validation.rs
Expand Up @@ -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) {
Expand Down

0 comments on commit 0ae2aa2

Please sign in to comment.