diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-10 11:18:06 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-14 13:06:44 +1000 |
| commit | 93e4b6ef06888085dc60d073ca9d66f2d7282112 (patch) | |
| tree | bb49d15663c725f09f9ee9be9ead04b8b97945a4 /compiler/rustc_codegen_ssa/src/debuginfo | |
| parent | ca122c7ebb3ab50149c9d3d24ddb59c252b32272 (diff) | |
| download | rust-93e4b6ef06888085dc60d073ca9d66f2d7282112.tar.gz rust-93e4b6ef06888085dc60d073ca9d66f2d7282112.zip | |
Rename the `ConstS::val` field as `kind`.
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index ae43464791d..f8497702832 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -180,7 +180,7 @@ fn push_debuginfo_type_name<'tcx>( if cpp_like_debuginfo { output.push_str("array$<"); push_debuginfo_type_name(tcx, inner_type, true, output, visited); - match len.val() { + match len.kind() { ty::ConstKind::Param(param) => write!(output, ",{}>", param.name).unwrap(), _ => write!(output, ",{}>", len.eval_usize(tcx, ty::ParamEnv::reveal_all())) .unwrap(), @@ -188,7 +188,7 @@ fn push_debuginfo_type_name<'tcx>( } else { output.push('['); push_debuginfo_type_name(tcx, inner_type, true, output, visited); - match len.val() { + match len.kind() { ty::ConstKind::Param(param) => write!(output, "; {}]", param.name).unwrap(), _ => write!(output, "; {}]", len.eval_usize(tcx, ty::ParamEnv::reveal_all())) .unwrap(), @@ -679,7 +679,7 @@ fn push_generic_params_internal<'tcx>( } fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut String) { - match ct.val() { + match ct.kind() { ty::ConstKind::Param(param) => { write!(output, "{}", param.name) } @@ -703,7 +703,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S // but we get a deterministic, virtually unique value for the constant. let hcx = &mut tcx.create_stable_hashing_context(); let mut hasher = StableHasher::new(); - hcx.while_hashing_spans(false, |hcx| ct.val().hash_stable(hcx, &mut hasher)); + hcx.while_hashing_spans(false, |hcx| ct.kind().hash_stable(hcx, &mut hasher)); // Let's only emit 64 bits of the hash value. That should be plenty for // avoiding collisions and will make the emitted type names shorter. let hash: u64 = hasher.finish(); |
