about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-12 00:05:36 +0200
committerGitHub <noreply@github.com>2020-06-12 00:05:36 +0200
commit85a48d07e302b6989fc77a6e8413dff492688e91 (patch)
tree669d687c8323ce3b452ef2418bfe4f2ebcd5f352 /src
parentce99f37ffdf2ea462fd4a5b1aa32bed3ecc5f0cc (diff)
parent1d8da94439017344556f7c49750b9e374f7dd579 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/librustc_span/def_id.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_span/def_id.rs b/src/librustc_span/def_id.rs
index fad9f2f6130..0a70be1f152 100644
--- a/src/librustc_span/def_id.rs
+++ b/src/librustc_span/def_id.rs
@@ -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,