]> git.lizzy.rs Git - rust.git/commitdiff
rustc: rename item_path to def_path (except the module in ty).
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Wed, 19 Dec 2018 10:31:35 +0000 (12:31 +0200)
committerEduard-Mihai Burtescu <edy.burt@gmail.com>
Fri, 15 Mar 2019 11:25:10 +0000 (13:25 +0200)
54 files changed:
src/librustc/dep_graph/dep_node.rs
src/librustc/hir/def_id.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs
src/librustc/middle/stability.rs
src/librustc/mir/mod.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/mod.rs
src/librustc/traits/object_safety.rs
src/librustc/traits/on_unimplemented.rs
src/librustc/traits/project.rs
src/librustc/ty/error.rs
src/librustc/ty/item_path.rs
src/librustc/ty/mod.rs
src/librustc/ty/query/config.rs
src/librustc/util/ppaux.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_codegen_utils/symbol_names.rs
src/librustc_codegen_utils/symbol_names_test.rs
src/librustc_incremental/assert_dep_graph.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_lint/unused.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
src/librustc_mir/const_eval.rs
src/librustc_mir/hair/pattern/check_match.rs
src/librustc_mir/hair/pattern/mod.rs
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/transform/rustc_peek.rs
src/librustc_mir/util/graphviz.rs
src/librustc_mir/util/liveness.rs
src/librustc_mir/util/pretty.rs
src/librustc_privacy/lib.rs
src/librustc_save_analysis/lib.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/_match.rs
src/librustc_typeck/check/compare_method.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/wfcheck.rs
src/librustc_typeck/coherence/builtin.rs
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/orphan.rs
src/librustc_typeck/variance/constraints.rs
src/librustdoc/clean/mod.rs
src/libsyntax/feature_gate.rs
src/test/mir-opt/issue-41697.rs
src/test/ui/symbol-names/basic.rs
src/test/ui/symbol-names/basic.stderr
src/test/ui/symbol-names/impl1.rs
src/test/ui/symbol-names/impl1.stderr

index 41a4a8031006f9d6ee354e6611a0ac7f92cbed0b..eb75e624d34b2982ebff060f9ed42d609de36548 100644 (file)
@@ -724,7 +724,7 @@ fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
     }
 
     fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
-        tcx.item_path_str(*self)
+        tcx.def_path_str(*self)
     }
 }
 
@@ -736,7 +736,7 @@ fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
     }
 
     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))
     }
 }
 
index ed1c15a73c260fc33128cb19f9095c00c1464390..397843fd75afa1d7f118af8002f58bb9e5608727 100644 (file)
@@ -249,7 +249,7 @@ pub fn describe_as_module(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
         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))
         }
     }
 }
index ebed768fa54ec08552433814981dcfc05e56313f..2a638853992f3c39fb12db58b4794bacacce4407 100644 (file)
@@ -448,10 +448,10 @@ fn check_and_note_conflicting_crates(
             // 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 {
@@ -658,7 +658,7 @@ fn cmp_type_arg(
                 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(());
@@ -757,8 +757,8 @@ fn push_ty_ref<'tcx>(
                 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.
@@ -1013,7 +1013,7 @@ pub fn note_type_err(
                             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);
                             }
index 506388c268bb107e01ecade10240980af9297ab7..189ecf53e0e8496dd3537deee41ac52e95476ce1 100644 (file)
@@ -193,7 +193,7 @@ fn try_report_placeholders_trait(
             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),
             ),
         );
 
@@ -201,7 +201,7 @@ fn try_report_placeholders_trait(
             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),
                 ));
             }
             _ => (),
index 1677384059e09e276c351a8734c688a3f3ee83e1..0a2a375e1b2c154e37fedad45e0c4853581b7baf 100644 (file)
@@ -593,7 +593,7 @@ pub fn eval_stability(self, def_id: DefId, id: Option<HirId>, span: Span) -> Eva
                                .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,
@@ -620,7 +620,7 @@ pub fn eval_stability(self, def_id: DefId, id: Option<HirId>, span: Span) -> Eva
         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,
index ec42809ff65699fcf4443a55e089211a766939c9..ea3668cec1544128d957d71f6dc6b18c25a9411e 100644 (file)
@@ -2062,7 +2062,7 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
             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!(
@@ -2731,7 +2731,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: ty::Const<'_>) -> fmt::Resul
     }
     // 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 {
@@ -2756,8 +2756,8 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: ty::Const<'_>) -> fmt::Resul
     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> {
index 0dd076481c88774908165e57608c3ea8e5f71b91..6c8fe0875b60c232a0cac7db751294a696901cfb 100644 (file)
@@ -1285,11 +1285,11 @@ pub fn recursive_type_with_infinite_size_error(self,
         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
     }
 
@@ -1299,7 +1299,7 @@ pub fn report_object_safety_error(self,
                                       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,
@@ -1524,7 +1524,7 @@ fn note_obligation_cause_code<T>(&self,
                                   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) {
index df127b934b0b11723f2de8ce6c4f8263cab2c930..78c80b48ee80d9756f6b15ada676db838c25e650 100644 (file)
@@ -650,7 +650,7 @@ pub fn type_known_to_meet_bound_modulo_regions<'a, 'gcx, 'tcx>(
 ) -> 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,
@@ -665,7 +665,7 @@ pub fn type_known_to_meet_bound_modulo_regions<'a, 'gcx, 'tcx>(
 
     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
@@ -692,13 +692,13 @@ pub fn type_known_to_meet_bound_modulo_regions<'a, 'gcx, 'tcx>(
             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
             }
index e7a5138e6893c5384875dd00dfb263e40a528c06..1c8ea5c7b9c5b0dd437301f536a24c15e19472f9 100644 (file)
@@ -133,7 +133,7 @@ fn object_safety_violations_for_trait(self, trait_def_id: DefId)
                         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 {
index c86fd0d52b901ce62fe3fb64dea452b8f73cb001..fc0058a1df5ffebc19bd4be54718ed7e5ef40d51 100644 (file)
@@ -276,7 +276,7 @@ pub fn format(&self,
                   -> 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 {
index 197bea1c3118998247d01369866e500ba97ab21d..ab6acc662131b4663c57c06978cb2eeafa531ae2 100644 (file)
@@ -1549,7 +1549,7 @@ fn assoc_ty_def<'cx, 'gcx, 'tcx>(
         // 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))
     }
 }
 
index f58e5e4fb69f6a52f78a0b3248c6375b13924181..342a6204d7fe4a5b0aed6569d14f066cdcab6f8e 100644 (file)
@@ -125,9 +125,9 @@ fn report_maybe_different(f: &mut fmt::Formatter<'_>,
             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 `{:?}`",
@@ -146,8 +146,8 @@ fn report_maybe_different(f: &mut fmt::Formatter<'_>,
             }
             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 {}",
@@ -169,8 +169,8 @@ pub fn sort_string(&self, tcx: TyCtxt<'a, 'gcx, 'lcx>) -> Cow<'static, str> {
             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(),
@@ -199,7 +199,7 @@ pub fn sort_string(&self, tcx: TyCtxt<'a, 'gcx, 'lcx>) -> Cow<'static, str> {
             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()
                 }
index 5a15efc2f1142fcbcf8638afb6e4545b81551938..9f34f475eff6b15ebf7bf87746eb1eeeca212f54 100644 (file)
@@ -16,7 +16,7 @@
     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.
@@ -56,7 +56,7 @@ pub fn with_crate_prefix<F: FnOnce() -> R, R>(f: F) -> R {
 }
 
 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 {
@@ -76,52 +76,52 @@ fn guess_def_namespace(self, def_id: DefId) -> Namespace {
     /// 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());
@@ -155,13 +155,13 @@ pub fn default_print_item_path(
             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)
             }
         }
     }
@@ -202,7 +202,7 @@ fn default_print_impl_path(
             // 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 {
@@ -224,13 +224,13 @@ fn default_print_impl_path(
         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 |
@@ -301,13 +301,13 @@ pub fn characteristic_def_id_of_type(ty: Ty<'_>) -> Option<DefId> {
 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>,
@@ -357,12 +357,12 @@ impl LocalPathPrinter {
     /// 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.
@@ -390,9 +390,9 @@ fn try_print_visible_item_path(
                     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)
                     };
@@ -412,7 +412,7 @@ fn try_print_visible_item_path(
         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 {
@@ -425,12 +425,12 @@ fn try_print_visible_item_path(
         }
 
         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,
         );
 
@@ -485,7 +485,7 @@ fn try_print_visible_item_path(
                 })
             },
         };
-        debug!("try_print_visible_item_path: symbol={:?}", symbol);
+        debug!("try_print_visible_def_path: symbol={:?}", symbol);
         Some(self.path_append(path, &symbol))
     }
 }
@@ -493,14 +493,14 @@ fn try_print_visible_item_path(
 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>,
@@ -522,7 +522,7 @@ fn print_impl_path(
             // 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));
         }
index ddb3911daeb5df78d8ed380376cbf688684f47e9..4f933bf0d538dfbb6fa3211d81bf7c04611b408f 100644 (file)
@@ -2056,7 +2056,7 @@ pub fn new(tcx: TyCtxt<'_, '_, '_>, did: DefId) -> ReprOptions {
         }
 
         // 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 }
index 6488c0db42bc571884599493cedb2fc3153c3dc2..395b288df141e11410998d712d061e22ed730053 100644 (file)
@@ -71,7 +71,7 @@ fn try_load_from_disk(_: TyCtxt<'_, 'tcx, 'tcx>,
 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()
@@ -301,7 +301,7 @@ fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
 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()
     }
 }
 
@@ -322,7 +322,7 @@ fn describe(tcx: TyCtxt<'_, '_, '_>, (_, def_id): (DefId, DefId)) -> Cow<'static
 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()
     }
 }
 
@@ -359,7 +359,7 @@ fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> {
 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()
     }
 }
 
@@ -394,7 +394,7 @@ fn describe(
     ) -> 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()
     }
 
@@ -415,7 +415,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
     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]
@@ -513,7 +513,7 @@ fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> {
 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]
@@ -532,21 +532,21 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 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()
     }
 
@@ -565,19 +565,19 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
 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()
     }
 }
 
@@ -883,7 +883,7 @@ fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> {
 
 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()
     }
 }
 
@@ -927,7 +927,7 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
 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()
     }
 }
 
@@ -945,7 +945,7 @@ fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> {
 
 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()
     }
 }
 
index 092255129f4eeb39e1af90044324fcdef0ac8070..cf92ab2f2ff4791885e493541e79766d42fd1163 100644 (file)
@@ -320,7 +320,7 @@ fn parameterized(
             // 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 {
@@ -515,7 +515,7 @@ fn print(&self, cx: &mut PrintCx<'_, '_, 'tcx, P>) -> Self::Output {
                     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;
                         }
@@ -538,7 +538,7 @@ fn print(&self, cx: &mut PrintCx<'_, '_, 'tcx, P>) -> Self::Output {
 
             // 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
@@ -582,7 +582,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 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)))
         })
     }
 }
@@ -590,7 +590,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 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)))
         })
     }
 }
@@ -1513,11 +1513,11 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                 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 `"))?;
index da065f9e05d9ed8f29ef155b9ee7a3b348f9bf0d..01bfe5d5af70697e5bb902df86122675247c5565 100644 (file)
@@ -1406,7 +1406,7 @@ pub fn append_loan_path_to_string(&self,
                 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(')');
             }
 
@@ -1443,7 +1443,7 @@ pub fn append_autoderefd_loan_path_to_string(&self,
                 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(')');
             }
 
@@ -1523,7 +1523,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 
             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)
                 };
@@ -1558,7 +1558,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 
             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)
                 };
index a7771f3da18eedda2311b523f197373b39f644b4..1417cbf12655801acf7f4921c6f639cd8b1dc591 100644 (file)
@@ -227,7 +227,7 @@ fn get_symbol_hash<'a, 'tcx>(
 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()
     })
 }
index c495268154664ee7a4987030b5c5b87cc6f856aa..6a2b6f1321b88a9420fed6add0f5e1965b7686d1 100644 (file)
@@ -1,7 +1,7 @@
 //! 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;
@@ -10,7 +10,7 @@
 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
@@ -41,9 +41,9 @@ fn process_attrs(&mut self,
                 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
index 1f69d617c83b71949f40dcfc468e24a64d62fb0a..9fe9a60b9aaa97885d12779d62c1019b23347d49 100644 (file)
@@ -206,7 +206,7 @@ fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                 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(
index 2794b6c556ff24652aa081903f5f0fdbac9a67c7..633e61a0034ab075c7a179edbb11143ccc2db429 100644 (file)
@@ -463,7 +463,7 @@ fn dep_node_str(&self, dep_node: &DepNode) -> String {
         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)
         }
index 86b8b276eafe5930d35cb7c427705892690c0c6d..7d61547527f76d6f8953652963b6720c311b8237 100644 (file)
@@ -182,7 +182,7 @@ fn check_must_use(
             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() {
index 62cfa184430be17f45a508ed874ec56208c5cc37..0f0811b562ea3a8aa5198e56ad7fa0c2104748d1 100644 (file)
@@ -68,7 +68,7 @@ pub fn provide(providers: &mut Providers<'_>) {
 
 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;
 
index 17f8c23f4fddc0cdf43c686e97f8f3bc0558a725..dfa5af444d37ec76be09ddd0b2dd3ea3f5f42b65 100644 (file)
@@ -93,7 +93,7 @@ pub(in crate::borrow_check) fn add_explanation_to_diagnostic<'cx, 'gcx, 'tcx>(
                     // 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
index 365cb508b09253958b0b4a1543735b7c9a285235..e6005142b85ef80aaa884f01b99ee7e069f6f98d 100644 (file)
@@ -142,7 +142,7 @@ fn eval_body_using_ecx<'mir, 'tcx>(
     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);
index 41babc1ad12ef84af80e5a78a7a87f941f96793c..49967df08891b3c4f77d372e2d7dd635ef27606f 100644 (file)
@@ -319,7 +319,7 @@ fn check_for_bindings_named_same_as_variants(cx: &MatchVisitor<'_, '_>, pat: &Pa
                     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 `{}`",
index f1a3c682b5384a1c60bf2264d777f5622ec32a50..ad7b45d89453acb390b794ac8d314286d0f1db89 100644 (file)
@@ -969,8 +969,8 @@ fn const_to_pat(
             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
             }
index 8a32c3b636c71242eea742f4e549e5a196e5d771..d92ab0c517956b65ae89a51676c39555db1160f6 100644 (file)
@@ -283,7 +283,7 @@ pub fn load_mir(
             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)),
         }
index 97d566e586e867dc5c7c28e44db725d3f54f41a9..001a61959c2dd75caf3a97626b38c475e6dfa211 100644 (file)
@@ -1253,7 +1253,7 @@ fn visit_terminator_kind(&mut self,
                                     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 \
index f078316b97ce85fc95df8402b482faff7e0d607d..f9f8abbe6c06519874cea41b4ae164dda1431480 100644 (file)
@@ -29,10 +29,10 @@ fn run_pass<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
         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);
index 41e16684b8ac5e1ca8f46bdd346f44ade1e004ae..69a2adcfce026e2587e2392af894103ed707acae 100644 (file)
@@ -127,7 +127,7 @@ fn write_graph_label<'a, 'gcx, 'tcx, W: Write>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
                                                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() {
index d08fb40966c4992a3f52808ce32aa1105c41449d..200089530c1528d05fc3bd4ed4840f52065a06ea 100644 (file)
@@ -267,7 +267,7 @@ pub fn dump_mir<'a, '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())
     });
     dump_matched_mir_node(tcx, pass_name, &node_path, source, mir, result);
 }
index c3fbee3a2a6e5747e31f804dd053a9a5ceb9f3fa..12d4e90c7c002fbce651861aa6f7e918d00ec622 100644 (file)
@@ -80,7 +80,7 @@ pub fn dump_mir<'a, 'gcx, 'tcx, F>(
 
     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,
@@ -105,7 +105,7 @@ pub fn dump_enabled<'a, 'gcx, '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| {
@@ -115,7 +115,7 @@ pub fn dump_enabled<'a, 'gcx, 'tcx>(
 }
 
 // #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>(
@@ -614,7 +614,7 @@ fn write_mir_sig(
 
     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 {
index c7e63a83b1561155e2acf7822aab4146d222b358..5065c1de97bee27b7c860198b4ef4efe896246d8 100644 (file)
@@ -816,7 +816,7 @@ fn check_field(&mut self,
         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();
         }
index 2aa44a9242ef1db9c05a09145c31aa6fa141d637..97b9db34ed525149feb94d30b651076d20c1d6b9 100644 (file)
@@ -411,7 +411,7 @@ pub fn get_method_data(&self, id: ast::NodeId, ident: ast::Ident, span: Span) ->
                             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)
@@ -451,7 +451,7 @@ pub fn get_method_data(&self, id: ast::NodeId, ident: ast::Ident, span: Span) ->
                         }
 
                         (
-                            format!("::{}", self.tcx.item_path_str(def_id)),
+                            format!("::{}", self.tcx.def_path_str(def_id)),
                             Some(def_id),
                             None,
                             docs,
index 4e952f972e4591f98633974b3b050484228d68ed..9ca75566b4280ce7f75e0e7b7450979a479fa326 100644 (file)
@@ -922,7 +922,7 @@ fn ast_type_binding_to_poly_projection_predicate(
                                      "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();
@@ -1071,7 +1071,7 @@ fn conv_object_ty_poly_trait_ref(&self,
                 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!(
@@ -1459,7 +1459,7 @@ fn qpath_to_ty(&self,
         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,
index 342a214e0cc229d9e1d9652eaaa3a8e20d6288e6..c6b66393dd2f1e2733cc72c03fcf6dcc901fccc8 100644 (file)
@@ -1001,13 +1001,13 @@ fn check_struct_pat_fields(&self,
                                            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 == "" {
index f79bf4e999d5492dc158cca4a8ae47f29fa7a441..e6e5c46c473d54abb7ae5a6d84b2eb47ea3862e4 100644 (file)
@@ -719,7 +719,7 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                         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 {}",
index 32ca854b2774469cf9effc8436bbbfb29a2f0189..3a7308d09172e6581402db7d77fd0eecba619a29 100644 (file)
@@ -130,7 +130,7 @@ pub fn demand_coerce_diag(&self,
                         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 {
index efae870c3c3a9a8dc93ef663cee3f3026c05fe2a..1f0ab3abb283617346f34d9a8905876088f682e2 100644 (file)
@@ -1195,7 +1195,7 @@ fn emit_unstable_name_collision_hint(
         // `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() {
@@ -1203,7 +1203,7 @@ fn emit_unstable_name_collision_hint(
                 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),
                 ));
             }
         }
index 4bf6471a6293cc3764768dff2a00576a5452dd51..f784a720b19c42a7dbb1a3f270ff4e74b2077aa2 100644 (file)
@@ -102,7 +102,7 @@ pub fn report_method_error<'b>(&self,
                             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))
                             }
                         };
 
@@ -135,16 +135,16 @@ pub fn report_method_error<'b>(&self,
                                        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() {
@@ -516,7 +516,7 @@ fn suggest_use_candidates(&self,
                 };
                 format!(
                     "use {};\n{}",
-                    with_crate_prefix(|| self.tcx.item_path_str(*did)),
+                    with_crate_prefix(|| self.tcx.def_path_str(*did)),
                     additional_newline
                 )
             });
@@ -530,14 +530,14 @@ fn suggest_use_candidates(&self,
                         &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))
                         )
                     );
                 }
@@ -638,7 +638,7 @@ fn suggest_traits_to_import<'b>(&self,
             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[..]);
         }
index c40bdae0762a96b29ae3d1f3a8f9a91671f91ce4..1383bf28113d8196acbed18e8fbf49c2410c65e4 100644 (file)
@@ -1328,7 +1328,7 @@ pub fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, it: &'tcx hir::Ite
     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 {
@@ -3534,7 +3534,7 @@ fn check_field(&self,
         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);
index 92c44e24998e5de692a8d7fb7a0b8e51ba7e116e..1f7e05de18bcf07ff09de6fed0704cc06c86b7dd 100644 (file)
@@ -68,7 +68,7 @@ pub fn check_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: Def
 
     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
@@ -976,7 +976,7 @@ fn report_bivariance<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     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();
 }
index 5d86bc5409532e0ecef0c9e96f2bcdc2db62f2ee..a2b01e3843ff2d43d2361969c389603ac1cd45d7 100644 (file)
@@ -198,8 +198,8 @@ fn visit_implementation_of_dispatch_from_dyn<'a, 'tcx>(
                     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!(
@@ -388,8 +388,8 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>,
             (&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,
index 39a2f5d37bd7ab32b596562c0e057b5c0362d9a5..a5452b4db2a2081538f6657284993e1549ba5fcb 100644 (file)
@@ -28,7 +28,7 @@ fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
     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).
@@ -204,10 +204,10 @@ fn check_impl_overlap<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeI
                                      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();
                 }
             }
index c875b856f3a4f1805af5a3eccc8871ee04e5d676..7e1c38e051542298eec8eb6c877a6059bb4f7edc 100644 (file)
@@ -121,7 +121,7 @@ fn visit_item(&mut self, item: &hir::Item) {
                                 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"
                             ))
                         }
@@ -129,7 +129,7 @@ fn visit_item(&mut self, item: &hir::Item) {
                     _ => {
                         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"))
index 49d11150689a99d078e106a74bcea4fb3c3edd89..c18f9fd102f1093980b26fbc179a61122c3d7e5f 100644 (file)
@@ -131,7 +131,7 @@ fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx> {
 
     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 {
index e2e2d552ff122b4c927c56dfea50b3b0d3cdc1d9..08d165b82b1db80c934de57085e9ab7fb9b51e7c 100644 (file)
@@ -4250,7 +4250,7 @@ fn path_append(
     }
 
     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,
index 279e2089f5d71c121824434c36e279483400abb2..b2982629fe6b2f9cf51847f456fd4564927ecf2f 100644 (file)
@@ -1042,7 +1042,7 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                              "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))),
index 9db25b15f683559cff2c490d63224b054f9bc2ec..5a461d61482546f65e1b121418ec474f5eed64a7 100644 (file)
@@ -1,7 +1,7 @@
 // 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.
 
index 2a051a5e144da7dc946aa182895a7d72114fa100..086b903b973b0b017dc7c437379a03ee6793bda1 100644 (file)
@@ -1,6 +1,6 @@
 #![feature(rustc_attrs)]
 
 #[rustc_symbol_name] //~ ERROR _ZN5basic4main
-#[rustc_item_path] //~ ERROR item-path(main)
+#[rustc_def_path] //~ ERROR def-path(main)
 fn main() {
 }
index e23a326d5f889ec16643cfe0bca55c69ce6b09eb..6ddd93d632e151d1710b1d3419653d2fa7509f38 100644 (file)
@@ -4,11 +4,11 @@ error: symbol-name(_ZN5basic4main17h08bcaf310214ed52E)
 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
 
index 69cd49e39512ee57b0cbcd6b32f101da9b0ce33f..992527017fb7c0f3a3149496cf2cc6a96c751949 100644 (file)
@@ -6,7 +6,7 @@ pub struct Foo { x: u32 }
 
     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() { }
     }
 }
@@ -16,7 +16,7 @@ mod 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() { }
     }
 }
index 4041eb6b0ba4a4026018cd8eed70daa90adf825c..d225c53e4927a9b6e79d4b435407afc35d554238 100644 (file)
@@ -4,11 +4,11 @@ error: symbol-name(_ZN15impl1..foo..Foo3bar17hc487d6ec13fe9124E)
 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
@@ -16,11 +16,11 @@ error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h385772
 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