diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-22 11:04:25 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-11-02 09:01:02 +1100 |
| commit | b9cef6984b606705f42adf9587f4f1c3babf4d4d (patch) | |
| tree | 361f6ab139c3f9fd37c3a8bf7263ac5937ddb82f /src/librustc_codegen_utils | |
| parent | 5bc7084f7e1be9da93bb014e05f19a80ff6fa188 (diff) | |
Simplify various `Symbol` use points.
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
Diffstat (limited to 'src/librustc_codegen_utils')
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names/legacy.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_codegen_utils/symbol_names/legacy.rs b/src/librustc_codegen_utils/symbol_names/legacy.rs index 601a33a66bb..66e1b6d949e 100644 --- a/src/librustc_codegen_utils/symbol_names/legacy.rs +++ b/src/librustc_codegen_utils/symbol_names/legacy.rs @@ -121,9 +121,10 @@ fn get_symbol_hash<'tcx>( substs.hash_stable(&mut hcx, &mut hasher); if let Some(instantiating_crate) = instantiating_crate { - (&tcx.original_crate_name(instantiating_crate).as_str()[..]) + tcx.original_crate_name(instantiating_crate).as_str() + .hash_stable(&mut hcx, &mut hasher); + tcx.crate_disambiguator(instantiating_crate) .hash_stable(&mut hcx, &mut hasher); - (&tcx.crate_disambiguator(instantiating_crate)).hash_stable(&mut hcx, &mut hasher); } // We want to avoid accidental collision between different types of instances. |
