From 657ecdb75e2a9f8e8295bc75d9fe810f02605130 Mon Sep 17 00:00:00 2001 From: marmeladema Date: Tue, 1 Sep 2020 00:42:30 +0100 Subject: [PATCH] Rename `DefPathData::get_name()` to `DefPathData::name()` --- compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs | 2 +- compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 2 +- compiler/rustc_hir/src/definitions.rs | 2 +- compiler/rustc_lint/src/context.rs | 2 +- compiler/rustc_middle/src/ty/print/pretty.rs | 2 +- compiler/rustc_middle/src/ty/query/profiling_support.rs | 2 +- compiler/rustc_mir/src/monomorphize/partitioning/default.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs b/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs index 835d0d2e12d..661d13ead83 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs @@ -30,7 +30,7 @@ pub fn item_namespace(cx: &CodegenCx<'ll, '_>, def_id: DefId) -> &'ll DIScope { let namespace_name = match def_key.disambiguated_data.data { DefPathData::CrateRoot => cx.tcx.crate_name(def_id.krate), - data => match data.get_name() { + data => match data.name() { DefPathDataName::Named(name) => name, DefPathDataName::Anon { namespace } => { Symbol::intern(&format!("{{{{{}}}}}", namespace)) diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index e227f9df000..5642cc526ae 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -232,7 +232,7 @@ pub fn push_debuginfo_type_name<'tcx>( output.push_str(&tcx.crate_name(def_id.krate).as_str()); for path_element in tcx.def_path(def_id).data { output.push_str("::"); - match path_element.data.get_name() { + match path_element.data.name() { DefPathDataName::Named(name) => output.push_str(&name.as_str()), DefPathDataName::Anon { namespace } => { write!(output, "{{{{{}}}}}", namespace).unwrap() diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index ae2ce6f176a..5d1c6b78f36 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -157,7 +157,7 @@ pub struct DisambiguatedDefPathData { impl DisambiguatedDefPathData { pub fn fmt_maybe_verbose(&self, writer: &mut impl Write, verbose: bool) -> fmt::Result { - match self.data.get_name() { + match self.data.name() { DefPathDataName::Named(name) => { if Ident::with_dummy_span(name).is_raw_guess() { writer.write_str("r#")?; diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index e4b72847638..776c3c83e02 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -846,7 +846,7 @@ impl<'tcx> LateContext<'tcx> { return Ok(path); } - path.push(match disambiguated_data.data.get_name() { + path.push(match disambiguated_data.data.name() { DefPathDataName::Named(name) => name, DefPathDataName::Anon { namespace } => { Symbol::intern(&format!("{{{{{}}}}}", namespace)) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 7ec14d43892..0e1d5c8fee7 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1498,7 +1498,7 @@ impl Printer<'tcx> for FmtPrinter<'_, 'tcx, F> { // FIXME(eddyb) `name` should never be empty, but it // currently is for `extern { ... }` "foreign modules". - let name = disambiguated_data.data.get_name(); + let name = disambiguated_data.data.name(); if name != DefPathDataName::Named(kw::Invalid) { if !self.empty_path { write!(self, "::")?; diff --git a/compiler/rustc_middle/src/ty/query/profiling_support.rs b/compiler/rustc_middle/src/ty/query/profiling_support.rs index cecb58eb024..f8269fe372e 100644 --- a/compiler/rustc_middle/src/ty/query/profiling_support.rs +++ b/compiler/rustc_middle/src/ty/query/profiling_support.rs @@ -66,7 +66,7 @@ impl<'p, 'c, 'tcx> QueryKeyStringBuilder<'p, 'c, 'tcx> { end_index = 3; } other => { - name = match other.get_name() { + name = match other.name() { DefPathDataName::Named(name) => { dis = ""; end_index = 3; diff --git a/compiler/rustc_mir/src/monomorphize/partitioning/default.rs b/compiler/rustc_mir/src/monomorphize/partitioning/default.rs index c9622df099f..62805a973f5 100644 --- a/compiler/rustc_mir/src/monomorphize/partitioning/default.rs +++ b/compiler/rustc_mir/src/monomorphize/partitioning/default.rs @@ -355,7 +355,7 @@ fn compute_codegen_unit_name( *cache.entry((cgu_def_id, volatile)).or_insert_with(|| { let def_path = tcx.def_path(cgu_def_id); - let components = def_path.data.iter().map(|part| match part.data.get_name() { + let components = def_path.data.iter().map(|part| match part.data.name() { DefPathDataName::Named(name) => name, DefPathDataName::Anon { namespace } => { Symbol::intern(&format!("{{{{{}}}}}", namespace))