Skip to content

Commit 1d8da94

Browse files
committed
Add comment about LocalDefId -> DefId
Now there are instructions on how to convert back and forth on both structs, not just one.
1 parent bb86748 commit 1d8da94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_span/def_id.rs

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ impl rustc_serialize::UseSpecializedDecodable for DefIndex {}
133133

134134
/// A `DefId` identifies a particular *definition*, by combining a crate
135135
/// index and a def index.
136+
///
137+
/// You can create a `DefId` from a `LocalDefId` using `local_def_id.to_def_id()`.
136138
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
137139
pub struct DefId {
138140
pub krate: CrateNum,

0 commit comments

Comments
 (0)