Rollup merge of #73254 - jyn514:local-def-id-comment, r=lcnr

Add comment about LocalDefId -> DefId

Now there are instructions on how to convert back and forth on both
structs, not just one.

See also https://github.com/rust-lang/rust/pull/73076

r? @lcnr
This commit is contained in:
Dylan DPC 2020-06-12 00:05:36 +02:00 committed by GitHub
commit 85a48d07e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,