diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-04-09 10:29:37 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-04-11 15:18:51 -0700 |
| commit | 10ed50125454bcd166ee540cad47b91e76e343c4 (patch) | |
| tree | 1e9b91140084452b82bd700376b624a7f0dd8db0 | |
| parent | 62b5aff1aefdb2c444c814946202665a760f9f2d (diff) | |
| download | rust-10ed50125454bcd166ee540cad47b91e76e343c4.tar.gz rust-10ed50125454bcd166ee540cad47b91e76e343c4.zip | |
Impl `From<LocalDefId>` for `DefId`
| -rw-r--r-- | src/librustc_span/def_id.rs | 6 |
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 {} |
