diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2018-07-10 19:16:22 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2018-08-15 13:47:39 +0200 |
| commit | 2d2cd21f95a01f776ab6248fe24a8d033b147b28 (patch) | |
| tree | b4ae7e199b72673d1a214b7092faeddbac687571 /src/librustc/session | |
| parent | 81cfaad030435aae447d73c66123b3df856c09cb (diff) | |
| download | rust-2d2cd21f95a01f776ab6248fe24a8d033b147b28.tar.gz rust-2d2cd21f95a01f776ab6248fe24a8d033b147b28.zip | |
Clean up CodegenUnit name generation.
Diffstat (limited to 'src/librustc/session')
| -rw-r--r-- | src/librustc/session/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index f474f214305..3dc697e6adb 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -24,6 +24,7 @@ use util::nodemap::{FxHashMap, FxHashSet}; use util::common::{duration_to_secs_str, ErrorReported}; use util::common::ProfileQueriesMsg; +use rustc_data_structures::base_n; use rustc_data_structures::sync::{self, Lrc, Lock, LockCell, OneThread, Once, RwLock}; use syntax::ast::NodeId; @@ -48,6 +49,7 @@ use std; use std::cell::{self, Cell, RefCell}; use std::collections::HashMap; use std::env; +use std::fmt; use std::io::Write; use std::path::{Path, PathBuf}; use std::time::Duration; @@ -1221,6 +1223,14 @@ impl CrateDisambiguator { } } +impl fmt::Display for CrateDisambiguator { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + let (a, b) = self.0.as_value(); + let as_u128 = a as u128 | ((b as u128) << 64); + f.write_str(&base_n::encode(as_u128, base_n::CASE_INSENSITIVE)) + } +} + impl From<Fingerprint> for CrateDisambiguator { fn from(fingerprint: Fingerprint) -> CrateDisambiguator { CrateDisambiguator(fingerprint) |
