Skip to content

Commit

Permalink
Inline and remove LoweringContext::handler().
Browse files Browse the repository at this point in the history
It has a single call site.
  • Loading branch information
nnethercote committed Dec 1, 2023
1 parent a3808d6 commit 40d6f9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc;
use rustc_errors::{DiagnosticArgFromDisplay, Handler, StashKey};
use rustc_errors::{DiagnosticArgFromDisplay, StashKey};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
Expand Down Expand Up @@ -729,10 +729,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
self.resolver.get_import_res(id).present_items()
}

fn diagnostic(&self) -> &Handler {
self.tcx.sess.diagnostic()
}

/// Reuses the span but adds information like the kind of the desugaring and features that are
/// allowed inside this span.
fn mark_span_with_reason(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

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

self.diagnostic().span_bug(
self.tcx.sess.diagnostic().span_bug(
p.span,
format!(
"lower_qpath: no final extension segment in {}..{}",
Expand Down

0 comments on commit 40d6f9f

Please sign in to comment.