diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-01-17 20:21:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-17 20:21:28 +0100 |
| commit | 48bd3ab81dc87a4e5850c5c36ac01bb354dc3857 (patch) | |
| tree | 044d3284deaa181c3b1a5da9fb9683764c2cb581 /compiler | |
| parent | 3d7677d91ad9ef0602af227b41831fa2c46e0547 (diff) | |
| parent | cb00bc035be9fb3f8ce31f92de95a5eec5e2877c (diff) | |
Rollup merge of #106980 - Nilstrieb:_use_mk_manual_debug_impl_instead, r=lcnr
Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/structural_impls.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index d2acfac6188..81ec18684fd 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -7,7 +7,7 @@ use crate::mir::{Field, ProjectionKind}; use crate::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeSuperFoldable}; use crate::ty::print::{with_no_trimmed_paths, FmtPrinter, Printer}; use crate::ty::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitor}; -use crate::ty::{self, InferConst, Lift, Term, TermKind, Ty, TyCtxt}; +use crate::ty::{self, AliasTy, InferConst, Lift, Term, TermKind, Ty, TyCtxt}; use rustc_data_structures::functor::IdFunctor; use rustc_hir::def::Namespace; use rustc_index::vec::{Idx, IndexVec}; @@ -180,6 +180,15 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> { } } +impl<'tcx> fmt::Debug for AliasTy<'tcx> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("AliasTy") + .field("substs", &self.substs) + .field("def_id", &self.def_id) + .finish() + } +} + /////////////////////////////////////////////////////////////////////////// // Atomic structs // diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index b5bb9238512..3f8252aefdc 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1226,7 +1226,7 @@ impl<'tcx> FallibleTypeFolder<'tcx> for SkipBindersAt<'tcx> { /// For a projection, this would be `<Ty as Trait<...>>::N`. /// /// For an opaque type, there is no explicit syntax. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable)] #[derive(HashStable, TypeFoldable, TypeVisitable, Lift)] pub struct AliasTy<'tcx> { /// The parameters of the associated or opaque item. |
