Skip to content

Commit 85a48d0

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#73076 r? @lcnr
2 parents ce99f37 + 1d8da94 commit 85a48d0

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)