|
| 1 | +use crate::cgu_reuse_tracker::CguReuseTracker; |
1 | 2 | use crate::code_stats::CodeStats;
|
2 | 3 | pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
|
3 |
| - |
4 |
| -use crate::cgu_reuse_tracker::CguReuseTracker; |
5 |
| -use rustc_data_structures::fingerprint::Fingerprint; |
6 |
| -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
7 |
| - |
8 | 4 | use crate::config::{self, OutputType, PrintRequest, Sanitizer, SwitchWithOptPath};
|
9 | 5 | use crate::filesearch;
|
10 | 6 | use crate::lint;
|
| 7 | +use crate::parse::ParseSess; |
11 | 8 | use crate::search_paths::{PathKind, SearchPath};
|
12 |
| -use rustc_data_structures::profiling::duration_to_secs_str; |
13 |
| -use rustc_errors::ErrorReported; |
14 | 9 |
|
15 |
| -use rustc_data_structures::base_n; |
16 |
| -use rustc_data_structures::impl_stable_hash_via_hash; |
| 10 | +pub use rustc_ast::crate_disambiguator::CrateDisambiguator; |
| 11 | +use rustc_data_structures::flock; |
| 12 | +use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 13 | +use rustc_data_structures::jobserver::{self, Client}; |
| 14 | +use rustc_data_structures::profiling::{duration_to_secs_str, SelfProfiler, SelfProfilerRef}; |
17 | 15 | use rustc_data_structures::sync::{
|
18 | 16 | self, AtomicU64, AtomicUsize, Lock, Lrc, Once, OneThread, Ordering, Ordering::SeqCst,
|
19 | 17 | };
|
20 |
| - |
21 |
| -use crate::parse::ParseSess; |
22 | 18 | use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter;
|
23 |
| -use rustc_errors::emitter::HumanReadableErrorType; |
24 |
| -use rustc_errors::emitter::{Emitter, EmitterWriter}; |
| 19 | +use rustc_errors::emitter::{Emitter, EmitterWriter, HumanReadableErrorType}; |
25 | 20 | use rustc_errors::json::JsonEmitter;
|
26 |
| -use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticId}; |
| 21 | +use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticId, ErrorReported}; |
27 | 22 | use rustc_span::edition::Edition;
|
28 |
| -use rustc_span::source_map; |
29 |
| -use rustc_span::{MultiSpan, Span}; |
30 |
| - |
31 |
| -use rustc_data_structures::flock; |
32 |
| -use rustc_data_structures::jobserver::{self, Client}; |
33 |
| -use rustc_data_structures::profiling::{SelfProfiler, SelfProfilerRef}; |
| 23 | +use rustc_span::source_map::{self, MultiSpan, Span}; |
34 | 24 | use rustc_target::spec::{PanicStrategy, RelroLevel, Target, TargetTriple};
|
35 | 25 |
|
36 | 26 | use std::cell::{self, RefCell};
|
37 | 27 | use std::env;
|
38 |
| -use std::fmt; |
39 | 28 | use std::io::Write;
|
40 | 29 | use std::num::NonZeroU32;
|
41 | 30 | use std::path::PathBuf;
|
@@ -1193,34 +1182,6 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
|
1193 | 1182 | }
|
1194 | 1183 | }
|
1195 | 1184 |
|
1196 |
| -/// Hash value constructed out of all the `-C metadata` arguments passed to the |
1197 |
| -/// compiler. Together with the crate-name forms a unique global identifier for |
1198 |
| -/// the crate. |
1199 |
| -#[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Clone, Copy, RustcEncodable, RustcDecodable)] |
1200 |
| -pub struct CrateDisambiguator(Fingerprint); |
1201 |
| - |
1202 |
| -impl CrateDisambiguator { |
1203 |
| - pub fn to_fingerprint(self) -> Fingerprint { |
1204 |
| - self.0 |
1205 |
| - } |
1206 |
| -} |
1207 |
| - |
1208 |
| -impl fmt::Display for CrateDisambiguator { |
1209 |
| - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { |
1210 |
| - let (a, b) = self.0.as_value(); |
1211 |
| - let as_u128 = a as u128 | ((b as u128) << 64); |
1212 |
| - f.write_str(&base_n::encode(as_u128, base_n::CASE_INSENSITIVE)) |
1213 |
| - } |
1214 |
| -} |
1215 |
| - |
1216 |
| -impl From<Fingerprint> for CrateDisambiguator { |
1217 |
| - fn from(fingerprint: Fingerprint) -> CrateDisambiguator { |
1218 |
| - CrateDisambiguator(fingerprint) |
1219 |
| - } |
1220 |
| -} |
1221 |
| - |
1222 |
| -impl_stable_hash_via_hash!(CrateDisambiguator); |
1223 |
| - |
1224 | 1185 | /// Holds data on the current incremental compilation session, if there is one.
|
1225 | 1186 | #[derive(Debug)]
|
1226 | 1187 | pub enum IncrCompSession {
|
|
0 commit comments