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:
parent
0568b0a3de
commit
d8d3b83e3a
24 changed files with 170 additions and 127 deletions
|
@ -305,6 +305,12 @@ impl DefId {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<LocalDefId> for DefId {
|
||||
fn from(local: LocalDefId) -> DefId {
|
||||
local.to_def_id()
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Encoder> Encodable<E> for DefId {
|
||||
default fn encode(&self, s: &mut E) {
|
||||
self.krate.encode(s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue