]> git.lizzy.rs Git - rust.git/commit
rustc: Store InternedString in `DefPathData`
authorAlex Crichton <alex@alexcrichton.com>
Fri, 1 Sep 2017 16:24:02 +0000 (09:24 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 5 Sep 2017 14:47:27 +0000 (07:47 -0700)
commit0cdc58a1bc6ea5ce9ba11c21bfd6d5b85b3efc87
tree739a1228f50ecb3fe062fdf4764a6c1f3847f113
parent9a231961d59135c7dc41d9b94ffe43ecc9bbd8cb
rustc: Store InternedString in `DefPathData`

Previously a `Symbol` was stored there, but this ended up causing hash
collisions in situations that otherwise shouldn't have a hash collision. Only
the symbol's string value was hashed, but it was possible for distinct symbols
to have the same string value, fooling various calcuations into thinking that
these paths *didn't* need disambiguating data when in fact they did!

By storing `InternedString` instead we're hopefully triggering all the exising
logic to disambiguate paths with same-name `Symbol` but actually distinct
locations.
23 files changed:
src/librustc/hir/lowering.rs
src/librustc/hir/map/def_collector.rs
src/librustc/hir/map/definitions.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/on_unimplemented.rs
src/librustc/ty/item_path.rs
src/librustc/ty/maps.rs
src/librustc/ty/mod.rs
src/librustc_const_eval/eval.rs
src/librustc_driver/test.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/decoder.rs
src/librustc_mir/build/expr/into.rs
src/librustc_mir/shim.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_trans/back/symbol_names.rs
src/librustc_trans/debuginfo/metadata.rs
src/librustc_trans/debuginfo/type_names.rs
src/librustc_trans/intrinsic.rs
src/librustc_trans/mir/block.rs
src/librustc_trans/mir/constant.rs
src/librustdoc/clean/mod.rs