mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
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:
parent
bb8674837a
commit
1d8da94439
@ -133,6 +133,8 @@ impl rustc_serialize::UseSpecializedDecodable for DefIndex {}
|
|||||||
|
|
||||||
/// A `DefId` identifies a particular *definition*, by combining a crate
|
/// A `DefId` identifies a particular *definition*, by combining a crate
|
||||||
/// index and a def index.
|
/// 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)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
|
||||||
pub struct DefId {
|
pub struct DefId {
|
||||||
pub krate: CrateNum,
|
pub krate: CrateNum,
|
||||||
|
Loading…
Reference in New Issue
Block a user