about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-14 10:35:29 +0200
committerGitHub <noreply@github.com>2022-06-14 10:35:29 +0200
commit9e5c5c57e97098b4d1e04a1215628ff6eb54986b (patch)
treef0834ff062f8f2a4425a24d5112c254fd455d20f /compiler/rustc_const_eval/src/transform
parent4b1d510e0c5a9607ff5b1966b4d85659077ad7d8 (diff)
parent93e4b6ef06888085dc60d073ca9d66f2d7282112 (diff)
downloadrust-9e5c5c57e97098b4d1e04a1215628ff6eb54986b.tar.gz
rust-9e5c5c57e97098b4d1e04a1215628ff6eb54986b.zip
Rollup merge of #97935 - nnethercote:rename-ConstS-val-as-kind, r=lcnr
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.

r? `@BoxyUwU`
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs3
-rw-r--r--compiler/rustc_const_eval/src/transform/promote_consts.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index 9fd94dc334f..6e5a0c813ac 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -353,7 +353,8 @@ where
 
     // Check the qualifs of the value of `const` items.
     if let Some(ct) = constant.literal.const_for_ty() {
-        if let ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs: _, promoted }) = ct.val() {
+        if let ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs: _, promoted }) = ct.kind()
+        {
             // Use qualifs of the type for the promoted. Promoteds in MIR body should be possible
             // only for `NeedsNonConstDrop` with precise drop checking. This is the only const
             // check performed after the promotion. Verify that with an assertion.
diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs
index d1e776854b2..67a356918d1 100644
--- a/compiler/rustc_const_eval/src/transform/promote_consts.rs
+++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs
@@ -842,7 +842,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
                     literal: tcx
                         .mk_const(ty::ConstS {
                             ty,
-                            val: ty::ConstKind::Unevaluated(ty::Unevaluated {
+                            kind: ty::ConstKind::Unevaluated(ty::Unevaluated {
                                 def,
                                 substs: InternalSubsts::for_item(tcx, def.did, |param, _| {
                                     if let ty::GenericParamDefKind::Lifetime = param.kind {