Remove def_path_str.

This commit is contained in:
Camille GILLOT 2021-05-12 13:19:57 +02:00
parent eb82187b13
commit c95a5682f7
2 changed files with 2 additions and 9 deletions

View file

@ -14,7 +14,7 @@ use rustc_data_structures::sync::Lock;
use rustc_data_structures::thin_vec::ThinVec; use rustc_data_structures::thin_vec::ThinVec;
use rustc_errors::Diagnostic; use rustc_errors::Diagnostic;
use rustc_serialize::opaque; use rustc_serialize::opaque;
use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::def_id::LocalDefId;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct QueryCtxt<'tcx> { pub struct QueryCtxt<'tcx> {
@ -25,6 +25,7 @@ pub struct QueryCtxt<'tcx> {
impl<'tcx> std::ops::Deref for QueryCtxt<'tcx> { impl<'tcx> std::ops::Deref for QueryCtxt<'tcx> {
type Target = TyCtxt<'tcx>; type Target = TyCtxt<'tcx>;
#[inline]
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
&self.tcx &self.tcx
} }
@ -42,10 +43,6 @@ impl HasDepContext for QueryCtxt<'tcx> {
} }
impl QueryContext for QueryCtxt<'tcx> { impl QueryContext for QueryCtxt<'tcx> {
fn def_path_str(&self, def_id: DefId) -> String {
self.tcx.def_path_str(def_id)
}
fn current_query_job(&self) -> Option<QueryJobId<Self::DepKind>> { fn current_query_job(&self) -> Option<QueryJobId<Self::DepKind>> {
tls::with_related_context(**self, |icx| icx.query) tls::with_related_context(**self, |icx| icx.query)
} }

View file

@ -19,7 +19,6 @@ use crate::dep_graph::{DepNode, DepNodeIndex, HasDepContext, SerializedDepNodeIn
use rustc_data_structures::sync::Lock; use rustc_data_structures::sync::Lock;
use rustc_data_structures::thin_vec::ThinVec; use rustc_data_structures::thin_vec::ThinVec;
use rustc_errors::Diagnostic; use rustc_errors::Diagnostic;
use rustc_span::def_id::DefId;
use rustc_span::Span; use rustc_span::Span;
/// Description of a frame in the query stack. /// Description of a frame in the query stack.
@ -64,9 +63,6 @@ impl QueryStackFrame {
} }
pub trait QueryContext: HasDepContext { pub trait QueryContext: HasDepContext {
/// Get string representation from DefPath.
fn def_path_str(&self, def_id: DefId) -> String;
/// Get the query information from the TLS context. /// Get the query information from the TLS context.
fn current_query_job(&self) -> Option<QueryJobId<Self::DepKind>>; fn current_query_job(&self) -> Option<QueryJobId<Self::DepKind>>;