1
Fork 0

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`.
This commit is contained in:
Nicholas Nethercote 2022-03-05 07:28:41 +11:00
parent 5f4e067719
commit ca5525d564
169 changed files with 702 additions and 687 deletions

View file

@ -676,7 +676,7 @@ fn fundamental_ty_inner_tys<'tcx>(
match types.next() {
None => {
tcx.sess.span_err(
tcx.def_span(def.did),
tcx.def_span(def.did()),
"`#[fundamental]` requires at least one type parameter",
);
@ -729,7 +729,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
InCrate::Remote => true,
},
ty::Adt(def, _) => def_id_is_local(def.did, in_crate),
ty::Adt(def, _) => def_id_is_local(def.did(), in_crate),
ty::Foreign(did) => def_id_is_local(did, in_crate),
ty::Opaque(..) => {
// This merits some explanation.