1
Fork 0

Rollup merge of #101498 - petrochenkov:visparam, r=cjgillot

rustc: Parameterize `ty::Visibility` over used ID

It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
This commit is contained in:
Dylan DPC 2022-09-08 11:55:09 +05:30 committed by GitHub
commit 12b810063d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 170 additions and 127 deletions

View file

@ -1895,9 +1895,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
// FIXME(compiler-errors): This could be generalized, both to
// be more granular, and probably look past other `#[fundamental]`
// types, too.
self.tcx
.visibility(def.did())
.is_accessible_from(body_id.owner.to_def_id(), self.tcx)
self.tcx.visibility(def.did()).is_accessible_from(body_id.owner, self.tcx)
} else {
true
}