about summary refs log tree commit diff
path: root/clippy_utils
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-06-10 11:18:06 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-14 13:06:44 +1000
commit7969056f6fec0e1ead7f90461e1971ca353dc145 (patch)
tree10e92fd8b35d780e6f6af63e9e19933ca732f779 /clippy_utils
parentd02499794373b25af281e69a52a7a0608f7b3bfd (diff)
downloadrust-7969056f6fec0e1ead7f90461e1971ca353dc145.tar.gz
rust-7969056f6fec0e1ead7f90461e1971ca353dc145.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 'clippy_utils')
-rw-r--r--clippy_utils/src/consts.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/consts.rs b/clippy_utils/src/consts.rs
index d487868cafe..159c5d53d02 100644
--- a/clippy_utils/src/consts.rs
+++ b/clippy_utils/src/consts.rs
@@ -582,7 +582,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
 
 pub fn miri_to_const(result: ty::Const<'_>) -> Option<Constant> {
     use rustc_middle::mir::interpret::ConstValue;
-    match result.val() {
+    match result.kind() {
         ty::ConstKind::Value(ConstValue::Scalar(Scalar::Int(int))) => {
             match result.ty().kind() {
                 ty::Bool => Some(Constant::Bool(int == ScalarInt::TRUE)),