diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-05 07:28:41 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-11 13:31:24 +1100 |
| commit | ca5525d5643f4eb7de5c5e69d0691fc8f1cacfca (patch) | |
| tree | cbe3682d3e3ff0d1a48b76f972f0322ea28c9542 /compiler/rustc_middle/src/ty/structural_impls.rs | |
| parent | 5f4e0677190b82e61dc507e3e72caf89da8e5e28 (diff) | |
| download | rust-ca5525d5643f4eb7de5c5e69d0691fc8f1cacfca.tar.gz rust-ca5525d5643f4eb7de5c5e69d0691fc8f1cacfca.zip | |
Improve `AdtDef` interning.
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
Diffstat (limited to 'compiler/rustc_middle/src/ty/structural_impls.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/structural_impls.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 2d51462221c..5c7910db362 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -33,13 +33,13 @@ impl fmt::Debug for ty::TraitDef { } } -impl fmt::Debug for ty::AdtDef { +impl<'tcx> fmt::Debug for ty::AdtDef<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ty::tls::with(|tcx| { with_no_trimmed_paths!({ f.write_str( &FmtPrinter::new(tcx, Namespace::TypeNS) - .print_def_path(self.did, &[])? + .print_def_path(self.did(), &[])? .into_buffer(), ) }) @@ -672,7 +672,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::InstanceDef<'a> { // TypeFoldable implementations. /// AdtDefs are basically the same as a DefId. -impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::AdtDef { +impl<'tcx> TypeFoldable<'tcx> for ty::AdtDef<'tcx> { fn try_super_fold_with<F: FallibleTypeFolder<'tcx>>( self, _folder: &mut F, |
