Restrict access to crate_name.

Also remove original_crate_name, which had the exact same implementation
This commit is contained in:
Camille GILLOT
2021-05-10 18:23:32 +02:00
parent 2f601ef527
commit 0e71283495
19 changed files with 23 additions and 30 deletions

View File

@@ -1621,7 +1621,7 @@ impl<'tcx> TyCtxt<'tcx> {
fn item_name_from_def_id(self, def_id: DefId) -> Option<Symbol> {
if def_id.index == CRATE_DEF_INDEX {
Some(self.original_crate_name(def_id.krate))
Some(self.crate_name(def_id.krate))
} else {
let def_key = self.def_key(def_id);
match def_key.disambiguated_data.data {