diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-05 16:53:24 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-11 09:12:19 +1100 |
| commit | a09b1d33a703d4ed412e70d3197e73ba7e0937f9 (patch) | |
| tree | 7959dfa20498f06843d046aa3f31e3acf4de080a /compiler/rustc_middle/src/ty | |
| parent | 256d802233215bcd6e6791fb57c94bc98d762d4f (diff) | |
| download | rust-a09b1d33a703d4ed412e70d3197e73ba7e0937f9.tar.gz rust-a09b1d33a703d4ed412e70d3197e73ba7e0937f9.zip | |
Rename `IntoDiagnosticArg` as `IntoDiagArg`.
Also rename `into_diagnostic_arg` as `into_diag_arg`, and `NotIntoDiagnosticArg` as `NotInotDiagArg`.
Diffstat (limited to 'compiler/rustc_middle/src/ty')
| -rw-r--r-- | compiler/rustc_middle/src/ty/consts/int.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/consts/kind.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/diagnostics.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/generic_args.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/predicate.rs | 22 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 16 |
8 files changed, 43 insertions, 43 deletions
diff --git a/compiler/rustc_middle/src/ty/consts/int.rs b/compiler/rustc_middle/src/ty/consts/int.rs index 221a9ceee1a..a70e01645f4 100644 --- a/compiler/rustc_middle/src/ty/consts/int.rs +++ b/compiler/rustc_middle/src/ty/consts/int.rs @@ -1,6 +1,6 @@ use rustc_apfloat::ieee::{Double, Single}; use rustc_apfloat::Float; -use rustc_errors::{DiagArgValue, IntoDiagnosticArg}; +use rustc_errors::{DiagArgValue, IntoDiagArg}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_target::abi::Size; use std::fmt; @@ -114,10 +114,10 @@ impl std::fmt::Debug for ConstInt { } } -impl IntoDiagnosticArg for ConstInt { +impl IntoDiagArg for ConstInt { // FIXME this simply uses the Debug impl, but we could probably do better by converting both // to an inherent method that returns `Cow`. - fn into_diagnostic_arg(self) -> DiagArgValue { + fn into_diag_arg(self) -> DiagArgValue { DiagArgValue::Str(format!("{self:?}").into()) } } diff --git a/compiler/rustc_middle/src/ty/consts/kind.rs b/compiler/rustc_middle/src/ty/consts/kind.rs index b35682df2c8..705987d92fe 100644 --- a/compiler/rustc_middle/src/ty/consts/kind.rs +++ b/compiler/rustc_middle/src/ty/consts/kind.rs @@ -14,9 +14,9 @@ pub struct UnevaluatedConst<'tcx> { pub args: GenericArgsRef<'tcx>, } -impl rustc_errors::IntoDiagnosticArg for UnevaluatedConst<'_> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue { - format!("{self:?}").into_diagnostic_arg() +impl rustc_errors::IntoDiagArg for UnevaluatedConst<'_> { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { + format!("{self:?}").into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs index 2506456f1fb..05463b8554f 100644 --- a/compiler/rustc_middle/src/ty/diagnostics.rs +++ b/compiler/rustc_middle/src/ty/diagnostics.rs @@ -11,7 +11,7 @@ use crate::ty::{ }; use rustc_data_structures::fx::FxHashMap; -use rustc_errors::{Applicability, Diag, DiagArgValue, IntoDiagnosticArg}; +use rustc_errors::{Applicability, Diag, DiagArgValue, IntoDiagArg}; use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::DefId; @@ -19,9 +19,9 @@ use rustc_hir::{PredicateOrigin, WherePredicate}; use rustc_span::{BytePos, Span}; use rustc_type_ir::TyKind::*; -impl<'tcx> IntoDiagnosticArg for Ty<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for Ty<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/generic_args.rs b/compiler/rustc_middle/src/ty/generic_args.rs index 8079ad121ad..02b58c035d4 100644 --- a/compiler/rustc_middle/src/ty/generic_args.rs +++ b/compiler/rustc_middle/src/ty/generic_args.rs @@ -9,7 +9,7 @@ use crate::ty::{self, Lift, List, ParamConst, Ty, TyCtxt}; use rustc_ast_ir::visit::VisitorResult; use rustc_ast_ir::walk_visitable_list; use rustc_data_structures::intern::Interned; -use rustc_errors::{DiagArgValue, IntoDiagnosticArg}; +use rustc_errors::{DiagArgValue, IntoDiagArg}; use rustc_hir::def_id::DefId; use rustc_macros::HashStable; use rustc_serialize::{Decodable, Encodable}; @@ -57,9 +57,9 @@ unsafe impl<'tcx> Sync for GenericArg<'tcx> where { } -impl<'tcx> IntoDiagnosticArg for GenericArg<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for GenericArg<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index b1bfd2f1105..1dd0f733233 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -5,7 +5,7 @@ use crate::ty::normalize_erasing_regions::NormalizationError; use crate::ty::{self, ConstKind, Ty, TyCtxt, TypeVisitableExt}; use rustc_error_messages::DiagMessage; use rustc_errors::{ - Diag, DiagArgValue, DiagCtxt, EmissionGuarantee, IntoDiagnostic, IntoDiagnosticArg, Level, + Diag, DiagArgValue, DiagCtxt, EmissionGuarantee, IntoDiagArg, IntoDiagnostic, Level, }; use rustc_hir as hir; use rustc_hir::def_id::DefId; @@ -254,9 +254,9 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> { } } -impl<'tcx> IntoDiagnosticArg for LayoutError<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for LayoutError<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/predicate.rs b/compiler/rustc_middle/src/ty/predicate.rs index 8dd95daed36..62822505fa5 100644 --- a/compiler/rustc_middle/src/ty/predicate.rs +++ b/compiler/rustc_middle/src/ty/predicate.rs @@ -1,6 +1,6 @@ use rustc_data_structures::captures::Captures; use rustc_data_structures::intern::Interned; -use rustc_errors::{DiagArgValue, IntoDiagnosticArg}; +use rustc_errors::{DiagArgValue, IntoDiagArg}; use rustc_hir::def_id::DefId; use rustc_hir::LangItem; use rustc_span::Span; @@ -120,14 +120,14 @@ impl<'tcx> Predicate<'tcx> { } } -impl rustc_errors::IntoDiagnosticArg for Predicate<'_> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue { +impl rustc_errors::IntoDiagArg for Predicate<'_> { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { rustc_errors::DiagArgValue::Str(std::borrow::Cow::Owned(self.to_string())) } } -impl rustc_errors::IntoDiagnosticArg for Clause<'_> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue { +impl rustc_errors::IntoDiagArg for Clause<'_> { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { rustc_errors::DiagArgValue::Str(std::borrow::Cow::Owned(self.to_string())) } } @@ -407,9 +407,9 @@ impl<'tcx> PolyTraitRef<'tcx> { } } -impl<'tcx> IntoDiagnosticArg for TraitRef<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for TraitRef<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } @@ -453,9 +453,9 @@ impl<'tcx> ExistentialTraitRef<'tcx> { } } -impl<'tcx> IntoDiagnosticArg for ExistentialTraitRef<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for ExistentialTraitRef<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index c8c9afa7f4d..33d63c2a505 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -2722,9 +2722,9 @@ where #[derive(Copy, Clone, TypeFoldable, TypeVisitable, Lift)] pub struct TraitRefPrintOnlyTraitPath<'tcx>(ty::TraitRef<'tcx>); -impl<'tcx> rustc_errors::IntoDiagnosticArg for TraitRefPrintOnlyTraitPath<'tcx> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> rustc_errors::IntoDiagArg for TraitRefPrintOnlyTraitPath<'tcx> { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { + self.to_string().into_diag_arg() } } @@ -2739,9 +2739,9 @@ impl<'tcx> fmt::Debug for TraitRefPrintOnlyTraitPath<'tcx> { #[derive(Copy, Clone, TypeFoldable, TypeVisitable, Lift)] pub struct TraitRefPrintSugared<'tcx>(ty::TraitRef<'tcx>); -impl<'tcx> rustc_errors::IntoDiagnosticArg for TraitRefPrintSugared<'tcx> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> rustc_errors::IntoDiagArg for TraitRefPrintSugared<'tcx> { + fn into_diag_arg(self) -> rustc_errors::DiagArgValue { + self.to_string().into_diag_arg() } } diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 39b5d3b6ea7..cac12e5ee0b 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -13,7 +13,7 @@ use crate::ty::{GenericArg, GenericArgs, GenericArgsRef}; use crate::ty::{List, ParamEnv}; use hir::def::DefKind; use rustc_data_structures::captures::Captures; -use rustc_errors::{DiagArgValue, ErrorGuaranteed, IntoDiagnosticArg, MultiSpan}; +use rustc_errors::{DiagArgValue, ErrorGuaranteed, IntoDiagArg, MultiSpan}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_hir::LangItem; @@ -1094,12 +1094,12 @@ impl<'tcx, T: IntoIterator> Binder<'tcx, T> { } } -impl<'tcx, T> IntoDiagnosticArg for Binder<'tcx, T> +impl<'tcx, T> IntoDiagArg for Binder<'tcx, T> where - T: IntoDiagnosticArg, + T: IntoDiagArg, { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.value.into_diagnostic_arg() + fn into_diag_arg(self) -> DiagArgValue { + self.value.into_diag_arg() } } @@ -1307,9 +1307,9 @@ impl<'tcx> FnSig<'tcx> { } } -impl<'tcx> IntoDiagnosticArg for FnSig<'tcx> { - fn into_diagnostic_arg(self) -> DiagArgValue { - self.to_string().into_diagnostic_arg() +impl<'tcx> IntoDiagArg for FnSig<'tcx> { + fn into_diag_arg(self) -> DiagArgValue { + self.to_string().into_diag_arg() } } |
