Add comment about LocalDefId -> DefId

Now there are instructions on how to convert back and forth on both
structs, not just one.
This commit is contained in:
Joshua Nelson 2020-06-11 17:16:38 -04:00
parent bb8674837a
commit 1d8da94439
1 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,8 @@ impl rustc_serialize::UseSpecializedDecodable for DefIndex {}
/// A `DefId` identifies a particular *definition*, by combining a crate
/// index and a def index.
///
/// You can create a `DefId` from a `LocalDefId` using `local_def_id.to_def_id()`.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
pub struct DefId {
pub krate: CrateNum,