X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Frustc_middle%2Fsrc%2Fty%2Fstructural_impls.rs;h=81ec18684fd8581b8277f746982f713bbc974ab7;hb=47ccca0c8632ac2b3d61ac5afbcf6a3b90b29921;hp=8f64eb3e4baf6f7ba4d8a0d4665deff0f6954e2b;hpb=d6e79ab9c859cb06da0798f24ac31e1e33c932d3;p=rust.git diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 8f64eb3e4ba..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::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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } } +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 // @@ -456,7 +465,7 @@ fn try_fold_with>( let slot = Rc::get_mut_unchecked(&mut unique); // Semantically move the contained type out from `unique`, fold - // it, then move the folded value back into `unique`. Should + // it, then move the folded value back into `unique`. Should // folding fail, `ManuallyDrop` ensures that the "moved-out" // value is not re-dropped. let owned = ManuallyDrop::take(slot); @@ -502,7 +511,7 @@ fn try_fold_with>( let slot = Arc::get_mut_unchecked(&mut unique); // Semantically move the contained type out from `unique`, fold - // it, then move the folded value back into `unique`. Should + // it, then move the folded value back into `unique`. Should // folding fail, `ManuallyDrop` ensures that the "moved-out" // value is not re-dropped. let owned = ManuallyDrop::take(slot);