}
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
- tcx.item_path_str(*self)
+ tcx.def_path_str(*self)
}
}
}
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
- tcx.item_path_str(DefId::local(*self))
+ tcx.def_path_str(DefId::local(*self))
}
}
if self.is_local() && self.index == CRATE_DEF_INDEX {
format!("top-level module")
} else {
- format!("module `{}`", tcx.item_path_str(*self))
+ format!("module `{}`", tcx.def_path_str(*self))
}
}
}
// Only external crates, if either is from a local
// module we could have false positives
if !(did1.is_local() || did2.is_local()) && did1.krate != did2.krate {
- let exp_path = self.tcx.item_path_str(did1);
- let found_path = self.tcx.item_path_str(did2);
- let exp_abs_path = self.tcx.absolute_item_path_str(did1);
- let found_abs_path = self.tcx.absolute_item_path_str(did2);
+ let exp_path = self.tcx.def_path_str(did1);
+ let found_path = self.tcx.def_path_str(did2);
+ let exp_abs_path = self.tcx.absolute_def_path_str(did1);
+ let found_abs_path = self.tcx.absolute_def_path_str(did2);
// We compare strings because DefPath can be different
// for imported and non-imported crates
if exp_path == found_path || exp_abs_path == found_abs_path {
return Some(());
}
if let &ty::Adt(def, _) = &ta.sty {
- let path_ = self.tcx.item_path_str(def.did.clone());
+ let path_ = self.tcx.def_path_str(def.did.clone());
if path_ == other_path {
self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, &other_ty);
return Some(());
let sub_no_defaults_1 = self.strip_generic_default_params(def1.did, sub1);
let sub_no_defaults_2 = self.strip_generic_default_params(def2.did, sub2);
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
- let path1 = self.tcx.item_path_str(def1.did.clone());
- let path2 = self.tcx.item_path_str(def2.did.clone());
+ let path1 = self.tcx.def_path_str(def1.did.clone());
+ let path2 = self.tcx.def_path_str(def2.did.clone());
if def1.did == def2.did {
// Easy case. Replace same types with `_` to shorten the output and highlight
// the differing ones.
if exp_is_struct && &exp_found.expected == ret_ty.skip_binder() {
let message = format!(
"did you mean `{}(/* fields */)`?",
- self.tcx.item_path_str(def_id)
+ self.tcx.def_path_str(def_id)
);
diag.span_label(span, message);
}
cause.span(&self.tcx()),
&format!(
"implementation of `{}` is not general enough",
- self.tcx().item_path_str(trait_def_id),
+ self.tcx().def_path_str(trait_def_id),
),
);
ObligationCauseCode::ItemObligation(def_id) => {
err.note(&format!(
"Due to a where-clause on `{}`,",
- self.tcx().item_path_str(def_id),
+ self.tcx().def_path_str(def_id),
));
}
_ => (),
.map_or(false, |parent_depr| parent_depr.same_origin(&depr_entry));
if !skip {
- let path = self.item_path_str(def_id);
+ let path = self.def_path_str(def_id);
let message = format!("use of deprecated item '{}'", path);
lint_deprecated(def_id,
id,
if let Some(id) = id {
if let Some(stability) = stability {
if let Some(depr) = &stability.rustc_depr {
- let path = self.item_path_str(def_id);
+ let path = self.def_path_str(def_id);
if deprecation_in_effect(&depr.since.as_str()) {
let message = format!("use of deprecated item '{}'", path);
lint_deprecated(def_id,
Base(PlaceBase::Static(box self::Static { def_id, ty })) => write!(
fmt,
"({}: {:?})",
- ty::tls::with(|tcx| tcx.item_path_str(def_id)),
+ ty::tls::with(|tcx| tcx.def_path_str(def_id)),
ty
),
Base(PlaceBase::Promoted(ref promoted)) => write!(
}
// print function definitions
if let FnDef(did, _) = ty.sty {
- return write!(f, "{}", item_path_str(did));
+ return write!(f, "{}", def_path_str(did));
}
// print string literals
if let ConstValue::Slice(ptr, len) = value {
write!(f, "{:?}:{}", value, ty)
}
-fn item_path_str(def_id: DefId) -> String {
- ty::tls::with(|tcx| tcx.item_path_str(def_id))
+fn def_path_str(def_id: DefId) -> String {
+ ty::tls::with(|tcx| tcx.def_path_str(def_id))
}
impl<'tcx> graph::DirectedGraph for Mir<'tcx> {
let span = self.sess.source_map().def_span(span);
let mut err = struct_span_err!(self.sess, span, E0072,
"recursive type `{}` has infinite size",
- self.item_path_str(type_def_id));
+ self.def_path_str(type_def_id));
err.span_label(span, "recursive type has infinite size");
err.help(&format!("insert indirection (e.g., a `Box`, `Rc`, or `&`) \
at some point to make `{}` representable",
- self.item_path_str(type_def_id)));
+ self.def_path_str(type_def_id)));
err
}
violations: Vec<ObjectSafetyViolation>)
-> DiagnosticBuilder<'tcx>
{
- let trait_str = self.item_path_str(trait_def_id);
+ let trait_str = self.def_path_str(trait_def_id);
let span = self.sess.source_map().def_span(span);
let mut err = struct_span_err!(
self.sess, span, E0038,
region, object_ty));
}
ObligationCauseCode::ItemObligation(item_def_id) => {
- let item_name = tcx.item_path_str(item_def_id);
+ let item_name = tcx.def_path_str(item_def_id);
let msg = format!("required by `{}`", item_name);
if let Some(sp) = tcx.hir().span_if_local(item_def_id) {
) -> bool {
debug!("type_known_to_meet_bound_modulo_regions(ty={:?}, bound={:?})",
ty,
- infcx.tcx.item_path_str(def_id));
+ infcx.tcx.def_path_str(def_id));
let trait_ref = ty::TraitRef {
def_id,
let result = infcx.predicate_must_hold_modulo_regions(&obligation);
debug!("type_known_to_meet_ty={:?} bound={} => {:?}",
- ty, infcx.tcx.item_path_str(def_id), result);
+ ty, infcx.tcx.def_path_str(def_id), result);
if result && (ty.has_infer_types() || ty.has_closure_types()) {
// Because of inference "guessing", selection can sometimes claim
Ok(()) => {
debug!("type_known_to_meet_bound_modulo_regions: ty={:?} bound={} success",
ty,
- infcx.tcx.item_path_str(def_id));
+ infcx.tcx.def_path_str(def_id));
true
}
Err(e) => {
debug!("type_known_to_meet_bound_modulo_regions: ty={:?} bound={} errors={:?}",
ty,
- infcx.tcx.item_path_str(def_id),
+ infcx.tcx.def_path_str(def_id),
e);
false
}
hir::CRATE_HIR_ID,
*span,
&format!("the trait `{}` cannot be made into an object",
- self.item_path_str(trait_def_id)),
+ self.def_path_str(trait_def_id)),
&violation.error_msg());
false
} else {
-> String
{
let name = tcx.item_name(trait_ref.def_id);
- let trait_str = tcx.item_path_str(trait_ref.def_id);
+ let trait_str = tcx.def_path_str(trait_ref.def_id);
let generics = tcx.generics_of(trait_ref.def_id);
let generic_map = generics.params.iter().filter_map(|param| {
let value = match param.kind {
// should have failed in astconv.
bug!("No associated type `{}` for {}",
assoc_ty_name,
- tcx.item_path_str(impl_def_id))
+ tcx.def_path_str(impl_def_id))
}
}
Traits(values) => ty::tls::with(|tcx| {
report_maybe_different(f,
&format!("trait `{}`",
- tcx.item_path_str(values.expected)),
+ tcx.def_path_str(values.expected)),
&format!("trait `{}`",
- tcx.item_path_str(values.found)))
+ tcx.def_path_str(values.found)))
}),
IntMismatch(ref values) => {
write!(f, "expected `{:?}`, found `{:?}`",
}
ProjectionMismatched(ref values) => ty::tls::with(|tcx| {
write!(f, "expected {}, found {}",
- tcx.item_path_str(values.expected),
- tcx.item_path_str(values.found))
+ tcx.def_path_str(values.expected),
+ tcx.def_path_str(values.found))
}),
ProjectionBoundsLength(ref values) => {
write!(f, "expected {} associated type bindings, found {}",
ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => self.to_string().into(),
ty::Tuple(ref tys) if tys.is_empty() => self.to_string().into(),
- ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.item_path_str(def.did)).into(),
- ty::Foreign(def_id) => format!("extern type `{}`", tcx.item_path_str(def_id)).into(),
+ ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(),
+ ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(),
ty::Array(_, n) => match n {
ty::LazyConst::Evaluated(n) => match n.assert_usize(tcx) {
Some(n) => format!("array of {} elements", n).into(),
ty::FnPtr(_) => "fn pointer".into(),
ty::Dynamic(ref inner, ..) => {
if let Some(principal) = inner.principal() {
- format!("trait {}", tcx.item_path_str(principal.def_id())).into()
+ format!("trait {}", tcx.def_path_str(principal.def_id())).into()
} else {
"trait".into()
}
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = Cell::new(false);
}
-/// Enforces that item_path_str always returns an absolute path and
+/// Enforces that def_path_str always returns an absolute path and
/// also enables "type-based" impl paths. This is used when building
/// symbols that contain types, where we want the crate name to be
/// part of the symbol.
}
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
- // HACK(eddyb) get rid of `item_path_str` and/or pass `Namespace` explicitly always
+ // HACK(eddyb) get rid of `def_path_str` and/or pass `Namespace` explicitly always
// (but also some things just print a `DefId` generally so maybe we need this?)
fn guess_def_namespace(self, def_id: DefId) -> Namespace {
match self.def_key(def_id).disambiguated_data.data {
/// Returns a string identifying this `DefId`. This string is
/// suitable for user output. It is relative to the current crate
/// root, unless with_forced_absolute_paths was used.
- pub fn item_path_str_with_substs_and_ns(
+ pub fn def_path_str_with_substs_and_ns(
self,
def_id: DefId,
substs: Option<SubstsRef<'tcx>>,
ns: Namespace,
) -> String {
- debug!("item_path_str: def_id={:?}, substs={:?}, ns={:?}", def_id, substs, ns);
+ debug!("def_path_str: def_id={:?}, substs={:?}, ns={:?}", def_id, substs, ns);
if FORCE_ABSOLUTE.with(|force| force.get()) {
- PrintCx::new(self, AbsolutePathPrinter).print_item_path(def_id, substs, ns)
+ PrintCx::new(self, AbsolutePathPrinter).print_def_path(def_id, substs, ns)
} else {
- PrintCx::new(self, LocalPathPrinter).print_item_path(def_id, substs, ns)
+ PrintCx::new(self, LocalPathPrinter).print_def_path(def_id, substs, ns)
}
}
/// Returns a string identifying this def-id. This string is
/// suitable for user output. It is relative to the current crate
/// root, unless with_forced_absolute_paths was used.
- pub fn item_path_str(self, def_id: DefId) -> String {
+ pub fn def_path_str(self, def_id: DefId) -> String {
let ns = self.guess_def_namespace(def_id);
- self.item_path_str_with_substs_and_ns(def_id, None, ns)
+ self.def_path_str_with_substs_and_ns(def_id, None, ns)
}
/// Returns a string identifying this local node-id.
pub fn node_path_str(self, id: ast::NodeId) -> String {
- self.item_path_str(self.hir().local_def_id(id))
+ self.def_path_str(self.hir().local_def_id(id))
}
/// Returns a string identifying this def-id. This string is
/// suitable for user output. It always begins with a crate identifier.
- pub fn absolute_item_path_str(self, def_id: DefId) -> String {
- debug!("absolute_item_path_str: def_id={:?}", def_id);
+ pub fn absolute_def_path_str(self, def_id: DefId) -> String {
+ debug!("absolute_def_path_str: def_id={:?}", def_id);
let ns = self.guess_def_namespace(def_id);
- PrintCx::new(self, AbsolutePathPrinter).print_item_path(def_id, None, ns)
+ PrintCx::new(self, AbsolutePathPrinter).print_def_path(def_id, None, ns)
}
}
impl<P: ItemPathPrinter> PrintCx<'a, 'gcx, 'tcx, P> {
- pub fn default_print_item_path(
+ pub fn default_print_def_path(
&mut self,
def_id: DefId,
substs: Option<SubstsRef<'tcx>>,
ns: Namespace,
) -> P::Path {
- debug!("default_print_item_path: def_id={:?}, substs={:?}, ns={:?}", def_id, substs, ns);
+ debug!("default_print_def_path: def_id={:?}, substs={:?}, ns={:?}", def_id, substs, ns);
let key = self.tcx.def_key(def_id);
- debug!("default_print_item_path: key={:?}", key);
+ debug!("default_print_def_path: key={:?}", key);
match key.disambiguated_data.data {
DefPathData::CrateRoot => {
assert!(key.parent.is_none());
data @ DefPathData::ImplTrait |
data @ DefPathData::GlobalMetaData(..) => {
let parent_did = self.tcx.parent(def_id).unwrap();
- let path = self.print_item_path(parent_did, None, ns);
+ let path = self.print_def_path(parent_did, None, ns);
self.path_append(path, &data.as_interned_str().as_symbol().as_str())
},
DefPathData::StructCtor => { // present `X` instead of `X::{{constructor}}`
let parent_def_id = self.tcx.parent(def_id).unwrap();
- self.print_item_path(parent_def_id, substs, ns)
+ self.print_def_path(parent_def_id, substs, ns)
}
}
}
// If the impl is not co-located with either self-type or
// trait-type, then fallback to a format that identifies
// the module more clearly.
- let path = self.print_item_path(parent_def_id, None, ns);
+ let path = self.print_def_path(parent_def_id, None, ns);
if let Some(trait_ref) = impl_trait_ref {
return self.path_append(path, &format!("<impl {} for {}>", trait_ref, self_ty));
} else {
match self_ty.sty {
ty::Adt(adt_def, substs) => {
// FIXME(eddyb) this should recurse to build the path piecewise.
- // self.print_item_path(adt_def.did, Some(substs), ns)
+ // self.print_def_path(adt_def.did, Some(substs), ns)
let mut s = String::new();
crate::util::ppaux::parameterized(&mut s, adt_def.did, substs, ns).unwrap();
self.path_impl(&s)
}
- ty::Foreign(did) => self.print_item_path(did, None, ns),
+ ty::Foreign(did) => self.print_def_path(did, None, ns),
ty::Bool |
ty::Char |
pub trait ItemPathPrinter: Sized {
type Path;
- fn print_item_path(
+ fn print_def_path(
self: &mut PrintCx<'_, '_, 'tcx, Self>,
def_id: DefId,
substs: Option<SubstsRef<'tcx>>,
ns: Namespace,
) -> Self::Path {
- self.default_print_item_path(def_id, substs, ns)
+ self.default_print_def_path(def_id, substs, ns)
}
fn print_impl_path(
self: &mut PrintCx<'_, '_, 'tcx, Self>,
/// If possible, this returns a global path resolving to `def_id` that is visible
/// from at least one local module and returns true. If the crate defining `def_id` is
/// declared with an `extern crate`, the path is guaranteed to use the `extern crate`.
- fn try_print_visible_item_path(
+ fn try_print_visible_def_path(
self: &mut PrintCx<'_, '_, '_, Self>,
def_id: DefId,
ns: Namespace,
) -> Option<<Self as ItemPathPrinter>::Path> {
- debug!("try_print_visible_item_path: def_id={:?}", def_id);
+ debug!("try_print_visible_def_path: def_id={:?}", def_id);
// If `def_id` is a direct or injected extern crate, return the
// path to the crate followed by the path to the item within the crate.
span,
..
}) => {
- debug!("try_print_visible_item_path: def_id={:?}", def_id);
+ debug!("try_print_visible_def_path: def_id={:?}", def_id);
let path = if !span.is_dummy() {
- self.print_item_path(def_id, None, ns)
+ self.print_def_path(def_id, None, ns)
} else {
self.path_crate(cnum)
};
let visible_parent_map = self.tcx.visible_parent_map(LOCAL_CRATE);
let mut cur_def_key = self.tcx.def_key(def_id);
- debug!("try_print_visible_item_path: cur_def_key={:?}", cur_def_key);
+ debug!("try_print_visible_def_path: cur_def_key={:?}", cur_def_key);
// For a UnitStruct or TupleStruct we want the name of its parent rather than <unnamed>.
if let DefPathData::StructCtor = cur_def_key.disambiguated_data.data {
}
let visible_parent = visible_parent_map.get(&def_id).cloned()?;
- let path = self.try_print_visible_item_path(visible_parent, ns)?;
+ let path = self.try_print_visible_def_path(visible_parent, ns)?;
let actual_parent = self.tcx.parent(def_id);
let data = cur_def_key.disambiguated_data.data;
debug!(
- "try_print_visible_item_path: data={:?} visible_parent={:?} actual_parent={:?}",
+ "try_print_visible_def_path: data={:?} visible_parent={:?} actual_parent={:?}",
data, visible_parent, actual_parent,
);
})
},
};
- debug!("try_print_visible_item_path: symbol={:?}", symbol);
+ debug!("try_print_visible_def_path: symbol={:?}", symbol);
Some(self.path_append(path, &symbol))
}
}
impl ItemPathPrinter for LocalPathPrinter {
type Path = String;
- fn print_item_path(
+ fn print_def_path(
self: &mut PrintCx<'_, '_, 'tcx, Self>,
def_id: DefId,
substs: Option<SubstsRef<'tcx>>,
ns: Namespace,
) -> Self::Path {
- self.try_print_visible_item_path(def_id, ns)
- .unwrap_or_else(|| self.default_print_item_path(def_id, substs, ns))
+ self.try_print_visible_def_path(def_id, ns)
+ .unwrap_or_else(|| self.default_print_def_path(def_id, substs, ns))
}
fn print_impl_path(
self: &mut PrintCx<'_, '_, 'tcx, Self>,
// only occur very early in the compiler pipeline.
// FIXME(eddyb) this should just be using `tcx.def_span(impl_def_id)`
let parent_def_id = self.tcx.parent(impl_def_id).unwrap();
- let path = self.print_item_path(parent_def_id, None, ns);
+ let path = self.print_def_path(parent_def_id, None, ns);
let span = self.tcx.def_span(impl_def_id);
return self.path_append(path, &format!("<impl at {:?}>", span));
}
}
// This is here instead of layout because the choice must make it into metadata.
- if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.item_path_str(did))) {
+ if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.def_path_str(did))) {
flags.insert(ReprFlags::IS_LINEAR);
}
ReprOptions { int: size, align: max_align, pack: min_pack, flags: flags }
impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
default fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
if !tcx.sess.verbose() {
- format!("processing `{}`", tcx.item_path_str(def_id)).into()
+ format!("processing `{}`", tcx.def_path_str(def_id)).into()
} else {
let name = unsafe { ::std::intrinsics::type_name::<M>() };
format!("processing {:?} with query `{}`", def_id, name).into()
impl<'tcx> QueryDescription<'tcx> for queries::super_predicates_of<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
format!("computing the supertraits of `{}`",
- tcx.item_path_str(def_id)).into()
+ tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::coherent_trait<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
format!("coherence checking all impls of trait `{}`",
- tcx.item_path_str(def_id)).into()
+ tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::mir_shims<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> Cow<'static, str> {
format!("generating MIR shim for `{}`",
- tcx.item_path_str(def.def_id())).into()
+ tcx.def_path_str(def.def_id())).into()
}
}
) -> Cow<'static, str> {
format!(
"const-evaluating + checking `{}`",
- tcx.item_path_str(key.value.instance.def.def_id()),
+ tcx.def_path_str(key.value.instance.def.def_id()),
).into()
}
fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
-> Cow<'static, str>
{
- format!("const-evaluating `{}`", tcx.item_path_str(key.value.instance.def.def_id())).into()
+ format!("const-evaluating `{}`", tcx.def_path_str(key.value.instance.def.def_id())).into()
}
#[inline]
impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_static<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
format!("const checking if rvalue is promotable to static `{}`",
- tcx.item_path_str(def_id)).into()
+ tcx.def_path_str(def_id)).into()
}
#[inline]
impl<'tcx> QueryDescription<'tcx> for queries::rvalue_promotable_map<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
format!("checking which parts of `{}` are promotable to static",
- tcx.item_path_str(def_id)).into()
+ tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::is_mir_available<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
format!("checking if item is mir available: `{}`",
- tcx.item_path_str(def_id)).into()
+ tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>,
key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> Cow<'static, str> {
- format!("checking if `{}` fulfills its obligations", tcx.item_path_str(key.1.def_id()))
+ format!("checking if `{}` fulfills its obligations", tcx.def_path_str(key.1.def_id()))
.into()
}
impl<'tcx> QueryDescription<'tcx> for queries::trait_impls_of<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
- format!("trait impls of `{}`", tcx.item_path_str(def_id)).into()
+ format!("trait impls of `{}`", tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::is_object_safe<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
- format!("determine object safety of trait `{}`", tcx.item_path_str(def_id)).into()
+ format!("determine object safety of trait `{}`", tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::is_const_fn_raw<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> {
- format!("checking if item is const fn: `{}`", tcx.item_path_str(def_id)).into()
+ format!("checking if item is const fn: `{}`", tcx.def_path_str(def_id)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::vtable_methods<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::PolyTraitRef<'tcx> ) -> Cow<'static, str> {
- format!("finding all methods for trait {}", tcx.item_path_str(key.def_id())).into()
+ format!("finding all methods for trait {}", tcx.def_path_str(key.def_id())).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, key: (DefId, SubstsRef<'tcx>)) -> Cow<'static, str> {
- format!("testing substituted normalized predicates:`{}`", tcx.item_path_str(key.0)).into()
+ format!("testing substituted normalized predicates:`{}`", tcx.def_path_str(key.0)).into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> Cow<'static, str> {
- format!("estimating size for `{}`", tcx.item_path_str(def.def_id())).into()
+ format!("estimating size for `{}`", tcx.def_path_str(def.def_id())).into()
}
}
// FIXME(eddyb) recurse through printing a path via `self`, instead
// instead of using the `tcx` method that produces a `String`.
print!(self, write("{}",
- self.tcx.item_path_str_with_substs_and_ns(def_id, Some(substs), ns)))?;
+ self.tcx.def_path_str_with_substs_and_ns(def_id, Some(substs), ns)))?;
// For impls, the above call already prints relevant generics args.
if let DefPathData::Impl = key.disambiguated_data.data {
if let Tuple(ref args) = principal.substs.type_at(0).sty {
let mut projections = self.projection_bounds();
if let (Some(proj), None) = (projections.next(), projections.next()) {
- print!(cx, write("{}", cx.tcx.item_path_str(principal.def_id)))?;
+ print!(cx, write("{}", cx.tcx.def_path_str(principal.def_id)))?;
cx.fn_sig(args, false, proj.ty)?;
resugared_principal = true;
}
// Builtin bounds.
let mut auto_traits: Vec<_> = self.auto_traits().map(|did| {
- cx.tcx.item_path_str(did)
+ cx.tcx.def_path_str(did)
}).collect();
// The auto traits come ordered by `DefPathHash`. While
impl fmt::Debug for ty::TraitDef {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
PrintCx::with(FmtPrinter { fmt: f }, |cx| {
- print!(cx, write("{}", cx.tcx.item_path_str(self.def_id)))
+ print!(cx, write("{}", cx.tcx.def_path_str(self.def_id)))
})
}
}
impl fmt::Debug for ty::AdtDef {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
PrintCx::with(FmtPrinter { fmt: f }, |cx| {
- print!(cx, write("{}", cx.tcx.item_path_str(self.did)))
+ print!(cx, write("{}", cx.tcx.def_path_str(self.did)))
})
}
}
ty::Predicate::WellFormed(ty) => print!(cx, print(ty), write(" well-formed")),
ty::Predicate::ObjectSafe(trait_def_id) => {
print!(cx, write("the trait `{}` is object-safe",
- cx.tcx.item_path_str(trait_def_id)))
+ cx.tcx.def_path_str(trait_def_id)))
}
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
print!(cx, write("the closure `{}` implements the trait `{}`",
- cx.tcx.item_path_str(closure_def_id), kind))
+ cx.tcx.def_path_str(closure_def_id), kind))
}
ty::Predicate::ConstEvaluatable(def_id, substs) => {
print!(cx, write("the constant `"))?;
out.push('(');
self.append_loan_path_to_string(&lp_base, out);
out.push_str(DOWNCAST_PRINTED_OPERATOR);
- out.push_str(&self.tcx.item_path_str(variant_def_id));
+ out.push_str(&self.tcx.def_path_str(variant_def_id));
out.push(')');
}
out.push('(');
self.append_autoderefd_loan_path_to_string(&lp_base, out);
out.push_str(DOWNCAST_PRINTED_OPERATOR);
- out.push_str(&self.tcx.item_path_str(variant_def_id));
+ out.push_str(&self.tcx.def_path_str(variant_def_id));
out.push(')');
}
LpDowncast(ref lp, variant_def_id) => {
let variant_str = if variant_def_id.is_local() {
- ty::tls::with(|tcx| tcx.item_path_str(variant_def_id))
+ ty::tls::with(|tcx| tcx.def_path_str(variant_def_id))
} else {
format!("{:?}", variant_def_id)
};
LpDowncast(ref lp, variant_def_id) => {
let variant_str = if variant_def_id.is_local() {
- ty::tls::with(|tcx| tcx.item_path_str(variant_def_id))
+ ty::tls::with(|tcx| tcx.def_path_str(variant_def_id))
} else {
format!("{:?}", variant_def_id)
};
fn def_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> ty::SymbolName {
item_path::with_forced_absolute_paths(|| {
PrintCx::new(tcx, SymbolPathPrinter)
- .print_item_path(def_id, None, Namespace::ValueNS)
+ .print_def_path(def_id, None, Namespace::ValueNS)
.into_interned()
})
}
//! Walks the crate looking for items/impl-items/trait-items that have
-//! either a `rustc_symbol_name` or `rustc_item_path` attribute and
+//! either a `rustc_symbol_name` or `rustc_def_path` attribute and
//! generates an error giving, respectively, the symbol name or
-//! item-path. This is used for unit testing the code that generates
+//! def-path. This is used for unit testing the code that generates
//! paths etc in all kinds of annoying scenarios.
use rustc::hir;
use rustc_mir::monomorphize::Instance;
const SYMBOL_NAME: &'static str = "rustc_symbol_name";
-const ITEM_PATH: &'static str = "rustc_item_path";
+const DEF_PATH: &'static str = "rustc_def_path";
pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
// if the `rustc_attrs` feature is not enabled, then the
let instance = Instance::mono(tcx, def_id);
let name = self.tcx.symbol_name(instance);
tcx.sess.span_err(attr.span, &format!("symbol-name({})", name));
- } else if attr.check_name(ITEM_PATH) {
- let path = tcx.item_path_str(def_id);
- tcx.sess.span_err(attr.span, &format!("item-path({})", path));
+ } else if attr.check_name(DEF_PATH) {
+ let path = tcx.def_path_str(def_id);
+ tcx.sess.span_err(attr.span, &format!("def-path({})", path));
}
// (*) The formatting of `tag({})` is chosen so that tests can elect
tcx.sess.span_err(
target_span,
&format!("no path from `{}` to `{}`",
- tcx.item_path_str(source_def_id),
+ tcx.def_path_str(source_def_id),
target_pass));
} else {
tcx.sess.span_err(
if let Some(def_id) = dep_node.extract_def_id(self.tcx) {
format!("{:?}({})",
dep_node.kind,
- self.tcx.item_path_str(def_id))
+ self.tcx.def_path_str(def_id))
} else {
format!("{:?}({:?})", dep_node.kind, dep_node.hash)
}
for attr in cx.tcx.get_attrs(def_id).iter() {
if attr.check_name("must_use") {
let msg = format!("unused {}`{}`{} that must be used",
- descr_pre_path, cx.tcx.item_path_str(def_id), descr_post_path);
+ descr_pre_path, cx.tcx.def_path_str(def_id), descr_post_path);
let mut err = cx.struct_span_lint(UNUSED_MUST_USE, sp, &msg);
// check for #[must_use = "..."]
if let Some(note) = attr.value_str() {
fn mir_borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> BorrowCheckResult<'tcx> {
let input_mir = tcx.mir_validated(def_id);
- debug!("run query mir_borrowck: {}", tcx.item_path_str(def_id));
+ debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id));
let mut return_early;
// simplify output by reporting just the ADT name.
ty::Adt(adt, _substs) if adt.has_dtor(tcx) && !adt.is_box() => (
"`Drop` code",
- format!("type `{}`", tcx.item_path_str(adt.did)),
+ format!("type `{}`", tcx.def_path_str(adt.did)),
),
// Otherwise, just report the whole type (and use
assert!(!layout.is_unsized());
let ret = ecx.allocate(layout, MemoryKind::Stack);
- let name = ty::tls::with(|tcx| tcx.item_path_str(cid.instance.def_id()));
+ let name = ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id()));
let prom = cid.promoted.map_or(String::new(), |p| format!("::promoted[{:?}]", p));
trace!("eval_body_using_ecx: pushing stack frame for global: {}{}", name, prom);
assert!(mir.arg_count == 0);
if edef.is_enum() && edef.variants.iter().any(|variant| {
variant.ident == ident && variant.ctor_kind == CtorKind::Const
}) {
- let ty_path = cx.tcx.item_path_str(edef.did);
+ let ty_path = cx.tcx.def_path_str(edef.did);
let mut err = struct_span_warn!(cx.tcx.sess, p.span, E0170,
"pattern binding `{}` is named the same as one \
of the variants of the type `{}`",
ty::Adt(adt_def, _) if !self.tcx.has_attr(adt_def.did, "structural_match") => {
let msg = format!("to use a constant of type `{}` in a pattern, \
`{}` must be annotated with `#[derive(PartialEq, Eq)]`",
- self.tcx.item_path_str(adt_def.did),
- self.tcx.item_path_str(adt_def.did));
+ self.tcx.def_path_str(adt_def.did),
+ self.tcx.def_path_str(adt_def.did));
self.tcx.sess.span_err(span, &msg);
PatternKind::Wild
}
ty::InstanceDef::Item(def_id) => if self.tcx.is_mir_available(did) {
Ok(self.tcx.optimized_mir(did))
} else {
- err!(NoMirFor(self.tcx.item_path_str(def_id)))
+ err!(NoMirFor(self.tcx.def_path_str(def_id)))
},
_ => Ok(self.tcx.instance_mir(instance)),
}
if !self.span.allows_unstable(&feature.as_str()) {
let mut err = self.tcx.sess.struct_span_err(self.span,
&format!("`{}` is not yet stable as a const fn",
- self.tcx.item_path_str(def_id)));
+ self.tcx.def_path_str(def_id)));
if nightly_options::is_nightly_build() {
help!(&mut err,
"add `#![feature({})]` to the \
let def_id = src.def_id();
let id = tcx.hir().as_local_hir_id(def_id).unwrap();
if !tcx.has_attr(def_id, "rustc_mir") {
- debug!("skipping rustc_peek::SanityCheck on {}", tcx.item_path_str(def_id));
+ debug!("skipping rustc_peek::SanityCheck on {}", tcx.def_path_str(def_id));
return;
} else {
- debug!("running rustc_peek::SanityCheck on {}", tcx.item_path_str(def_id));
+ debug!("running rustc_peek::SanityCheck on {}", tcx.def_path_str(def_id));
}
let attributes = tcx.get_attrs(def_id);
mir: &Mir<'_>,
w: &mut W)
-> io::Result<()> {
- write!(w, " label=<fn {}(", dot::escape_html(&tcx.item_path_str(def_id)))?;
+ write!(w, " label=<fn {}(", dot::escape_html(&tcx.def_path_str(def_id)))?;
// fn argument types.
for (i, arg) in mir.args_iter().enumerate() {
}
let node_path = item_path::with_forced_impl_filename_line(|| {
// see notes on #41697 below
- tcx.item_path_str(source.def_id())
+ tcx.def_path_str(source.def_id())
});
dump_matched_mir_node(tcx, pass_name, &node_path, source, mir, result);
}
let node_path = item_path::with_forced_impl_filename_line(|| {
// see notes on #41697 below
- tcx.item_path_str(source.def_id())
+ tcx.def_path_str(source.def_id())
});
dump_matched_mir_node(
tcx,
};
let node_path = item_path::with_forced_impl_filename_line(|| {
// see notes on #41697 below
- tcx.item_path_str(source.def_id())
+ tcx.def_path_str(source.def_id())
});
filters.split('|').any(|or_filter| {
or_filter.split('&').all(|and_filter| {
}
// #41697 -- we use `with_forced_impl_filename_line()` because
-// `item_path_str()` would otherwise trigger `type_of`, and this can
+// `def_path_str()` would otherwise trigger `type_of`, and this can
// run while we are already attempting to evaluate `type_of`.
fn dump_matched_mir_node<'a, 'gcx, 'tcx, F>(
item_path::with_forced_impl_filename_line(|| {
// see notes on #41697 elsewhere
- write!(w, "{}", tcx.item_path_str(src.def_id()))
+ write!(w, " {}", tcx.def_path_str(src.def_id()))
})?;
if src.promoted.is_none() && is_function {
let def_id = self.tcx.adjust_ident(ident, def.did, current_hir).1;
if !def.is_enum() && !field.vis.is_accessible_from(def_id, self.tcx) {
struct_span_err!(self.tcx.sess, span, E0451, "field `{}` of {} `{}` is private",
- field.ident, def.variant_descr(), self.tcx.item_path_str(def.did))
+ field.ident, def.variant_descr(), self.tcx.def_path_str(def.did))
.span_label(span, format!("field `{}` is private", field.ident))
.emit();
}
if let Some(def_id) = trait_id {
// A method in a trait impl.
qualname.push_str(" as ");
- qualname.push_str(&self.tcx.item_path_str(def_id));
+ qualname.push_str(&self.tcx.def_path_str(def_id));
self.tcx
.associated_items(def_id)
.find(|item| item.ident.name == ident.name)
}
(
- format!("::{}", self.tcx.item_path_str(def_id)),
+ format!("::{}", self.tcx.def_path_str(def_id)),
Some(def_id),
None,
docs,
"the value of the associated type `{}` (from the trait `{}`) \
is already specified",
binding.item_name,
- tcx.item_path_str(assoc_ty.container.id()))
+ tcx.def_path_str(assoc_ty.container.id()))
.span_label(binding.span, "re-bound here")
.span_label(*prev_span, format!("`{}` bound here first", binding.item_name))
.emit();
format!(
"`{}` (from the trait `{}`)",
assoc_item.ident,
- tcx.item_path_str(trait_def_id),
+ tcx.def_path_str(trait_def_id),
)
}).collect::<Vec<_>>().join(", ");
let mut err = struct_span_err!(
let self_ty = if let Some(ty) = opt_self_ty {
ty
} else {
- let path_str = tcx.item_path_str(trait_def_id);
+ let path_str = tcx.def_path_str(trait_def_id);
self.report_ambiguous_associated_type(span,
"Type",
&path_str,
E0026,
"{} `{}` does not have {}",
kind_name,
- tcx.item_path_str(variant.did),
+ tcx.def_path_str(variant.did),
field_names);
if let Some((span, ident)) = inexistent_fields.last() {
err.span_label(*span,
format!("{} `{}` does not have {} field{}",
kind_name,
- tcx.item_path_str(variant.did),
+ tcx.def_path_str(variant.did),
t,
plural));
if plural == "" {
trait `{}` has {}",
trait_m.ident,
potentially_plural_count(impl_number_args, "parameter"),
- tcx.item_path_str(trait_m.def_id),
+ tcx.def_path_str(trait_m.def_id),
trait_number_args);
if let Some(trait_span) = trait_span {
err.span_label(trait_span, format!("trait requires {}",
let sole_field = &variant.fields[0];
let sole_field_ty = sole_field.ty(self.tcx, substs);
if self.can_coerce(expr_ty, sole_field_ty) {
- let variant_path = self.tcx.item_path_str(variant.did);
+ let variant_path = self.tcx.def_path_str(variant.did);
// FIXME #56861: DRYer prelude filtering
Some(variant_path.trim_start_matches("std::prelude::v1::").to_string())
} else {
// `report_method_error()`.
diag.help(&format!(
"call with fully qualified syntax `{}(...)` to keep using the current method",
- self.tcx.item_path_str(stable_pick.item.def_id),
+ self.tcx.def_path_str(stable_pick.item.def_id),
));
if nightly_options::is_nightly_build() {
diag.help(&format!(
"add #![feature({})] to the crate attributes to enable `{}`",
feature,
- self.tcx.item_path_str(candidate.item.def_id),
+ self.tcx.def_path_str(candidate.item.def_id),
));
}
}
None => String::new(),
Some(trait_ref) => {
format!(" of the trait `{}`",
- self.tcx.item_path_str(trait_ref.def_id))
+ self.tcx.def_path_str(trait_ref.def_id))
}
};
item_span,
"candidate #{} is defined in the trait `{}`",
idx + 1,
- self.tcx.item_path_str(trait_did));
+ self.tcx.def_path_str(trait_did));
} else {
span_note!(err,
item_span,
"the candidate is defined in the trait `{}`",
- self.tcx.item_path_str(trait_did));
+ self.tcx.def_path_str(trait_did));
}
err.help(&format!("to disambiguate the method call, write `{}::{}({}{})` \
instead",
- self.tcx.item_path_str(trait_did),
+ self.tcx.def_path_str(trait_did),
item_name,
if rcvr_ty.is_region_ptr() && args.is_some() {
if rcvr_ty.is_mutable_pointer() {
};
format!(
"use {};\n{}",
- with_crate_prefix(|| self.tcx.item_path_str(*did)),
+ with_crate_prefix(|| self.tcx.def_path_str(*did)),
additional_newline
)
});
&format!(
"\ncandidate #{}: `use {};`",
i + 1,
- with_crate_prefix(|| self.tcx.item_path_str(*trait_did))
+ with_crate_prefix(|| self.tcx.def_path_str(*trait_did))
)
);
} else {
msg.push_str(
&format!(
"\n`use {};`",
- with_crate_prefix(|| self.tcx.item_path_str(*trait_did))
+ with_crate_prefix(|| self.tcx.def_path_str(*trait_did))
)
);
}
for (i, trait_info) in candidates.iter().enumerate() {
msg.push_str(&format!("\ncandidate #{}: `{}`",
i + 1,
- self.tcx.item_path_str(trait_info.def_id)));
+ self.tcx.def_path_str(trait_info.def_id)));
}
err.note(&msg[..]);
}
debug!(
"check_item_type(it.hir_id={}, it.name={})",
it.hir_id,
- tcx.item_path_str(tcx.hir().local_def_id_from_hir_id(it.hir_id))
+ tcx.def_path_str(tcx.hir().local_def_id_from_hir_id(it.hir_id))
);
let _indenter = indenter();
match it.node {
autoderef.unambiguous_final_ty(self);
if let Some((did, field_ty)) = private_candidate {
- let struct_path = self.tcx().item_path_str(did);
+ let struct_path = self.tcx().def_path_str(did);
let mut err = struct_span_err!(self.tcx().sess, expr.span, E0616,
"field `{}` of struct `{}` is private",
field, struct_path);
debug!("check_item_well_formed(it.hir_id={:?}, it.name={})",
item.hir_id,
- tcx.item_path_str(def_id));
+ tcx.def_path_str(def_id));
match item.node {
// Right now we check that every default trait implementation
if let Some(def_id) = suggested_marker_id {
err.help(&format!("consider removing `{}` or using a marker such as `{}`",
param_name,
- tcx.item_path_str(def_id)));
+ tcx.def_path_str(def_id)));
}
err.emit();
}
if def_a.is_struct() && def_b.is_struct() =>
{
if def_a != def_b {
- let source_path = tcx.item_path_str(def_a.did);
- let target_path = tcx.item_path_str(def_b.did);
+ let source_path = tcx.def_path_str(def_a.did);
+ let target_path = tcx.def_path_str(def_b.did);
create_err(
&format!(
(&ty::Adt(def_a, substs_a), &ty::Adt(def_b, substs_b)) if def_a.is_struct() &&
def_b.is_struct() => {
if def_a != def_b {
- let source_path = gcx.item_path_str(def_a.did);
- let target_path = gcx.item_path_str(def_b.did);
+ let source_path = gcx.def_path_str(def_a.did);
+ let target_path = gcx.def_path_str(def_b.did);
span_err!(gcx.sess,
span,
E0377,
if let Some(trait_ref) = tcx.impl_trait_ref(impl_def_id) {
debug!("(checking implementation) adding impl for trait '{:?}', item '{}'",
trait_ref,
- tcx.item_path_str(impl_def_id));
+ tcx.def_path_str(impl_def_id));
// Skip impls where one of the self type is an error type.
// This occurs with e.g., resolve failures (#30589).
E0371,
"the object type `{}` automatically implements the trait `{}`",
trait_ref.self_ty(),
- tcx.item_path_str(trait_def_id))
+ tcx.def_path_str(trait_def_id))
.span_label(sp, format!("`{}` automatically implements trait `{}`",
trait_ref.self_ty(),
- tcx.item_path_str(trait_def_id)))
+ tcx.def_path_str(trait_def_id)))
.emit();
}
}
format!("cross-crate traits with a default impl, like `{}`, \
can only be implemented for a struct/enum type \
defined in the current crate",
- self.tcx.item_path_str(trait_def_id)),
+ self.tcx.def_path_str(trait_def_id)),
"can't implement cross-crate trait for type in another crate"
))
}
_ => {
Some((format!("cross-crate traits with a default impl, like `{}`, can \
only be implemented for a struct/enum type, not `{}`",
- self.tcx.item_path_str(trait_def_id),
+ self.tcx.def_path_str(trait_def_id),
self_ty),
"can't implement cross-crate trait with a default impl for \
non-struct/enum type"))
fn build_constraints_for_item(&mut self, def_id: DefId) {
let tcx = self.tcx();
- debug!("build_constraints_for_item({})", tcx.item_path_str(def_id));
+ debug!("build_constraints_for_item({})", tcx.def_path_str(def_id));
// Skip items with no generics - there's nothing to infer in them.
if tcx.generics_of(def_id).count() == 0 {
}
let names = PrintCx::new(tcx, AbsolutePathPrinter)
- .print_item_path(def_id, None, Namespace::TypeNS);
+ .print_def_path(def_id, None, Namespace::TypeNS);
hir::Path {
span: DUMMY_SP,
"rustc_attrs",
"internal rustc attributes will never be stable",
cfg_fn!(rustc_attrs))),
- ("rustc_item_path", Whitelisted, template!(Word), Gated(Stability::Unstable,
+ ("rustc_def_path", Whitelisted, template!(Word), Gated(Stability::Unstable,
"rustc_attrs",
"internal rustc attributes will never be stable",
cfg_fn!(rustc_attrs))),
// Regression test for #41697. Using dump-mir was triggering
// artificial cycles: during type-checking, we had to get the MIR for
// the constant expressions in `[u8; 2]`, which in turn would trigger
-// an attempt to get the item-path, which in turn would request the
+// an attempt to get the def-path, which in turn would request the
// types of the impl, which would trigger a cycle. We suppressed this
// cycle now by forcing mir-dump to avoid asking for types of an impl.
#![feature(rustc_attrs)]
#[rustc_symbol_name] //~ ERROR _ZN5basic4main
-#[rustc_item_path] //~ ERROR item-path(main)
+#[rustc_def_path] //~ ERROR def-path(main)
fn main() {
}
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: item-path(main)
+error: def-path(main)
--> $DIR/basic.rs:4:1
|
-LL | #[rustc_item_path]
- | ^^^^^^^^^^^^^^^^^^
+LL | #[rustc_def_path]
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
impl Foo {
#[rustc_symbol_name] //~ ERROR _ZN15impl1..foo..Foo3bar
- #[rustc_item_path] //~ ERROR item-path(foo::Foo::bar)
+ #[rustc_def_path] //~ ERROR def-path(foo::Foo::bar)
fn bar() { }
}
}
impl Foo {
#[rustc_symbol_name] //~ ERROR _ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz
- #[rustc_item_path] //~ ERROR item-path(bar::<impl foo::Foo>::baz)
+ #[rustc_def_path] //~ ERROR def-path(bar::<impl foo::Foo>::baz)
fn baz() { }
}
}
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: item-path(foo::Foo::bar)
+error: def-path(foo::Foo::bar)
--> $DIR/impl1.rs:9:9
|
-LL | #[rustc_item_path]
- | ^^^^^^^^^^^^^^^^^^
+LL | #[rustc_def_path]
+ | ^^^^^^^^^^^^^^^^^
error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h38577281258e1527E)
--> $DIR/impl1.rs:18:9
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: item-path(bar::<impl foo::Foo>::baz)
+error: def-path(bar::<impl foo::Foo>::baz)
--> $DIR/impl1.rs:19:9
|
-LL | #[rustc_item_path]
- | ^^^^^^^^^^^^^^^^^^
+LL | #[rustc_def_path]
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors