Skip to content

File tree

14 files changed

+31
-16
lines changed

14 files changed

+31
-16
lines changed
 

‎src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::*;
1212
use dep_graph::{DepGraph, DepKind, DepNodeIndex};
1313
use hir::def_id::{LOCAL_CRATE, CrateNum};
1414
use hir::intravisit::{Visitor, NestedVisitorMap};
15-
use hir::svh::Svh;
15+
use rustc_data_structures::svh::Svh;
1616
use ich::Fingerprint;
1717
use middle::cstore::CrateStore;
1818
use session::CrateDisambiguator;

‎src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ use hir::def_id::{CRATE_DEF_INDEX, DefId, LocalDefId, DefIndexAddressSpace};
2222
use middle::cstore::CrateStore;
2323

2424
use rustc_target::spec::abi::Abi;
25+
use rustc_data_structures::svh::Svh;
2526
use syntax::ast::{self, Name, NodeId, CRATE_NODE_ID};
2627
use syntax::codemap::Spanned;
2728
use syntax::ext::base::MacroKind;
2829
use syntax_pos::{Span, DUMMY_SP};
2930

3031
use hir::*;
3132
use hir::print::Nested;
32-
use hir::svh::Svh;
3333
use util::nodemap::FxHashMap;
3434

3535
use std::io;

‎src/librustc/hir/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub mod lowering;
7070
pub mod map;
7171
pub mod pat_util;
7272
pub mod print;
73-
pub mod svh;
7473

7574
/// A HirId uniquely identifies a node in the HIR of the current crate. It is
7675
/// composed of the `owner`, which is the DefIndex of the directly enclosing

‎src/librustc/middle/cstore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
2626
use hir::map as hir_map;
2727
use hir::map::definitions::{DefKey, DefPathTable};
28-
use hir::svh::Svh;
28+
use rustc_data_structures::svh::Svh;
2929
use ty::{self, TyCtxt};
3030
use session::{Session, CrateDisambiguator};
3131
use session::search_paths::PathKind;

‎src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use hir::{map as hir_map, FreevarMap, TraitMap};
1818
use hir::def::{Def, CtorKind, ExportMap};
1919
use hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
2020
use hir::map::DefPathData;
21-
use hir::svh::Svh;
21+
use rustc_data_structures::svh::Svh;
2222
use ich::Fingerprint;
2323
use ich::StableHashingContext;
2424
use infer::canonical::Canonical;

‎src/librustc/ty/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use errors::DiagnosticBuilder;
1313
use hir::def_id::{CrateNum, DefId, DefIndex};
1414
use hir::def::{Def, Export};
1515
use hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs};
16-
use hir::svh::Svh;
16+
use rustc_data_structures::svh::Svh;
1717
use infer::canonical::{self, Canonical};
1818
use lint;
1919
use middle::borrowck::BorrowCheckResult;

‎src/librustc_codegen_utils/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use rustc::session::config::{self, OutputFilenames, Input, OutputType};
1212
use rustc::session::Session;
1313
use rustc::middle::cstore::LinkMeta;
14-
use rustc::hir::svh::Svh;
14+
use rustc_data_structures::svh::Svh;
1515
use std::path::{Path, PathBuf};
1616
use syntax::{ast, attr};
1717
use syntax_pos::Span;

‎src/librustc_data_structures/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ extern crate stable_deref_trait;
4646
extern crate rustc_rayon as rayon;
4747
extern crate rustc_rayon_core as rayon_core;
4848
extern crate rustc_hash;
49+
extern crate serialize;
4950

5051
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
5152
#[allow(unused_extern_crates)]
5253
extern crate rustc_cratesio_shim;
5354

5455
pub use rustc_serialize::hex::ToHex;
5556

57+
pub mod svh;
5658
pub mod accumulate_vec;
5759
pub mod array_vec;
5860
pub mod base_n;

‎src/librustc/hir/svh.rs ‎src/librustc_data_structures/svh.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use std::fmt;
1919
use std::hash::{Hash, Hasher};
2020
use serialize::{Encodable, Decodable, Encoder, Decoder};
2121

22+
use stable_hasher;
23+
2224
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
2325
pub struct Svh {
2426
hash: u64,
@@ -67,6 +69,16 @@ impl Decodable for Svh {
6769
}
6870
}
6971

70-
impl_stable_hash_for!(struct Svh {
71-
hash
72-
});
72+
impl<T> stable_hasher::HashStable<T> for Svh {
73+
#[inline]
74+
fn hash_stable<W: stable_hasher::StableHasherResult>(
75+
&self,
76+
ctx: &mut T,
77+
hasher: &mut stable_hasher::StableHasher<W>
78+
) {
79+
let Svh {
80+
hash
81+
} = *self;
82+
hash.hash_stable(ctx, hasher);
83+
}
84+
}

‎src/librustc_incremental/persist/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@
114114
//! unsupported file system and emit a warning in that case. This is not yet
115115
//! implemented.
116116
117-
use rustc::hir::svh::Svh;
118117
use rustc::session::{Session, CrateDisambiguator};
119118
use rustc::util::fs as fs_util;
120119
use rustc_data_structures::{flock, base_n};
121120
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
121+
use rustc_data_structures::svh::Svh;
122122

123123
use std::fs as std_fs;
124124
use std::io;

‎src/librustc_metadata/creader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use schema::CrateRoot;
1616
use rustc_data_structures::sync::{Lrc, RwLock, Lock};
1717

1818
use rustc::hir::def_id::{CrateNum, CRATE_DEF_INDEX};
19-
use rustc::hir::svh::Svh;
19+
use rustc_data_structures::svh::Svh;
2020
use rustc::middle::allocator::AllocatorKind;
2121
use rustc::middle::cstore::DepKind;
2222
use rustc::mir::interpret::AllocDecodingState;

‎src/librustc_metadata/cstore_impl.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use rustc::hir::map::{DefKey, DefPath, DefPathHash};
3030
use rustc::hir::map::blocks::FnLikeNode;
3131
use rustc::hir::map::definitions::DefPathTable;
3232
use rustc::util::nodemap::DefIdMap;
33+
use rustc_data_structures::svh::Svh;
3334

3435
use std::any::Any;
3536
use rustc_data_structures::sync::Lrc;
@@ -515,7 +516,7 @@ impl CrateStore for cstore::CStore {
515516
self.get_crate_data(cnum).root.disambiguator
516517
}
517518

518-
fn crate_hash_untracked(&self, cnum: CrateNum) -> hir::svh::Svh
519+
fn crate_hash_untracked(&self, cnum: CrateNum) -> Svh
519520
{
520521
self.get_crate_data(cnum).root.hash
521522
}

‎src/librustc_metadata/locator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ use cstore::{MetadataRef, MetadataBlob};
226226
use creader::Library;
227227
use schema::{METADATA_HEADER, rustc_version};
228228

229-
use rustc::hir::svh::Svh;
229+
use rustc_data_structures::svh::Svh;
230230
use rustc::middle::cstore::MetadataLoader;
231231
use rustc::session::{config, Session};
232232
use rustc::session::filesearch::{FileSearch, FileMatches, FileDoesntMatch};

‎src/librustc_metadata/schema.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use rustc::mir;
2020
use rustc::session::CrateDisambiguator;
2121
use rustc::ty::{self, Ty, ReprOptions};
2222
use rustc_target::spec::{PanicStrategy, TargetTriple};
23+
use rustc_data_structures::svh::Svh;
2324

2425
use rustc_serialize as serialize;
2526
use syntax::{ast, attr};
@@ -187,7 +188,7 @@ pub struct CrateRoot {
187188
pub name: Symbol,
188189
pub triple: TargetTriple,
189190
pub extra_filename: String,
190-
pub hash: hir::svh::Svh,
191+
pub hash: Svh,
191192
pub disambiguator: CrateDisambiguator,
192193
pub panic_strategy: PanicStrategy,
193194
pub edition: Edition,
@@ -223,7 +224,7 @@ pub struct CrateRoot {
223224
#[derive(RustcEncodable, RustcDecodable)]
224225
pub struct CrateDep {
225226
pub name: ast::Name,
226-
pub hash: hir::svh::Svh,
227+
pub hash: Svh,
227228
pub kind: DepKind,
228229
pub extra_filename: String,
229230
}

0 commit comments

Comments
 (0)
Please sign in to comment.