Skip to content

Commit 61f9356

Browse files
committed
Inline and remove LoweringContext::handler().
It has a single call site.
1 parent 8be1d25 commit 61f9356

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use rustc_data_structures::fx::FxHashMap;
5454
use rustc_data_structures::sorted_map::SortedMap;
5555
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5656
use rustc_data_structures::sync::Lrc;
57-
use rustc_errors::{DiagnosticArgFromDisplay, Handler, StashKey};
57+
use rustc_errors::{DiagnosticArgFromDisplay, StashKey};
5858
use rustc_hir as hir;
5959
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
6060
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
@@ -763,10 +763,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
763763
self.resolver.get_import_res(id).present_items()
764764
}
765765

766-
fn diagnostic(&self) -> &Handler {
767-
self.tcx.sess.diagnostic()
768-
}
769-
770766
/// Reuses the span but adds information like the kind of the desugaring and features that are
771767
/// allowed inside this span.
772768
fn mark_span_with_reason(

compiler/rustc_ast_lowering/src/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
139139

140140
// We should've returned in the for loop above.
141141

142-
self.diagnostic().span_bug(
142+
self.tcx.sess.diagnostic().span_bug(
143143
p.span,
144144
format!(
145145
"lower_qpath: no final extension segment in {}..{}",

0 commit comments

Comments
 (0)