Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #50893

Merged
merged 26 commits into from
May 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5e30f6b
CheckLoopVisitor: also visit break expressions
est31 May 17, 2018
a8c2332
Removed use of TypeIdHasher in debuginfo and replaced it with StableH…
iancormac84 May 8, 2018
9a746d5
Removed use of TypeIdHasher in symbol hash generation and replaced it…
iancormac84 May 8, 2018
659f164
Removed TypeIdHasher.
iancormac84 May 8, 2018
9041d81
Code structure edits.
iancormac84 May 8, 2018
ef38712
Removed unused imports.
iancormac84 May 8, 2018
6131c0a
Fix more unused imports errors.
iancormac84 May 8, 2018
b79edf0
Added extra hashing step.
iancormac84 May 8, 2018
18b032a
Removed unused import.
iancormac84 May 16, 2018
1839fae
Removed yet another unused import.
iancormac84 May 16, 2018
0349394
Fixed accidental removal of StableHasher declaration.
iancormac84 May 17, 2018
032831d
Update LLVM to 56c931901cfb85cd6f7ed44c7d7520a8de1edf97
nox May 17, 2018
59782f4
in which the unused shorthand field pattern debacle/saga continues
zackmdavis May 18, 2018
cf1f038
Reorder description for snippets in rustdoc documentation
robinkrahl May 18, 2018
8b02488
Fix warning when building stage0 libcore
dlrobertson May 19, 2018
387875d
Update clippy
oli-obk May 19, 2018
9e914cc
Rollup merge of #50531 - iancormac84:merge-typeidhasher-cleanup, r=mi…
kennytm May 19, 2018
ecce274
use if let to avoid potential div by zero
cjkenn May 17, 2018
8d9a87c
remove feature line from test
cjkenn May 19, 2018
fbfce83
Rollup merge of #50827 - nox:llvmup, r=eddyb
kennytm May 19, 2018
611dafc
Rollup merge of #50829 - est31:master, r=estebank
kennytm May 19, 2018
907288c
Rollup merge of #50854 - zackmdavis:and_the_case_of_the_unused_field_…
kennytm May 19, 2018
974396b
Rollup merge of #50858 - robinkrahl:rustdoc-fix-order, r=steveklabnik
kennytm May 19, 2018
9f34c7f
Rollup merge of #50883 - dlrobertson:fix_warning, r=TimNN
kennytm May 19, 2018
e1f031e
Rollup merge of #50819 - cjkenn:cjkenn/div-by-zero, r=kennytm
kennytm May 19, 2018
ada5fee
Rollup merge of #50889 - oli-obk:clippy, r=kennytm
kennytm May 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed use of TypeIdHasher in debuginfo and replaced it with StableH…
…asher. Also corrected erroneous mention of TypeIdHasher in implementation of HashStable trait.
  • Loading branch information
iancormac84 committed May 17, 2018
commit a8c2332cc890ca73911ea0133457b10bf56aefdc
2 changes: 1 addition & 1 deletion src/librustc/ich/impls_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ for ty::RegionKind {
ty::ReLateBound(..) |
ty::ReVar(..) |
ty::ReSkolemized(..) => {
bug!("TypeIdHasher: unexpected region {:?}", *self)
bug!("StableHasher: unexpected region {:?}", *self)
}
}
}
Expand Down
16 changes: 10 additions & 6 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ use llvm::debuginfo::{DIType, DIFile, DIScope, DIDescriptor,
use rustc::hir::CodegenFnAttrFlags;
use rustc::hir::def::CtorKind;
use rustc::hir::def_id::{DefId, CrateNum, LOCAL_CRATE};
use rustc::ty::fold::TypeVisitor;
use rustc::ty::util::TypeIdHasher;
use rustc::ich::Fingerprint;
use rustc::ich::{Fingerprint, NodeIdHashingMode};
use rustc::ty::Instance;
use common::CodegenCx;
use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
Expand Down Expand Up @@ -144,9 +142,15 @@ impl<'tcx> TypeMap<'tcx> {

// The hasher we are using to generate the UniqueTypeId. We want
// something that provides more than the 64 bits of the DefaultHasher.
let mut type_id_hasher = TypeIdHasher::<Fingerprint>::new(cx.tcx);
type_id_hasher.visit_ty(type_);
let unique_type_id = type_id_hasher.finish().to_hex();
let mut hasher = StableHasher::<Fingerprint>::new();
let mut hcx = cx.tcx.create_stable_hashing_context();
let type_ = cx.tcx.erase_regions(&type_);
hcx.while_hashing_spans(false, |hcx| {
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
type_.hash_stable(hcx, &mut hasher);
});
});
let unique_type_id = hasher.finish().to_hex();

let key = self.unique_id_interner.intern(&unique_type_id);
self.type_to_unique_id.insert(type_, UniqueTypeId(key));
Expand Down