about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-04-09 10:29:37 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-04-11 15:18:51 -0700
commit10ed50125454bcd166ee540cad47b91e76e343c4 (patch)
tree1e9b91140084452b82bd700376b624a7f0dd8db0
parent62b5aff1aefdb2c444c814946202665a760f9f2d (diff)
downloadrust-10ed50125454bcd166ee540cad47b91e76e343c4.tar.gz
rust-10ed50125454bcd166ee540cad47b91e76e343c4.zip
Impl `From<LocalDefId>` for `DefId`
-rw-r--r--src/librustc_span/def_id.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_span/def_id.rs b/src/librustc_span/def_id.rs
index fad9f2f6130..a3909904e8c 100644
--- a/src/librustc_span/def_id.rs
+++ b/src/librustc_span/def_id.rs
@@ -237,6 +237,12 @@ impl fmt::Debug for LocalDefId {
     }
 }
 
+impl From<LocalDefId> for DefId {
+    fn from(v: LocalDefId) -> Self {
+        v.to_def_id()
+    }
+}
+
 impl rustc_serialize::UseSpecializedEncodable for LocalDefId {}
 impl rustc_serialize::UseSpecializedDecodable for LocalDefId {}