From 1d8da94439017344556f7c49750b9e374f7dd579 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 11 Jun 2020 17:16:38 -0400 Subject: [PATCH] Add comment about LocalDefId -> DefId Now there are instructions on how to convert back and forth on both structs, not just one. --- src/librustc_span/def_id.rs | 2 ++ 1 file changed, 2 insertions(+) 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,