Skip to content

Commit 0ae2aa2

Browse files
Use diagnostic API on Session
1 parent a9093a4 commit 0ae2aa2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/librustc/session/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ impl Session {
965965
}
966966

967967
pub fn teach(&self, code: &DiagnosticId) -> bool {
968-
self.opts.debugging_opts.teach && self.parse_sess.span_diagnostic.must_teach(code)
968+
self.opts.debugging_opts.teach && self.diagnostic().must_teach(code)
969969
}
970970

971971
/// Are we allowed to use features from the Rust 2018 edition?

src/librustc_codegen_utils/codegen_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl CodegenBackend for MetadataOnlyCodegenBackend {
116116
match *cty {
117117
CrateType::Rlib | CrateType::Dylib | CrateType::Executable => {},
118118
_ => {
119-
sess.parse_sess.span_diagnostic.warn(
119+
sess.diagnostic().warn(
120120
&format!("LLVM unsupported, so output type {} is not supported", cty)
121121
);
122122
},

src/librustc_driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ where
11331133
// Unresolved macros might be due to mistyped `#[macro_use]`,
11341134
// so abort after checking for unknown attributes. (#49074)
11351135
if resolver.found_unresolved_macro {
1136-
sess.parse_sess.span_diagnostic.abort_if_errors();
1136+
sess.diagnostic().abort_if_errors();
11371137
}
11381138

11391139
// Lower ast -> hir.

src/librustc_passes/ast_validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct AstValidator<'a> {
3232

3333
impl<'a> AstValidator<'a> {
3434
fn err_handler(&self) -> &errors::Handler {
35-
&self.session.parse_sess.span_diagnostic
35+
&self.session.diagnostic()
3636
}
3737

3838
fn check_lifetime(&self, ident: Ident) {

0 commit comments

Comments
 (0)